[antlr-interest] Passing information into the parser

Gokulakannan Somasundaram gokul007 at gmail.com
Sun Dec 28 22:13:47 PST 2008


Hi,
         I have a requirement, where in before starting the parsing, i need
to tell the parser whether the first token is T_FUNCTION / T_TRIGGER(say
callType). (i.e) this token is not available as part of the text to be
parsed. In Bison, it is just declared with %token T_FUNCTION and %token
T_TRIGGER. The scanner makes sure that it emits the callType token before it
emits the tokens to be parsed. Although, i am able to come up with some ways
to do this, they are too ugly.
            Can someone provide me a clean way of passing information into
the parser and make the scanner emit that as the first token, even before
the actual tokens are emitted? I am trying to do this in C-Language target.

Thanks in Advance,
Gokul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081229/4c48021e/attachment.html 


More information about the antlr-interest mailing list