I have a question regarding Antlr, I am building a simple parser with it but I can t traverse the tree. I have found many online tutorials and they use a getAst();
function of the Parser class. Does anyone have any experience with this? I have the feeling that the way of doing this differs per version.
grammar SimpleCalc;
options
{
output=AST;
}
tokens {
PLUS = + ;
MINUS = - ;
MULT = * ;
DIV = / ;
SEMICOLON = ; ;
EQUAL = = ;
COMMA = , ;
BRACKETL = ( ;
BRACKETR = ) ;
}
没有人对如何以替代方式tra树有任何想法或建议?