When I run a test and view a parse tree for my ANTLR grammar through the interpreter that's provided with the ANTLR eclipse plugin, everything looks good. That is, I can see that my lexer tokens have matched up with my parser rules. However, when I run the compiled Parser code, I get mismatched character exceptions that get thrown out and don't become part of my parse rules. What is the difference in settings between the interperter and my compiled grammar? That is, what is the interpreter doing to trap the mismatches and decide to correctly place them with my parser rules?
Thanks
I'm being purposely vague because I've seen this with a number of different grammar tests that I've run. The interpreter seems to take the mismatched tokens and add them to the rule, which is what I want, but the compiled code doesn't. So it appears that the interpreter is trapping those exceptions and using the tokens to build the parse tree instead of throwing them out. I *believe* eclipse is using ANTLR 3.5 and that is the runtime jar that I am using well.
Would you recommend going to ANTLR 4.0 and trying to take advantage of new features that might help me consume those mismatched tokens and add them to my rule or some such thing?
Thanks