Is it possible to do what I'm attempting here? Or, perhaps I'm approaching it wrong?
arrayDef
: { int c = 0; }
('['']' {c++;})+
-> ARRAY /* somehow inject c here */
;
Is it possible to do what I'm attempting here? Or, perhaps I'm approaching it wrong?
arrayDef
: { int c = 0; }
('['']' {c++;})+
-> ARRAY /* somehow inject c here */
;
Why not use the ChildCount
of your ARRAY
tree node?
arrayDef
: ('[' ']')+
-> ^(ARRAY '['+)
;