I am going to use ANTLR 4.5.3 to translate one notation to another. I already developed a grammar description using the plugin in IntelliJ IDEA.
In my grammar, one rule has several alternatives.
When I look at the results in the "Parsing Tree", each node consists of a "rule name": "line number".
How to get this information using the API? If I understand this clearly, the line number can be obtained from getAltNumber (), but this field is empty.
http://www.antlr.org/api/Java/org/antlr/v4/runtime/RuleContext.html#getAltNumber ()
The docs say that the default implementation does not compute and does not store this alt number.
How to get this information?
source
share