[antlr-interest] Problem with addASTChild method

vaphel at op.pl vaphel at op.pl
Sun Sep 11 13:53:27 PDT 2005


Hello,
 
I try to implement a tree parser which after every appearance of some token type (e.g. 25) add SEMIcolon. I did it in this way like on example below, but it not work. What may be wrong?
 
start_rule: #("top" (q:.
{
 if (#q.getType() == 25 )
 {
  AST plus_AST = #[SEMI];
  astFactory.addASTChild(currentAST, plus_AST);
 }
}
)*
);

Thank for helping me.
Regards,
Vaphel


More information about the antlr-interest mailing list