Writing java-style If statements in XText results in an error [message #1810536] |
Tue, 13 August 2019 05:46  |
Eclipse User |
|
|
|
I'm writing a custom Xtext editor for my own DSL-Language and now want to add If-Statements to my language.
The Statements look something like this:
But when I try adding them in, I get an error "A class may not be a super type of itself".
This is my code so far:
grammar XtextTest with org.eclipse.xtext.common.Terminals
generate xtextTest "http://www.my.xtext/Test"
Model:
statements+=Statement*;
Statement:
VariableAssignment |
IfStatement;
IfStatement:
'if' '(' BooleanExpression ')' '{' Statement '}';
BooleanExpression:
'TRUE' | 'FALSE';
VariableAssignment:
name=ID "=" INT ';';
How can I implement this? Or am I doing something obviously wrong?
Any help is appreciated ^^
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03208 seconds