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 = ')';
}
Anyone have any idea, or suggestions on how to traverse the tree in an alternative way?