Hello Jim, > Look at the interface for CommonToken you can see that there is the > ability to get the line number (it assumes \n is the delimiter unless you > change that.
yep, there is an ANTLR3_COMMON_TOKEN_struct. But I need additional infos - e. g. where is that struct populated the first time. Do you have a dependency graph/sketch which structures are used (and when) based on a simple grammar? Many thanks and greetings Udo >> -----Original Message----- >> From: [email protected] [mailto:antlr-interest- >> [email protected]] On Behalf Of Udo Weik >> Sent: Sunday, October 23, 2011 11:28 AM >> To: [email protected] >> Subject: [antlr-interest] Jim Idle: C-Runtime, position of elements >> >> Hello Jim, >> >> my string looks like: >> 012345 >> abcd >> pos (lexer) is 1 >> >> 012345 >> abcd >> pos (lexer) is 0 >> >> 012345 >> abcd >> pos (lexer) is -1 >> >> Is that as it should be? >> >> And is there any way to get line/pos in the parser? >> I need this from all elements. >> >> >> Many thanks and greetings >> Udo >> >> List: http://www.antlr.org/mailman/listinfo/antlr-interest >> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your- >> email-address > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: > http://www.antlr.org/mailman/options/antlr-interest/your-email-address 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.
