Datatype rules [message #707536] |
Mon, 01 August 2011 15:38  |
Eclipse User |
|
|
|
I have a grammar like:
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"
Model:
greetings+=Greeting*;
Greeting:
'Hello' name=ID '!'
'Person:'value=ConstantValue;
ConstantValue:
value=(BooleanType | NullObjectType );
NullObjectType returns ecore::EJavaObject:
NULL_CONSTANT;
BooleanType returns ecore::EBoolean:
BOOLEAN_CONSTANT;
terminal BOOLEAN_CONSTANT returns ecore::EBoolean:
'true' | 'false';
terminal NULL_CONSTANT:
'null';
----------------
The above grammar shows errors, at the rule ConstantValue.
Seems like this could be because of the individual data type rules used within, each of which return different types.
Could someone advice how this can be handled in xtext2.0?
Thanks
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03537 seconds