Hi Evan -- couple more points on your xml grammar directly relating to your 
questions.

1. On checking, as I suspected yesterday, the pattern:

('x'|'X') ('m'|'M') ('l'|'L')

... is not scoring a hit because the parser slurps up "xml" as a GENERIC_ID, 
not as a sequence of three single-character tokens for the three letters. You 
can verify by temporarily changing the rule to look for 'xml' instead, and 
you'll see that work.

FWIW, specifying a literal like this in the parser causes ANTLR to generate a 
token and recognizer code for it in the lexer.

To get the case-insensitive effect, you could create a lexer rule:
XML: ('x'|'X')  ('m'|'M') ('l'|'L') ;
... and use the XML token in the parser xmldecl rule.

2. The attribute parser rule refers to VALUE, which is defined as a lexer 
fragment. As a lexer fragment, it doesn't generate a token, and consequently 
the parser will never see it.  

(I believe it's a known issue that ANTLR doesn't flag this as an error.)

Hope that helps,

Graham



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 il-antlr-interest@googlegroups.com
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to