ANTLR - Embedding Java code, evaluate before or after?
- by wvd
Hello all,
I'm writing a simple scripting language on top of Java/JVM, where you can also embed Java code using the {} brackets. The problem is, how do I parse this in the grammar? I have two options:
1] Allow everything to be in it, such as: [a-z|a-Z|0-9|_|$], and go on
2] Get an extra java grammar and use that grammar to parse that small code (is it actually possible and efficient?)
Since option 2] is basically a double-check since when evaluating java code it's also being checked. Now my last question is -- is way that can dynamically execute java code also with objects which have been created at runtime?
Thanks,
William van Doorn