[antlr-interest] Empty ifs in Java

Patrick Zimmermann patrick at zakweb.de
Sun Nov 6 04:40:34 PST 2011


Hey,

thank you again for your explanation.

-snip-
> You could let the lexer simply create single tokens and create parser rules
> that match a certain range of tokens (like the `ab` rule below):
-snip-

Creating a different token for each character is not possible since I'm dealing 
with unicode.

Only separating out characters I care about syntactically might be an option.
But won't  this become awkward when I want to catch longer tokens like
'<ref name="'
then I would have to create lexer rules for '<', 'r' 'e' 'f' ... and use those 
to express this string as
LThan R E F Space N A M E Equals Quote

This doesn't seem like a good way to do this.

I still think that a scannerless parser might be a better alternative. Are 
there any good reasons against switching (apart from ANTLR being a great tool 
in general)?

Regards,

Patrick


More information about the antlr-interest mailing list