Hello everyone,
it's my first time using antlr4 for a school project, i've written the grammar, and now i'm writing a sort of "parser/translator" in c++
I have this case:
A : ID op (NUMBER | ID);
B: (A|C)((other_op)(A|C))+;
C:'(' (B|A) ')';
Basically antlr4 generate the cpp code that i should use, so translating B i've two vectors: one contains all the A and one all the C.
How do i know the order? I mean, both the vectors are 0-n, i can't understand if the order is A .. A .. C or C .. A .. C.
How do i discorver the order? I read something about tokens but i've no idea how to use them...
I'd like to get the order so i can get the contexts in order, so i know i have to read AContext* - AContext* - CContext*
Any suggestion?
Thanks guys