Antlr4 c++ get name of rule from ParseTree *

  antlr4, c++

While traversing the parse tree created, I need a way to get the name of the parser rule from the antlr4:tree:ParseTree * node that I am currently traversing

for example if the grammar is:

t: AB;

(ignore lexer rules for now) and t is some rule, I need to check if the node (type: ParseTree *) corresponds to rule t.

Thanks

Source: Windows Questions C++

LEAVE A COMMENT