[antlr-interest] SEEK with ANTLR C runtime in tree grammar

Bryce Carman bryce at greentab.net
Thu May 20 18:52:29 PDT 2010


I'm using the ANTLR C runtime and I am trying to figure out if there is a
way to jump to an earlier part of the AST during a tree grammar.  I have the
pANTLR3_BASE_TREE pointer to where I want to jump to, but SEEK seems to

pANTLR3_BASE_TREE tree = *...*
ANTLR3_MARKER mark = MARK();
SEEK(tree->savedIndex);
rule(ctx);
REWIND(mark);

It seems like after calling SEEK, it is actually moving to the parent of the
node that I really want to seek to.  Am I doing the MARK, SEEK, REWIND
correctly for a tree grammar?  Any idea why I actually seem to seek to the
parent node?


More information about the antlr-interest mailing list