[antlr-interest] Learning the basics of ANTLR
Graham Wideman
gwlist at grahamwideman.com
Tue Oct 13 11:43:37 PDT 2009
You haven't shown your revised grammar. However, in the old grammar the xmldecl rule says that an attribute is required, so feeding in just:
xml
will not satisfy xmldecl.
-- Graham
At 10/13/2009 11:24 AM, Evan Metheny wrote:
>Thanks for the response Graham
>
>> Fragments can only be part of another lexer rule, they are not stand-alone
>token-producing lexer rules. Henxe the missing token exception.
>
>OK that makes sense, when changing fragment GENERIC_ID to GENERIC_ID.
>The "xmldecl" rule breaks with "mismatched set exception" when trying
>to recognize "xml". Thats what i was trying to explain with:
>
>>
>> Also:
>>> I cant
>>>understand why it would break the recognition of "XML" when its before
>>>the attribute call.
>>
>> So far as I know, there is no impact of order in which the lexer and
>parser rules appear in the .g file.
>
>Thanks
>
>-Evan
More information about the antlr-interest
mailing list