Closed pieterbos closed 8 years ago
I think in that case it would be clearer to make the ';' integer_value part its own rule, i.e.
c_integer: ( integer_value | integer_list_value | integer_interval_value | integer_interval_list_value ) assumed_integer_value? ;
assumed_integer_value: ';' integer_value;
but I am not sure what this looks like in the output tree.
I agree that that is better. Both work fine in the output tree. You can in both cases just call:
c_integerContext.assumed_integer_value().integer_value();
and you get the assumed integer value. Same if you do it with a listener instead of walking the tree manually.
You fixed this - thanks :)
The current syntax for c_integer is:
This makes it rather annoying to parse in code, because you get just an array of integer values and you have to check the semicolon to see how to tree it.
it could be changed in:
Which would make walking this tree much easier.