At 02:16 8/02/2009, Bob Marinier wrote:
 >The problem is that IDs in my system don't allow dashes, but 
some
 >keywords have dashes in them. So keywords with dashes don't get
 >recognized in the parser. But it seems to work if I put all of
 >the keywords with dashes in the lexer, and the ones without
 >dashes in the parser. Having the keywords list spread out over
 >two locations makes me cringe a bit, but maybe this is the
 >cleanest solution?

It might be.  Another option would be to accept the dashes in the 
lexer regardless and raise an error in the parser if they're used 
inappropriately (since it's better to have the parser raise errors 
than for the lexer to do so).  The downside of that, though, is 
that it becomes harder to recognise "a-b" (no spaces) as "a minus 
b".


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