Skip to content
Advertisement

antlr4 – get left and right sibling of rule context

An easy question, on which I cannot find something useful in the API docs: is there a way to get the left and right sibling of a ParserRuleContext?

Say I have in my .g4:

identifiers : identifier (',' identifier)*;

When handling a IdentifierContext, I would like to get a reference to the left and the right IdentifierContext.

Advertisement

Answer

[…] is there a way to get the left and right sibling of a ParserRuleContext?

No, alas, there is not.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement