[antlr-interest] Temporarily change the position of the parser

Fred phreed at gmail.com
Fri Jan 4 19:18:04 PST 2008


There are probably other ways to accomplish this but....

I have an AST.
On the first pass my program builds a symbol table, a dictionary of
names and node references into the AST.
Second pass, the program searches for entities, these entities
reference the names from the symbol table.
When the second pass finds an entity it creates a tree parser and
parses the tree starting at the entity.
I want the parser needs to push the current position in the AST onto a
stack, change the position to the that referenced by the symbol table,
parse from that node and return.

It would seem that the symbols could be pre-parsed when the symbol
table is built but they need to be processed differently based on
where used.


More information about the antlr-interest mailing list