Attached is a snippet of the grammar in question, where tagCommentNbr is the integer value enclosed in brackets that I referred to in my email post. George
tagCommentElement returns [ParserTagCommentElement pTagCommentElement] @init { pTagCommentElement = new ParserTagCommentElement(); //db not req'd } : tagCommentNbr (elementName)? { pTagCommentElement.tagCommentNbr = $tagCommentNbr.text; pTagCommentElement.elementName = $elementName.text; } ; tagCommentNbr : '[' IntValue ']' ; elementName : '.' alphaN ; IntValue : ('0'..'9')+ ; -----Original Message----- From: Chris Rebert [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2008 9:54 PM To: George J. Shannon Cc: [EMAIL PROTECTED] Subject: Re: [antlr-interest] Simple parsing question Including at least part of the grammar in question would probably be very useful to anyone trying to help you. Regards, Chris On Fri, Sep 5, 2008 at 7:45 PM, George J. Shannon <[EMAIL PROTECTED]> wrote: > I have a parser that gets a MismatchedTokenException error that I would > appreciate assistance on. > > Within the text being parsed is a simple rule that looks for '[' IntValue > ']' where IntValue is the rule ('0'..'9')+ (i.e., integer value inside > brackets). > > This may not be relevant, but I guess I should mention that this rule is > called by other rules, so this sequence is embedded inside other text. > > Anyway, I get the MismatchedTokenException whenever I run into a '[0]', but > not when I run into '[00]' or any single digit other than '0'. > > So, what's so special about 0 that I'm obviously missing? > > Sorry to bother you with an obvious question; I have brain cramp after > staring at this for about an hour. > > I'm using antlr 3.2 with ANTLRworks 1.2, but the error occurs with the > 3.1/1.1.7 combination as well. > > Thanks in advance for the help. > > Regards, > > George > > > > > > > > > > George Shannon > > President, Raphael Analytics, Inc. > > 16 Spur Drive > > Fenton, MO 63026 > > (314) 550-5589 (cell) > > [EMAIL PROTECTED] > > www.raphaelanalytics.com > > > > The information transmitted is intended only for the person or entity to > which it is addressed and may contain confidential and/or privileged > material. Any review, retransmission, dissemination or other use of, or > taking of any action in reliance upon, this information by persons or > entities other than the intended recipient is prohibited. If you received > this in error, please contact the sender and delete the material from any > computer. > > > > List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest > Unsubscribe: > http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address > > > -- Follow the path of the Iguana... http://rebertia.com List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org:8080/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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---