Gavin Lambert wrote:
> At 07:32 14/08/2009, [email protected] wrote:
>  >I have a simple grammar for quizzes that doesn't work in the
>  >debugger, although works fine in the interpreter.
> [...]
>  >LETTER         : ('a'..'z'|'A'..'Z');
>  >INT         : '0'..'9'+;
>  >NEWLINE     : '\n' '\r'? {skip();};
> 
> These rules should be marked as fragments, since you're consuming them 
> from other lexer rules and not expecting to receive them in the parser.
> 
> The general rule of thumb is that you should never define two 
> non-fragment lexer rules that can consume the same input, and try to 
> avoid doing so when they consume the same common left prefix.  (Even in 
> the cases where you can get away with having a common left prefix, it 
> reduces performance to do so.)
> 
> 

Thanks for the tip! I marked the appropriate rules as fragments, however 
all the issues in the original post still stand. The debugger simply 
generates a Parse Tree of root -> quiz, while the Interpreter correctly 
generates the Parse Tree. Is this possibly an issue with ANTLRWorks itself?

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to