Specific Class type in xtext grammar [message #1734611] |
Thu, 09 June 2016 18:41  |
Eclipse User |
|
|
|
I am experimenting with creating a small command based language. I am trying to specify the type of "command" class. For example:
Click SomeWebPage.LOGIN_BUTTON ;
both Click and LOGIN_BUTTON are of specific types. Click implements ICommand and LOGIN_BUTTON implements IElement.
I know I can get this in the validator, and proposal, but for implmenting an interpreter, I like to specify those types.
Currently, this is the relevant parts:
Action:
ActionType config=ActionConfiguration ";";
ActionType:
type=JvmTypeReference;
ActionConfiguration:
{ActionConfiguration} component=(ActionComponent)? (data+=Datum)?;
ActionComponent:
ele=[jvmTypes::JvmTypeReference];
Datum:
content=Property | Value;
Property:
QualifiedName;
Value:
value=(Number | STRING);
Is there a documentation or tutorial with example, that shows how to do this ?
Thank you
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04083 seconds