This grammar
Program:
(statements+=Statement)*;
Statement:
AssignmentStatement;
AssignmentStatement:
Variable EqualOperator AdditionExpression;
AdditionExpression:
Number AdditionOperator Number;
AdditionOperator:
AddOp="+";
EqualOperator:
"=";
Number:
INT;
Variable:
VAR;
terminal VAR:('a'..'z');
gives me, for
x=1+2
in the outline window of the DSLRuntime Eclipse application, the
tree
How do I extend the grammar so that
is generated? In the end, I would like to have:
ProjectName
=
x
+
1
2
corresponding to
=
/ \
x +
/ \
1 2
I have been experimenting and studying examples for quite some time, but I am not getting any closer.
Thank you very much :-)