SlideShare a Scribd company logo
modelsUsing
with
Holger Schill
Generated model
Generated model
Generated model
You will come to the point…
Where you want to take control…
Problem
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"
Model:
elements+=AbstractElement*;
AbstractElement:
Element | SecondElement | ThirdElement
;
Element:
'Element' name=ID ref=[AbstractElement]
;
SecondElement:
'SecondElement' name=ID
;
ThirdElement:
'ThirdElement' name=ID
;
Example
Problem
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"
Model:
elements+=AbstractElement*;
AbstractElement:
Element | SecondElement | ThirdElement
;
Element:
'Element' name=ID ref=[AbstractElement]
;
SecondElement:
'SecondElement' name=ID
;
ThirdElement:
'ThirdElement' name=ID
;
Example
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"
Model:
elements+=AbstractElement*;
AbstractElement:
Element | SecondElement | ThirdElement
;
Element:
'Element' name=ID ref=[Referenceable]
;
SecondElement:
'SecondElement' name=ID
;
ThirdElement:
'ThirdElement' name=ID
;
Referenceable:
SecondElement | ThirdElement
;
Never invoked by the parser
Example
Fake Rules to influence EMF Generator
For rapid prototyping the generated model is fine
When to stay with the generated model
For rapid prototyping the generated model is fine
Automatic synchronisation from grammar to model
When to stay with the generated model
For rapid prototyping the generated model is fine
Automatic synchronisation from grammar to model
If you do not need to introduce fake rules
When to stay with the generated model
But what if…
DSL DSL DSL
Order for generating DSLs is important
But what if…
DSL DSL DSL
Order for generating DSLs is important
Eagerly loaded
DSL DSL
DSLs reference each other
But what if…
Imported Model
Imported Model
Imported Model
Xtext Nature !
Still that tree editor…
Still that tree editor…
Merging can be difficult
Generation Gap Pattern…
What is Xcore?
The MyDSL example in Xcore
Derives ecore and genmodel
Put code directly in the model
Put code directly in the model
Load Xcore file
No Registration needed
Workflow configuration
Don’t forget the Xcore dependency
Don’t forget the Xcore dependency
Caused by: org.xml.sax.SAXParseExceptionpublicId: platform:/resource/org.xtext.example.mydsl.model/model/MyDsl.xcore; systemId:
platform:/resource/org.xtext.example.mydsl.model/model/MyDsl.xcore; lineNumber: 1; columnNumber: 1; Content is not allowed in
prolog.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:999)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:
510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
Invokes XcoreStandaloneSetup to register *.xcore
There is a wizard for that…
More complex setups
Ecore
model
Xcore
model
Xtext DSL
Xcore imports another ecore model
Xtext DSL imports Xcore
Ecore
model
Xcore
model
Ecore
model
Xcore
model
Xtext DSL
Caused by: java.lang.IllegalStateException: Problem parsing 'classpath:/org/xtext/example/
mydsl/MyDsl.xtext':
TransformationDiagnostic: null:9 Cannot find compatible feature name in sealed EClass
Greeting from imported package http://www.xtext.org/example/mydsl/MyDsl: The type 'Greeting'
does not have a feature 'name'. (ErrorCode: CannotCreateTypeInSealedMetamodel)
at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:247)
... 42 more
You will face that Exception
Caused by: java.lang.IllegalStateException: Problem parsing 'classpath:/org/xtext/example/
mydsl/MyDsl.xtext':
TransformationDiagnostic: null:9 Cannot find compatible feature name in sealed EClass
Greeting from imported package http://www.xtext.org/example/mydsl/MyDsl: The type 'Greeting'
does not have a feature 'name'. (ErrorCode: CannotCreateTypeInSealedMetamodel)
at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:247)
... 42 more
You will face that Exception
Ecore
model
Xcore
model
Proxy not resolvable
Index is not aware of genmodel
that the Xcore model links against
Proxy
But I added that stuff in the StandaloneSetup…?
But I added that stuff in the StandaloneSetup…?
ResourceSet
Resource
Resource
Resource
Resource
ResourceSet
Resource
Resource
Ecore
model
Xcore
model
Proxy
What’s happening?
ResourceSet
Grammar
Xcore resource
Ecore model
Genmodel
Index
ResourceDescription
ResourceDescription
ResourceDescription
ResourceDescription
Ecore
model
Xcore
model
Proxy
What’s happening?
Name
Index
ResourceDescription
ResourceDescription
ResourceDescription
ResourceDescription
Ecore
model
Xcore
model
Proxy
What’s happening?
URI
Index
ResourceDescription
ResourceDescription
ResourceDescription
ResourceDescription
Ecore
model
Xcore
model
What’s happening?
resolved
Index
ResourceDescription
ResourceDescription
ResourceDescription
ResourceDescription
Force same ResourceSet
More elegant
More complex example
Xtext DSL Xtext DSL
Languages referencing each other
More complex example
Xtext DSL Xtext DSL
Languages referencing each other
Plugin
Xtext
DSL 1
Plugin
Xtext
DSL 1
Problem
Circular dependency
Buddypolicy
Introduce a Ecore model as a protocol
Xtext DSL Xtext DSL
Ecore
model
Generated
Model
Generated
Model
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"
import "http://www.xtext.org/common/model" as common
PackageDeclaration returns common::PackageDeclaration:
'package' name=FQN
content+=Element
;
Element returns common::NamedElement:
{Element}
'element' name=ID '{'
ref=[common::Referenceable | FQN]?
'}'
;
FQN:
ID ('.' ID)*
;
Introduce a Ecore model as a protocol
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"
import "http://www.xtext.org/common/model" as common
PackageDeclaration returns common::PackageDeclaration:
'package' name=FQN
content+=Element
;
Element returns common::NamedElement:
{Element}
'element' name=ID '{'
ref=[common::Referenceable | FQN]?
'}'
;
FQN:
ID ('.' ID)*
;
Introduce a Ecore model as a protocol
More complex example
Xtext DSL Xtext DSL
Xcore
model
Xcore
model
Imported
Model
Imported
Model
More complex example
Xtext DSL Xtext DSL
Xcore
model
Xcore
model
Imported
Model
Imported
Model
Same Plugin
More complex example
Xtext DSL Xtext DSL
Xcore
model
Xcore
model
Imported
Model
Imported
Model
Different plugins
More complex example
Xtext DSL Xtext DSL
Ecore
model
Xcore
model
Xcore
model
Imported
Model
Imported
Model
Ecore
model
Xcore
model
Xcore
model
grammar org.xtext.example.firstdsl.Lang with org.eclipse.xtext.common.Terminals
import "org.xtext.example.myfirstdsl"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://www.xtext.org/common/model" as common
import "org.xtext.example.myseconddsl" as second
PackageDeclaration returns common::PackageDeclaration :
'package' name=FQN
content+=FirstElement*
;
FirstElement :
'element' name=ID '{'
ref=[second::SecondElement| FQN]?
'}'
;
FQN:
ID ('.' ID)*
;
A lot of imports…
grammar org.xtext.example.firstdsl.Lang with org.eclipse.xtext.common.Terminals
import "org.xtext.example.myfirstdsl"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://www.xtext.org/common/model" as common
import "org.xtext.example.myseconddsl" as second
PackageDeclaration returns common::PackageDeclaration :
'package' name=FQN
content+=FirstElement*
;
FirstElement :
'element' name=ID '{'
ref=[second::SecondElement| FQN]?
'}'
;
FQN:
ID ('.' ID)*
;
Have same root node…
grammar org.xtext.example.firstdsl.Lang with org.eclipse.xtext.common.Terminals
import "org.xtext.example.myfirstdsl"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://www.xtext.org/common/model" as common
import "org.xtext.example.myseconddsl" as second
PackageDeclaration returns common::PackageDeclaration :
'package' name=FQN
content+=FirstElement*
;
FirstElement :
'element' name=ID '{'
ref=[second::SecondElement| FQN]?
'}'
;
FQN:
ID ('.' ID)*
;
Use implicitly imported classifier
MWE2 configuration
Same for both languages
grammar org.xtext.example.firstdsl.Lang with org.eclipse.xtext.common.Terminals
import "org.xtext.example.myfirstdsl"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://www.xtext.org/common/model" as common
import "org.xtext.example.myseconddsl" as second
PackageDeclaration returns common::PackageDeclaration :
'package' name=FQN
content+=FirstElement*
;
FirstElement :
'element' name=ID '{'
ref=[second::SecondElement| FQN]?
'}'
;
FQN:
ID ('.' ID)*
;
But there is a small problem
grammar org.xtext.example.firstdsl.Lang with org.eclipse.xtext.common.Terminals
import "org.xtext.example.myfirstdsl"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://www.xtext.org/common/model" as common
import "org.xtext.example.myseconddsl" as second
PackageDeclaration returns common::PackageDeclaration :
'package' name=FQN
content+=FirstElement*
;
FirstElement :
'element' name=ID '{'
ref=[second::SecondElement| FQN]?
'}'
;
FQN:
ID ('.' ID)*
;
CA is showing both elements?
grammar org.xtext.example.firstdsl.Lang with org.eclipse.xtext.common.Terminals
import "org.xtext.example.myfirstdsl"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://www.xtext.org/common/model" as common
import "org.xtext.example.myseconddsl" as second
PackageDeclaration returns common::PackageDeclaration :
'package' name=FQN
content+=FirstElement*
;
FirstElement :
'element' name=ID '{'
ref=[second::SecondElement| FQN]?
'}'
;
FQN:
ID ('.' ID)*
;
CA is showing both elements?
Xtext DSL Xtext DSL
Ecore
model
Xcore
model
Xcore
model
generated
Model
generated
Model
One way to solve that…
One way to solve that…
One way to solve that…
grammar org.xtext.example.seconddsl.Lang with org.eclipse.xtext.common.Terminals
generate generatedSecondModel "http://www.xtext.org/generatedSecondModel"
import "org.xtext.example.myseconddsl"
import "http://www.xtext.org/common/model" as common
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "org.xtext.example.myfirstdsl" as first
PackageDeclaration returns common::PackageDeclaration :
'package' name=FQN
content+=SecondElement*
;
SecondElement returns SecondElement:
{CustomSecondElement}
'element' name=ID '{'
ref=[first::FirstElement | FQN]?
'}'
;
FQN:
ID ('.' ID)*
;
One way to solve that…
grammar org.xtext.example.seconddsl.Lang with org.eclipse.xtext.common.Terminals
generate generatedSecondModel "http://www.xtext.org/generatedSecondModel"
import "org.xtext.example.myseconddsl"
import "http://www.xtext.org/common/model" as common
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "org.xtext.example.myfirstdsl" as first
PackageDeclaration returns common::PackageDeclaration :
'package' name=FQN
content+=SecondElement*
;
SecondElement returns SecondElement:
{CustomSecondElement}
'element' name=ID '{'
ref=[first::FirstElement | FQN]?
'}'
;
FQN:
ID ('.' ID)*
;
But when I run it….
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: Generator)
java.lang.RuntimeException: Could not find a GenModel for EPackage 'http://www.xtext.org/
generatedSecondModel' from http://www.xtext.org/generatedSecondModel
If the missing GenModel has been generated via EMFGeneratorFragment or EcoreGeneratorFragment make
sure to run it first in the workflow.
If you have a *.genmodel-file, make sure to register it via
StandaloneSetup.registerGenModelFile(String)
at org.eclipse.xtext.generator.GenModelAccess.getGenModelResource(GenModelAccess.java:137)
at org.eclipse.xtext.generator.GenModelAccess.getGenPackage(GenModelAccess.java:85)
But when I run it….
// generates Java API for the generated EPackages
fragment = ecore.EMFGeneratorFragment auto-inject {}
Don’t forget the EMFGeneratorFragment
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: Generator)
java.lang.RuntimeException: Could not find a GenModel for EPackage 'http://www.xtext.org/
generatedSecondModel' from http://www.xtext.org/generatedSecondModel
If the missing GenModel has been generated via EMFGeneratorFragment or EcoreGeneratorFragment make
sure to run it first in the workflow.
If you have a *.genmodel-file, make sure to register it via
StandaloneSetup.registerGenModelFile(String)
at org.eclipse.xtext.generator.GenModelAccess.getGenModelResource(GenModelAccess.java:137)
at org.eclipse.xtext.generator.GenModelAccess.getGenPackage(GenModelAccess.java:85)
There was nothing about Xbase so far…
Using Xbase
Wizard does crazy things…// automatically generated by Xtext
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
import "http://www.xtext.org/example/xbase"
import "http://www.eclipse.org/xtext/common/JavaVMTypes" as types
import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
MyClass returns MyClass:
{MyClass}
'MyClass'
'{'
('ref' ref=JvmTypeReference)?
('body' body=XBlockExpression)?
'}';
JvmTypeReference returns types::JvmTypeReference:
JvmParameterizedTypeReference_Impl | JvmGenericArrayTypeReference | JvmWildcardTypeReference | JvmAnyTypeReference | JvmMultiTypeReference | JvmDelegateTypeReference | JvmSynonymTypeReference | JvmUnknownTypeReference | JvmInnerTypeReference;
XExpression returns xbase::XExpression:
XIfExpression | XSwitchExpression | XBlockExpression | XVariableDeclaration | XMemberFeatureCall | XFeatureCall | XConstructorCall | XBooleanLiteral | XNullLiteral | XNumberLiteral | XStringLiteral | XListLiteral | XSetLiteral | XClosure | XCastedExpression | XBinaryOperation | XUnaryOperation | XPostfixOperation | XForLoopExpression | XBasicForLoopExpression | XDoWhileExpression | XWhileExpression | XTypeLiteral | XInstanceOfExpression | XThrowExpression | XTryCatchFinallyExpression | XAssignment | XReturnExpression | XSynchronizedExpression;
JvmType returns types::JvmType:
JvmVoid | JvmPrimitiveType | JvmArrayType | JvmTypeParameter | JvmAnnotationType | JvmEnumerationType | JvmGenericType;
JvmTypeConstraint returns types::JvmTypeConstraint:
JvmUpperBound | JvmLowerBound;
JvmParameterizedTypeReference returns types::JvmParameterizedTypeReference:
JvmParameterizedTypeReference_Impl | JvmInnerTypeReference;
JvmMember returns types::JvmMember:
JvmAnnotationType | JvmEnumerationType | JvmEnumerationLiteral | JvmGenericType | JvmField_Impl | JvmConstructor | JvmOperation;
JvmAnnotationValue returns types::JvmAnnotationValue:
JvmIntAnnotationValue | JvmBooleanAnnotationValue | JvmByteAnnotationValue | JvmShortAnnotationValue | JvmLongAnnotationValue | JvmDoubleAnnotationValue | JvmFloatAnnotationValue | JvmCharAnnotationValue | JvmStringAnnotationValue | JvmTypeAnnotationValue | JvmAnnotationAnnotationValue | JvmEnumAnnotationValue | JvmCustomAnnotationValue;
JvmIdentifiableElement returns types::JvmIdentifiableElement:
JvmVoid | JvmPrimitiveType | JvmArrayType | JvmTypeParameter | JvmAnnotationType | JvmEnumerationType | JvmEnumerationLiteral | JvmGenericType | JvmField_Impl | JvmConstructor | JvmOperation | JvmFormalParameter;
XBlockExpression returns xbase::XBlockExpression:
{xbase::XBlockExpression}
'XBlockExpression'
'{'
('expressions' '{' expressions+=XExpression ( "," expressions+=XExpression)* '}' )?
'}';
JvmParameterizedTypeReference_Impl returns types::JvmParameterizedTypeReference:
{types::JvmParameterizedTypeReference}
'JvmParameterizedTypeReference'
'{'
('type' type=[types::JvmType|EString])?
('arguments' '{' arguments+=JvmTypeReference ( "," arguments+=JvmTypeReference)* '}' )?
'}';
JvmGenericArrayTypeReference returns types::JvmGenericArrayTypeReference:
{types::JvmGenericArrayTypeReference}
'JvmGenericArrayTypeReference'
'{'
('componentType' componentType=JvmTypeReference)?
'}';
JvmWildcardTypeReference returns types::JvmWildcardTypeReference:
{types::JvmWildcardTypeReference}
'JvmWildcardTypeReference'
'{'
('constraints' '{' constraints+=JvmTypeConstraint ( "," constraints+=JvmTypeConstraint)* '}' )?
'}';
JvmAnyTypeReference returns types::JvmAnyTypeReference:
{types::JvmAnyTypeReference}
'JvmAnyTypeReference'
'{'
('type' type=[types::JvmType|EString])?
'}';
JvmMultiTypeReference returns types::JvmMultiTypeReference:
{types::JvmMultiTypeReference}
'JvmMultiTypeReference'
'{'
('type' type=[types::JvmType|EString])?
('references' '{' references+=JvmTypeReference ( "," references+=JvmTypeReference)* '}' )?
'}';
JvmDelegateTypeReference returns types::JvmDelegateTypeReference:
{types::JvmDelegateTypeReference}
'JvmDelegateTypeReference'
'{'
('delegate' delegate=[types::JvmTypeReference|EString])?
'}';
JvmSynonymTypeReference returns types::JvmSynonymTypeReference:
{types::JvmSynonymTypeReference}
'JvmSynonymTypeReference'
'{'
('type' type=[types::JvmType|EString])?
('references' '{' references+=JvmTypeReference ( "," references+=JvmTypeReference)* '}' )?
'}';
JvmUnknownTypeReference returns types::JvmUnknownTypeReference:
{types::JvmUnknownTypeReference}
'JvmUnknownTypeReference'
;
JvmInnerTypeReference returns types::JvmInnerTypeReference:
{types::JvmInnerTypeReference}
'JvmInnerTypeReference'
'{'
('type' type=[types::JvmType|EString])?
('arguments' '{' arguments+=JvmTypeReference ( "," arguments+=JvmTypeReference)* '}' )?
('outer' outer=JvmParameterizedTypeReference)?
'}';
JvmVoid returns types::JvmVoid:
{types::JvmVoid}
'JvmVoid'
;
JvmPrimitiveType returns types::JvmPrimitiveType:
{types::JvmPrimitiveType}
'JvmPrimitiveType'
'{'
('simpleName' simpleName=EString)?
('arrayType' arrayType=JvmArrayType)?
'}';
JvmArrayType returns types::JvmArrayType:
{types::JvmArrayType}
'JvmArrayType'
'{'
('arrayType' arrayType=JvmArrayType)?
'}';
JvmTypeParameter returns types::JvmTypeParameter:
{types::JvmTypeParameter}
'JvmTypeParameter'
name=EString
'{'
('arrayType' arrayType=JvmArrayType)?
('constraints' '{' constraints+=JvmTypeConstraint ( "," constraints+=JvmTypeConstraint)* '}' )?
'}';
JvmAnnotationType returns types::JvmAnnotationType:
{types::JvmAnnotationType}
(deprecated?='deprecated')?
(abstract?='abstract')?
(static?='static')?
(final?='final')?
'JvmAnnotationType'
'{'
('visibility' visibility=JvmVisibility)?
('simpleName' simpleName=EString)?
('packageName' packageName=EString)?
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('arrayType' arrayType=JvmArrayType)?
('superTypes' '{' superTypes+=JvmTypeReference ( "," superTypes+=JvmTypeReference)* '}' )?
('members' '{' members+=JvmMember ( "," members+=JvmMember)* '}' )?
'}';
JvmEnumerationType returns types::JvmEnumerationType:
{types::JvmEnumerationType}
(deprecated?='deprecated')?
(abstract?='abstract')?
(static?='static')?
(final?='final')?
'JvmEnumerationType'
'{'
('visibility' visibility=JvmVisibility)?
('simpleName' simpleName=EString)?
('packageName' packageName=EString)?
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('arrayType' arrayType=JvmArrayType)?
('superTypes' '{' superTypes+=JvmTypeReference ( "," superTypes+=JvmTypeReference)* '}' )?
('members' '{' members+=JvmMember ( "," members+=JvmMember)* '}' )?
'}';
JvmGenericType returns types::JvmGenericType:
{types::JvmGenericType}
(deprecated?='deprecated')?
(abstract?='abstract')?
(static?='static')?
(final?='final')?
(interface?='interface')?
(strictFloatingPoint?='strictFloatingPoint')?
(anonymous?='anonymous')?
'JvmGenericType'
'{'
('visibility' visibility=JvmVisibility)?
('simpleName' simpleName=EString)?
('packageName' packageName=EString)?
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('arrayType' arrayType=JvmArrayType)?
('superTypes' '{' superTypes+=JvmTypeReference ( "," superTypes+=JvmTypeReference)* '}' )?
('members' '{' members+=JvmMember ( "," members+=JvmMember)* '}' )?
('typeParameters' '{' typeParameters+=JvmTypeParameter ( "," typeParameters+=JvmTypeParameter)* '}' )?
'}';
EString returns ecore::EString:
STRING | ID;
JvmAnnotationReference returns types::JvmAnnotationReference:
{types::JvmAnnotationReference}
'JvmAnnotationReference'
'{'
('annotation' annotation=[types::JvmAnnotationType|EString])?
('explicitValues' '{' explicitValues+=JvmAnnotationValue ( "," explicitValues+=JvmAnnotationValue)* '}' )?
'}';
enum JvmVisibility returns types::JvmVisibility:
DEFAULT = 'DEFAULT' | PRIVATE = 'PRIVATE' | PROTECTED = 'PROTECTED' | PUBLIC = 'PUBLIC';
EBoolean returns ecore::EBoolean:
'true' | 'false';
JvmOperation returns types::JvmOperation:
{types::JvmOperation}
(deprecated?='deprecated')?
(varArgs?='varArgs')?
(static?='static')?
(final?='final')?
(abstract?='abstract')?
(synchronized?='synchronized')?
(default?='default')?
(native?='native')?
(strictFloatingPoint?='strictFloatingPoint')?
'JvmOperation'
'{'
('visibility' visibility=JvmVisibility)?
('simpleName' simpleName=EString)?
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )?
('typeParameters' '{' typeParameters+=JvmTypeParameter ( "," typeParameters+=JvmTypeParameter)* '}' )?
('parameters' '{' parameters+=JvmFormalParameter ( "," parameters+=JvmFormalParameter)* '}' )?
('exceptions' '{' exceptions+=JvmTypeReference ( "," exceptions+=JvmTypeReference)* '}' )?
('returnType' returnType=JvmTypeReference)?
('defaultValue' defaultValue=JvmAnnotationValue)?
'}';
JvmIntAnnotationValue returns types::JvmIntAnnotationValue:
{types::JvmIntAnnotationValue}
'JvmIntAnnotationValue'
'{'
('values' '{' values+=EInt ( "," values+=EInt)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmBooleanAnnotationValue returns types::JvmBooleanAnnotationValue:
{types::JvmBooleanAnnotationValue}
'JvmBooleanAnnotationValue'
'{'
('values' '{' values+=EBoolean ( "," values+=EBoolean)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmByteAnnotationValue returns types::JvmByteAnnotationValue:
{types::JvmByteAnnotationValue}
'JvmByteAnnotationValue'
'{'
('values' '{' values+=EByte ( "," values+=EByte)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmShortAnnotationValue returns types::JvmShortAnnotationValue:
{types::JvmShortAnnotationValue}
'JvmShortAnnotationValue'
'{'
('values' '{' values+=EShort ( "," values+=EShort)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmLongAnnotationValue returns types::JvmLongAnnotationValue:
{types::JvmLongAnnotationValue}
'JvmLongAnnotationValue'
'{'
('values' '{' values+=ELong ( "," values+=ELong)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmDoubleAnnotationValue returns types::JvmDoubleAnnotationValue:
{types::JvmDoubleAnnotationValue}
'JvmDoubleAnnotationValue'
'{'
('values' '{' values+=EDouble ( "," values+=EDouble)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmFloatAnnotationValue returns types::JvmFloatAnnotationValue:
{types::JvmFloatAnnotationValue}
'JvmFloatAnnotationValue'
'{'
('values' '{' values+=EFloat ( "," values+=EFloat)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmCharAnnotationValue returns types::JvmCharAnnotationValue:
{types::JvmCharAnnotationValue}
'JvmCharAnnotationValue'
'{'
('values' '{' values+=EChar ( "," values+=EChar)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmStringAnnotationValue returns types::JvmStringAnnotationValue:
{types::JvmStringAnnotationValue}
'JvmStringAnnotationValue'
'{'
('values' '{' values+=EString ( "," values+=EString)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmTypeAnnotationValue returns types::JvmTypeAnnotationValue:
{types::JvmTypeAnnotationValue}
'JvmTypeAnnotationValue'
'{'
('operation' operation=[types::JvmOperation|EString])?
('values' '{' values+=JvmTypeReference ( "," values+=JvmTypeReference)* '}' )?
'}';
JvmAnnotationAnnotationValue returns types::JvmAnnotationAnnotationValue:
{types::JvmAnnotationAnnotationValue}
'JvmAnnotationAnnotationValue'
'{'
('operation' operation=[types::JvmOperation|EString])?
('values' '{' values+=JvmAnnotationReference ( "," values+=JvmAnnotationReference)* '}' )?
'}';
JvmEnumAnnotationValue returns types::JvmEnumAnnotationValue:
{types::JvmEnumAnnotationValue}
'JvmEnumAnnotationValue'
'{'
('operation' operation=[types::JvmOperation|EString])?
('values' '(' values+=[types::JvmEnumerationLiteral|EString] ( "," values+=[types::JvmEnumerationLiteral|EString])* ')' )?
'}';
JvmCustomAnnotationValue returns types::JvmCustomAnnotationValue:
{types::JvmCustomAnnotationValue}
'JvmCustomAnnotationValue'
'{'
('operation' operation=[types::JvmOperation|EString])?
('values' '(' values+=[ecore::EObject|EString] ( "," values+=[ecore::EObject|EString])* ')' )?
'}';
JvmFormalParameter returns types::JvmFormalParameter:
{types::JvmFormalParameter}
'JvmFormalParameter'
name=EString
'{'
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('parameterType' parameterType=JvmTypeReference)?
'}';
EInt returns ecore::EInt:
'-'? INT;
EByte returns ecore::EByte:
'-'? INT;
EShort returns ecore::EShort:
'-'? INT;
ELong returns ecore::ELong:
'-'? INT;
EDouble returns ecore::EDouble:
'-'? INT? '.' INT (('E'|'e') '-'? INT)?;
EFloat returns ecore::EFloat:
'-'? INT? '.' INT (('E'|'e') '-'? INT)?;
EChar returns ecore::EChar:
'-'? INT;
JvmEnumerationLiteral returns types::JvmEnumerationLiteral:
{types::JvmEnumerationLiteral}
(deprecated?='deprecated')?
(static?='static')?
(final?='final')?
(volatile?='volatile')?
(transient?='transient')?
(constant?='constant')?
'JvmEnumerationLiteral'
'{'
('visibility' visibility=JvmVisibility)?
('simpleName' simpleName=EString)?
('constantValue' constantValue=EJavaObject)?
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )?
('type' type=JvmTypeReference)?
'}';
EJavaObject returns ecore::EJavaObject:
'EJavaObject' /* TODO: implement this rule and an appropriate IValueConverter */;
EObject returns ecore::EObject:
{ecore::EObject}
'EObject'
;
JvmField_Impl returns types::JvmField:
{types::JvmField}
(deprecated?='deprecated')?
(static?='static')?
(final?='final')?
(volatile?='volatile')?
(transient?='transient')?
(constant?='constant')?
'JvmField'
'{'
('visibility' visibility=JvmVisibility)?
('simpleName' simpleName=EString)?
('constantValue' constantValue=EJavaObject)?
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )?
('type' type=JvmTypeReference)?
'}';
JvmConstructor returns types::JvmConstructor:
{types::JvmConstructor}
(deprecated?='deprecated')?
(varArgs?='varArgs')?
'JvmConstructor'
'{'
('visibility' visibility=JvmVisibility)?
('simpleName' simpleName=EString)?
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )?
('typeParameters' '{' typeParameters+=JvmTypeParameter ( "," typeParameters+=JvmTypeParameter)* '}' )?
('parameters' '{' parameters+=JvmFormalParameter ( "," parameters+=JvmFormalParameter)* '}' )?
('exceptions' '{' exceptions+=JvmTypeReference ( "," exceptions+=JvmTypeReference)* '}' )?
'}';
JvmUpperBound returns types::JvmUpperBound:
{types::JvmUpperBound}
'JvmUpperBound'
'{'
('typeReference' typeReference=JvmTypeReference)?
'}';
JvmLowerBound returns types::JvmLowerBound:
{types::JvmLowerBound}
'JvmLowerBound'
'{'
('typeReference' typeReference=JvmTypeReference)?
'}';
XIfExpression returns xbase::XIfExpression:
{xbase::XIfExpression}
'XIfExpression'
'{'
('if' if=XExpression)?
('then' then=XExpression)?
('else' else=XExpression)?
'}';
XSwitchExpression returns xbase::XSwitchExpression:
{xbase::XSwitchExpression}
'XSwitchExpression'
'{'
('switch' switch=XExpression)?
('cases' '{' cases+=XCasePart ( "," cases+=XCasePart)* '}' )?
('default' default=XExpression)?
('declaredParam' declaredParam=JvmFormalParameter)?
'}';
XVariableDeclaration returns xbase::XVariableDeclaration:
{xbase::XVariableDeclaration}
(writeable?='writeable')?
'XVariableDeclaration'
name=EString
'{'
('type' type=JvmTypeReference)?
('right' right=XExpression)?
'}';
XMemberFeatureCall returns xbase::XMemberFeatureCall:
{xbase::XMemberFeatureCall}
(explicitOperationCall?='explicitOperationCall')?
(explicitStatic?='explicitStatic')?
(nullSafe?='nullSafe')?
'XMemberFeatureCall'
'{'
('feature' feature=[types::JvmIdentifiableElement|EString])?
('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )?
('memberCallTarget' memberCallTarget=XExpression)?
('memberCallArguments' '{' memberCallArguments+=XExpression ( "," memberCallArguments+=XExpression)* '}' )?
'}';
XFeatureCall returns xbase::XFeatureCall:
{xbase::XFeatureCall}
(explicitOperationCall?='explicitOperationCall')?
'XFeatureCall'
'{'
('feature' feature=[types::JvmIdentifiableElement|EString])?
('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )?
('featureCallArguments' '{' featureCallArguments+=XExpression ( "," featureCallArguments+=XExpression)* '}' )?
'}';
XConstructorCall returns xbase::XConstructorCall:
{xbase::XConstructorCall}
(explicitConstructorCall?='explicitConstructorCall')?
'XConstructorCall'
'{'
('constructor' constructor=[types::JvmConstructor|EString])?
('arguments' '{' arguments+=XExpression ( "," arguments+=XExpression)* '}' )?
('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )?
'}';
XBooleanLiteral returns xbase::XBooleanLiteral:
{xbase::XBooleanLiteral}
(isTrue?='isTrue')?
'XBooleanLiteral'
;
XNullLiteral returns xbase::XNullLiteral:
{xbase::XNullLiteral}
'XNullLiteral'
;
XNumberLiteral returns xbase::XNumberLiteral:
{xbase::XNumberLiteral}
'XNumberLiteral'
'{'
('value' value=EString)?
'}';
XStringLiteral returns xbase::XStringLiteral:
{xbase::XStringLiteral}
'XStringLiteral'
'{'
('value' value=EString)?
'}';
XListLiteral returns xbase::XListLiteral:
{xbase::XListLiteral}
'XListLiteral'
'{'
('elements' '{' elements+=XExpression ( "," elements+=XExpression)* '}' )?
'}';
XSetLiteral returns xbase::XSetLiteral:
{xbase::XSetLiteral}
'XSetLiteral'
'{'
('elements' '{' elements+=XExpression ( "," elements+=XExpression)* '}' )?
'}';
XClosure returns xbase::XClosure:
{xbase::XClosure}
(explicitSyntax?='explicitSyntax')?
'XClosure'
'{'
('declaredFormalParameters' '{' declaredFormalParameters+=JvmFormalParameter ( "," declaredFormalParameters+=JvmFormalParameter)* '}' )?
('expression' expression=XExpression)?
'}';
XCastedExpression returns xbase::XCastedExpression:
{xbase::XCastedExpression}
'XCastedExpression'
'{'
('type' type=JvmTypeReference)?
('target' target=XExpression)?
'}';
XBinaryOperation returns xbase::XBinaryOperation:
{xbase::XBinaryOperation}
(reassignFirstArgument?='reassignFirstArgument')?
'XBinaryOperation'
'{'
('feature' feature=[types::JvmIdentifiableElement|EString])?
('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )?
('leftOperand' leftOperand=XExpression)?
('rightOperand' rightOperand=XExpression)?
'}';
XUnaryOperation returns xbase::XUnaryOperation:
{xbase::XUnaryOperation}
'XUnaryOperation'
'{'
('feature' feature=[types::JvmIdentifiableElement|EString])?
('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )?
('operand' operand=XExpression)?
'}';
XPostfixOperation returns xbase::XPostfixOperation:
{xbase::XPostfixOperation}
'XPostfixOperation'
'{'
('feature' feature=[types::JvmIdentifiableElement|EString])?
('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )?
('operand' operand=XExpression)?
'}';
XForLoopExpression returns xbase::XForLoopExpression:
{xbase::XForLoopExpression}
'XForLoopExpression'
'{'
('forExpression' forExpression=XExpression)?
('eachExpression' eachExpression=XExpression)?
('declaredParam' declaredParam=JvmFormalParameter)?
'}';
XBasicForLoopExpression returns xbase::XBasicForLoopExpression:
{xbase::XBasicForLoopExpression}
'XBasicForLoopExpression'
'{'
('expression' expression=XExpression)?
('eachExpression' eachExpression=XExpression)?
('initExpressions' '{' initExpressions+=XExpression ( "," initExpressions+=XExpression)* '}' )?
('updateExpressions' '{' updateExpressions+=XExpression ( "," updateExpressions+=XExpression)* '}' )?
'}';
XDoWhileExpression returns xbase::XDoWhileExpression:
{xbase::XDoWhileExpression}
'XDoWhileExpression'
'{'
('predicate' predicate=XExpression)?
('body' body=XExpression)?
'}';
XWhileExpression returns xbase::XWhileExpression:
{xbase::XWhileExpression}
'XWhileExpression'
'{'
('predicate' predicate=XExpression)?
('body' body=XExpression)?
'}';
XTypeLiteral returns xbase::XTypeLiteral:
'XTypeLiteral'
'{'
('arrayDimensions' '{' arrayDimensions+=EString ( "," arrayDimensions+=EString)* '}' )?
'type' type=[types::JvmType|EString]
'}';
XInstanceOfExpression returns xbase::XInstanceOfExpression:
'XInstanceOfExpression'
'{'
'type' type=JvmTypeReference
'expression' expression=XExpression
'}';
XThrowExpression returns xbase::XThrowExpression:
{xbase::XThrowExpression}
'XThrowExpression'
'{'
('expression' expression=XExpression)?
'}';
XTryCatchFinallyExpression returns xbase::XTryCatchFinallyExpression:
{xbase::XTryCatchFinallyExpression}
'XTryCatchFinallyExpression'
'{'
('expression' expression=XExpression)?
('finallyExpression' finallyExpression=XExpression)?
('catchClauses' '{' catchClauses+=XCatchClause ( "," catchClauses+=XCatchClause)* '}' )?
'}';
XAssignment returns xbase::XAssignment:
{xbase::XAssignment}
(explicitStatic?='explicitStatic')?
'XAssignment'
'{'
('feature' feature=[types::JvmIdentifiableElement|EString])?
('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )?
('assignable' assignable=XExpression)?
('value' value=XExpression)?
'}';
Rebuilds Xbase grammar without reusing it…
Wizard does crazy things…// automatically generated by Xtext
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
import "http://www.xtext.org/example/xbase"
import "http://www.eclipse.org/xtext/common/JavaVMTypes" as types
import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
MyClass returns MyClass:
{MyClass}
'MyClass'
'{'
('ref' ref=JvmTypeReference)?
('body' body=XBlockExpression)?
'}';
JvmTypeReference returns types::JvmTypeReference:
JvmParameterizedTypeReference_Impl | JvmGenericArrayTypeReference | JvmWildcardTypeReference | JvmAnyTypeReference | JvmMultiTypeReference | JvmDelegateTypeReference | JvmSynonymTypeReference | JvmUnknownTypeReference | JvmInnerTypeReference;
XExpression returns xbase::XExpression:
XIfExpression | XSwitchExpression | XBlockExpression | XVariableDeclaration | XMemberFeatureCall | XFeatureCall | XConstructorCall | XBooleanLiteral | XNullLiteral | XNumberLiteral | XStringLiteral | XListLiteral | XSetLiteral | XClosure | XCastedExpression | XBinaryOperation | XUnaryOperation | XPostfixOperation | XForLoopExpression | XBasicForLoopExpression | XDoWhileExpression | XWhileExpression | XTypeLiteral | XInstanceOfExpression | XThrowExpression | XTryCatchFinallyExpression | XAssignment | XReturnExpression | XSynchronizedExpression;
JvmType returns types::JvmType:
JvmVoid | JvmPrimitiveType | JvmArrayType | JvmTypeParameter | JvmAnnotationType | JvmEnumerationType | JvmGenericType;
JvmTypeConstraint returns types::JvmTypeConstraint:
JvmUpperBound | JvmLowerBound;
JvmParameterizedTypeReference returns types::JvmParameterizedTypeReference:
JvmParameterizedTypeReference_Impl | JvmInnerTypeReference;
JvmMember returns types::JvmMember:
JvmAnnotationType | JvmEnumerationType | JvmEnumerationLiteral | JvmGenericType | JvmField_Impl | JvmConstructor | JvmOperation;
JvmAnnotationValue returns types::JvmAnnotationValue:
JvmIntAnnotationValue | JvmBooleanAnnotationValue | JvmByteAnnotationValue | JvmShortAnnotationValue | JvmLongAnnotationValue | JvmDoubleAnnotationValue | JvmFloatAnnotationValue | JvmCharAnnotationValue | JvmStringAnnotationValue | JvmTypeAnnotationValue | JvmAnnotationAnnotationValue | JvmEnumAnnotationValue | JvmCustomAnnotationValue;
JvmIdentifiableElement returns types::JvmIdentifiableElement:
JvmVoid | JvmPrimitiveType | JvmArrayType | JvmTypeParameter | JvmAnnotationType | JvmEnumerationType | JvmEnumerationLiteral | JvmGenericType | JvmField_Impl | JvmConstructor | JvmOperation | JvmFormalParameter;
XBlockExpression returns xbase::XBlockExpression:
{xbase::XBlockExpression}
'XBlockExpression'
'{'
('expressions' '{' expressions+=XExpression ( "," expressions+=XExpression)* '}' )?
'}';
JvmParameterizedTypeReference_Impl returns types::JvmParameterizedTypeReference:
{types::JvmParameterizedTypeReference}
'JvmParameterizedTypeReference'
'{'
('type' type=[types::JvmType|EString])?
('arguments' '{' arguments+=JvmTypeReference ( "," arguments+=JvmTypeReference)* '}' )?
'}';
JvmGenericArrayTypeReference returns types::JvmGenericArrayTypeReference:
{types::JvmGenericArrayTypeReference}
'JvmGenericArrayTypeReference'
'{'
('componentType' componentType=JvmTypeReference)?
'}';
JvmWildcardTypeReference returns types::JvmWildcardTypeReference:
{types::JvmWildcardTypeReference}
'JvmWildcardTypeReference'
'{'
('constraints' '{' constraints+=JvmTypeConstraint ( "," constraints+=JvmTypeConstraint)* '}' )?
'}';
JvmAnyTypeReference returns types::JvmAnyTypeReference:
{types::JvmAnyTypeReference}
'JvmAnyTypeReference'
'{'
('type' type=[types::JvmType|EString])?
'}';
JvmMultiTypeReference returns types::JvmMultiTypeReference:
{types::JvmMultiTypeReference}
'JvmMultiTypeReference'
'{'
('type' type=[types::JvmType|EString])?
('references' '{' references+=JvmTypeReference ( "," references+=JvmTypeReference)* '}' )?
'}';
JvmDelegateTypeReference returns types::JvmDelegateTypeReference:
{types::JvmDelegateTypeReference}
'JvmDelegateTypeReference'
'{'
('delegate' delegate=[types::JvmTypeReference|EString])?
'}';
JvmSynonymTypeReference returns types::JvmSynonymTypeReference:
{types::JvmSynonymTypeReference}
'JvmSynonymTypeReference'
'{'
('type' type=[types::JvmType|EString])?
('references' '{' references+=JvmTypeReference ( "," references+=JvmTypeReference)* '}' )?
'}';
JvmUnknownTypeReference returns types::JvmUnknownTypeReference:
{types::JvmUnknownTypeReference}
'JvmUnknownTypeReference'
;
JvmInnerTypeReference returns types::JvmInnerTypeReference:
{types::JvmInnerTypeReference}
'JvmInnerTypeReference'
'{'
('type' type=[types::JvmType|EString])?
('arguments' '{' arguments+=JvmTypeReference ( "," arguments+=JvmTypeReference)* '}' )?
('outer' outer=JvmParameterizedTypeReference)?
'}';
JvmVoid returns types::JvmVoid:
{types::JvmVoid}
'JvmVoid'
;
JvmPrimitiveType returns types::JvmPrimitiveType:
{types::JvmPrimitiveType}
'JvmPrimitiveType'
'{'
('simpleName' simpleName=EString)?
('arrayType' arrayType=JvmArrayType)?
'}';
JvmArrayType returns types::JvmArrayType:
{types::JvmArrayType}
'JvmArrayType'
'{'
('arrayType' arrayType=JvmArrayType)?
'}';
JvmTypeParameter returns types::JvmTypeParameter:
{types::JvmTypeParameter}
'JvmTypeParameter'
name=EString
'{'
('arrayType' arrayType=JvmArrayType)?
('constraints' '{' constraints+=JvmTypeConstraint ( "," constraints+=JvmTypeConstraint)* '}' )?
'}';
JvmAnnotationType returns types::JvmAnnotationType:
{types::JvmAnnotationType}
(deprecated?='deprecated')?
(abstract?='abstract')?
(static?='static')?
(final?='final')?
'JvmAnnotationType'
'{'
('visibility' visibility=JvmVisibility)?
('simpleName' simpleName=EString)?
('packageName' packageName=EString)?
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('arrayType' arrayType=JvmArrayType)?
('superTypes' '{' superTypes+=JvmTypeReference ( "," superTypes+=JvmTypeReference)* '}' )?
('members' '{' members+=JvmMember ( "," members+=JvmMember)* '}' )?
'}';
JvmEnumerationType returns types::JvmEnumerationType:
{types::JvmEnumerationType}
(deprecated?='deprecated')?
(abstract?='abstract')?
(static?='static')?
(final?='final')?
'JvmEnumerationType'
'{'
('visibility' visibility=JvmVisibility)?
('simpleName' simpleName=EString)?
('packageName' packageName=EString)?
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('arrayType' arrayType=JvmArrayType)?
('superTypes' '{' superTypes+=JvmTypeReference ( "," superTypes+=JvmTypeReference)* '}' )?
('members' '{' members+=JvmMember ( "," members+=JvmMember)* '}' )?
'}';
JvmGenericType returns types::JvmGenericType:
{types::JvmGenericType}
(deprecated?='deprecated')?
(abstract?='abstract')?
(static?='static')?
(final?='final')?
(interface?='interface')?
(strictFloatingPoint?='strictFloatingPoint')?
(anonymous?='anonymous')?
'JvmGenericType'
'{'
('visibility' visibility=JvmVisibility)?
('simpleName' simpleName=EString)?
('packageName' packageName=EString)?
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('arrayType' arrayType=JvmArrayType)?
('superTypes' '{' superTypes+=JvmTypeReference ( "," superTypes+=JvmTypeReference)* '}' )?
('members' '{' members+=JvmMember ( "," members+=JvmMember)* '}' )?
('typeParameters' '{' typeParameters+=JvmTypeParameter ( "," typeParameters+=JvmTypeParameter)* '}' )?
'}';
EString returns ecore::EString:
STRING | ID;
JvmAnnotationReference returns types::JvmAnnotationReference:
{types::JvmAnnotationReference}
'JvmAnnotationReference'
'{'
('annotation' annotation=[types::JvmAnnotationType|EString])?
('explicitValues' '{' explicitValues+=JvmAnnotationValue ( "," explicitValues+=JvmAnnotationValue)* '}' )?
'}';
enum JvmVisibility returns types::JvmVisibility:
DEFAULT = 'DEFAULT' | PRIVATE = 'PRIVATE' | PROTECTED = 'PROTECTED' | PUBLIC = 'PUBLIC';
EBoolean returns ecore::EBoolean:
'true' | 'false';
JvmOperation returns types::JvmOperation:
{types::JvmOperation}
(deprecated?='deprecated')?
(varArgs?='varArgs')?
(static?='static')?
(final?='final')?
(abstract?='abstract')?
(synchronized?='synchronized')?
(default?='default')?
(native?='native')?
(strictFloatingPoint?='strictFloatingPoint')?
'JvmOperation'
'{'
('visibility' visibility=JvmVisibility)?
('simpleName' simpleName=EString)?
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )?
('typeParameters' '{' typeParameters+=JvmTypeParameter ( "," typeParameters+=JvmTypeParameter)* '}' )?
('parameters' '{' parameters+=JvmFormalParameter ( "," parameters+=JvmFormalParameter)* '}' )?
('exceptions' '{' exceptions+=JvmTypeReference ( "," exceptions+=JvmTypeReference)* '}' )?
('returnType' returnType=JvmTypeReference)?
('defaultValue' defaultValue=JvmAnnotationValue)?
'}';
JvmIntAnnotationValue returns types::JvmIntAnnotationValue:
{types::JvmIntAnnotationValue}
'JvmIntAnnotationValue'
'{'
('values' '{' values+=EInt ( "," values+=EInt)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmBooleanAnnotationValue returns types::JvmBooleanAnnotationValue:
{types::JvmBooleanAnnotationValue}
'JvmBooleanAnnotationValue'
'{'
('values' '{' values+=EBoolean ( "," values+=EBoolean)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmByteAnnotationValue returns types::JvmByteAnnotationValue:
{types::JvmByteAnnotationValue}
'JvmByteAnnotationValue'
'{'
('values' '{' values+=EByte ( "," values+=EByte)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmShortAnnotationValue returns types::JvmShortAnnotationValue:
{types::JvmShortAnnotationValue}
'JvmShortAnnotationValue'
'{'
('values' '{' values+=EShort ( "," values+=EShort)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmLongAnnotationValue returns types::JvmLongAnnotationValue:
{types::JvmLongAnnotationValue}
'JvmLongAnnotationValue'
'{'
('values' '{' values+=ELong ( "," values+=ELong)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmDoubleAnnotationValue returns types::JvmDoubleAnnotationValue:
{types::JvmDoubleAnnotationValue}
'JvmDoubleAnnotationValue'
'{'
('values' '{' values+=EDouble ( "," values+=EDouble)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmFloatAnnotationValue returns types::JvmFloatAnnotationValue:
{types::JvmFloatAnnotationValue}
'JvmFloatAnnotationValue'
'{'
('values' '{' values+=EFloat ( "," values+=EFloat)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmCharAnnotationValue returns types::JvmCharAnnotationValue:
{types::JvmCharAnnotationValue}
'JvmCharAnnotationValue'
'{'
('values' '{' values+=EChar ( "," values+=EChar)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmStringAnnotationValue returns types::JvmStringAnnotationValue:
{types::JvmStringAnnotationValue}
'JvmStringAnnotationValue'
'{'
('values' '{' values+=EString ( "," values+=EString)* '}' )?
('operation' operation=[types::JvmOperation|EString])?
'}';
JvmTypeAnnotationValue returns types::JvmTypeAnnotationValue:
{types::JvmTypeAnnotationValue}
'JvmTypeAnnotationValue'
'{'
('operation' operation=[types::JvmOperation|EString])?
('values' '{' values+=JvmTypeReference ( "," values+=JvmTypeReference)* '}' )?
'}';
JvmAnnotationAnnotationValue returns types::JvmAnnotationAnnotationValue:
{types::JvmAnnotationAnnotationValue}
'JvmAnnotationAnnotationValue'
'{'
('operation' operation=[types::JvmOperation|EString])?
('values' '{' values+=JvmAnnotationReference ( "," values+=JvmAnnotationReference)* '}' )?
'}';
JvmEnumAnnotationValue returns types::JvmEnumAnnotationValue:
{types::JvmEnumAnnotationValue}
'JvmEnumAnnotationValue'
'{'
('operation' operation=[types::JvmOperation|EString])?
('values' '(' values+=[types::JvmEnumerationLiteral|EString] ( "," values+=[types::JvmEnumerationLiteral|EString])* ')' )?
'}';
JvmCustomAnnotationValue returns types::JvmCustomAnnotationValue:
{types::JvmCustomAnnotationValue}
'JvmCustomAnnotationValue'
'{'
('operation' operation=[types::JvmOperation|EString])?
('values' '(' values+=[ecore::EObject|EString] ( "," values+=[ecore::EObject|EString])* ')' )?
'}';
JvmFormalParameter returns types::JvmFormalParameter:
{types::JvmFormalParameter}
'JvmFormalParameter'
name=EString
'{'
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('parameterType' parameterType=JvmTypeReference)?
'}';
EInt returns ecore::EInt:
'-'? INT;
EByte returns ecore::EByte:
'-'? INT;
EShort returns ecore::EShort:
'-'? INT;
ELong returns ecore::ELong:
'-'? INT;
EDouble returns ecore::EDouble:
'-'? INT? '.' INT (('E'|'e') '-'? INT)?;
EFloat returns ecore::EFloat:
'-'? INT? '.' INT (('E'|'e') '-'? INT)?;
EChar returns ecore::EChar:
'-'? INT;
JvmEnumerationLiteral returns types::JvmEnumerationLiteral:
{types::JvmEnumerationLiteral}
(deprecated?='deprecated')?
(static?='static')?
(final?='final')?
(volatile?='volatile')?
(transient?='transient')?
(constant?='constant')?
'JvmEnumerationLiteral'
'{'
('visibility' visibility=JvmVisibility)?
('simpleName' simpleName=EString)?
('constantValue' constantValue=EJavaObject)?
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )?
('type' type=JvmTypeReference)?
'}';
EJavaObject returns ecore::EJavaObject:
'EJavaObject' /* TODO: implement this rule and an appropriate IValueConverter */;
EObject returns ecore::EObject:
{ecore::EObject}
'EObject'
;
JvmField_Impl returns types::JvmField:
{types::JvmField}
(deprecated?='deprecated')?
(static?='static')?
(final?='final')?
(volatile?='volatile')?
(transient?='transient')?
(constant?='constant')?
'JvmField'
'{'
('visibility' visibility=JvmVisibility)?
('simpleName' simpleName=EString)?
('constantValue' constantValue=EJavaObject)?
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )?
('type' type=JvmTypeReference)?
'}';
JvmConstructor returns types::JvmConstructor:
{types::JvmConstructor}
(deprecated?='deprecated')?
(varArgs?='varArgs')?
'JvmConstructor'
'{'
('visibility' visibility=JvmVisibility)?
('simpleName' simpleName=EString)?
('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )?
('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )?
('typeParameters' '{' typeParameters+=JvmTypeParameter ( "," typeParameters+=JvmTypeParameter)* '}' )?
('parameters' '{' parameters+=JvmFormalParameter ( "," parameters+=JvmFormalParameter)* '}' )?
('exceptions' '{' exceptions+=JvmTypeReference ( "," exceptions+=JvmTypeReference)* '}' )?
'}';
JvmUpperBound returns types::JvmUpperBound:
{types::JvmUpperBound}
'JvmUpperBound'
'{'
('typeReference' typeReference=JvmTypeReference)?
'}';
JvmLowerBound returns types::JvmLowerBound:
{types::JvmLowerBound}
'JvmLowerBound'
'{'
('typeReference' typeReference=JvmTypeReference)?
'}';
XIfExpression returns xbase::XIfExpression:
{xbase::XIfExpression}
'XIfExpression'
'{'
('if' if=XExpression)?
('then' then=XExpression)?
('else' else=XExpression)?
'}';
XSwitchExpression returns xbase::XSwitchExpression:
{xbase::XSwitchExpression}
'XSwitchExpression'
'{'
('switch' switch=XExpression)?
('cases' '{' cases+=XCasePart ( "," cases+=XCasePart)* '}' )?
('default' default=XExpression)?
('declaredParam' declaredParam=JvmFormalParameter)?
'}';
XVariableDeclaration returns xbase::XVariableDeclaration:
{xbase::XVariableDeclaration}
(writeable?='writeable')?
'XVariableDeclaration'
name=EString
'{'
('type' type=JvmTypeReference)?
('right' right=XExpression)?
'}';
XMemberFeatureCall returns xbase::XMemberFeatureCall:
{xbase::XMemberFeatureCall}
(explicitOperationCall?='explicitOperationCall')?
(explicitStatic?='explicitStatic')?
(nullSafe?='nullSafe')?
'XMemberFeatureCall'
'{'
('feature' feature=[types::JvmIdentifiableElement|EString])?
('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )?
('memberCallTarget' memberCallTarget=XExpression)?
('memberCallArguments' '{' memberCallArguments+=XExpression ( "," memberCallArguments+=XExpression)* '}' )?
'}';
XFeatureCall returns xbase::XFeatureCall:
{xbase::XFeatureCall}
(explicitOperationCall?='explicitOperationCall')?
'XFeatureCall'
'{'
('feature' feature=[types::JvmIdentifiableElement|EString])?
('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )?
('featureCallArguments' '{' featureCallArguments+=XExpression ( "," featureCallArguments+=XExpression)* '}' )?
'}';
XConstructorCall returns xbase::XConstructorCall:
{xbase::XConstructorCall}
(explicitConstructorCall?='explicitConstructorCall')?
'XConstructorCall'
'{'
('constructor' constructor=[types::JvmConstructor|EString])?
('arguments' '{' arguments+=XExpression ( "," arguments+=XExpression)* '}' )?
('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )?
'}';
XBooleanLiteral returns xbase::XBooleanLiteral:
{xbase::XBooleanLiteral}
(isTrue?='isTrue')?
'XBooleanLiteral'
;
XNullLiteral returns xbase::XNullLiteral:
{xbase::XNullLiteral}
'XNullLiteral'
;
XNumberLiteral returns xbase::XNumberLiteral:
{xbase::XNumberLiteral}
'XNumberLiteral'
'{'
('value' value=EString)?
'}';
XStringLiteral returns xbase::XStringLiteral:
{xbase::XStringLiteral}
'XStringLiteral'
'{'
('value' value=EString)?
'}';
XListLiteral returns xbase::XListLiteral:
{xbase::XListLiteral}
'XListLiteral'
'{'
('elements' '{' elements+=XExpression ( "," elements+=XExpression)* '}' )?
'}';
XSetLiteral returns xbase::XSetLiteral:
{xbase::XSetLiteral}
'XSetLiteral'
'{'
('elements' '{' elements+=XExpression ( "," elements+=XExpression)* '}' )?
'}';
XClosure returns xbase::XClosure:
{xbase::XClosure}
(explicitSyntax?='explicitSyntax')?
'XClosure'
'{'
('declaredFormalParameters' '{' declaredFormalParameters+=JvmFormalParameter ( "," declaredFormalParameters+=JvmFormalParameter)* '}' )?
('expression' expression=XExpression)?
'}';
XCastedExpression returns xbase::XCastedExpression:
{xbase::XCastedExpression}
'XCastedExpression'
'{'
('type' type=JvmTypeReference)?
('target' target=XExpression)?
'}';
XBinaryOperation returns xbase::XBinaryOperation:
{xbase::XBinaryOperation}
(reassignFirstArgument?='reassignFirstArgument')?
'XBinaryOperation'
'{'
('feature' feature=[types::JvmIdentifiableElement|EString])?
('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )?
('leftOperand' leftOperand=XExpression)?
('rightOperand' rightOperand=XExpression)?
'}';
XUnaryOperation returns xbase::XUnaryOperation:
{xbase::XUnaryOperation}
'XUnaryOperation'
'{'
('feature' feature=[types::JvmIdentifiableElement|EString])?
('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )?
('operand' operand=XExpression)?
'}';
XPostfixOperation returns xbase::XPostfixOperation:
{xbase::XPostfixOperation}
'XPostfixOperation'
'{'
('feature' feature=[types::JvmIdentifiableElement|EString])?
('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )?
('operand' operand=XExpression)?
'}';
XForLoopExpression returns xbase::XForLoopExpression:
{xbase::XForLoopExpression}
'XForLoopExpression'
'{'
('forExpression' forExpression=XExpression)?
('eachExpression' eachExpression=XExpression)?
('declaredParam' declaredParam=JvmFormalParameter)?
'}';
XBasicForLoopExpression returns xbase::XBasicForLoopExpression:
{xbase::XBasicForLoopExpression}
'XBasicForLoopExpression'
'{'
('expression' expression=XExpression)?
('eachExpression' eachExpression=XExpression)?
('initExpressions' '{' initExpressions+=XExpression ( "," initExpressions+=XExpression)* '}' )?
('updateExpressions' '{' updateExpressions+=XExpression ( "," updateExpressions+=XExpression)* '}' )?
'}';
XDoWhileExpression returns xbase::XDoWhileExpression:
{xbase::XDoWhileExpression}
'XDoWhileExpression'
'{'
('predicate' predicate=XExpression)?
('body' body=XExpression)?
'}';
XWhileExpression returns xbase::XWhileExpression:
{xbase::XWhileExpression}
'XWhileExpression'
'{'
('predicate' predicate=XExpression)?
('body' body=XExpression)?
'}';
XTypeLiteral returns xbase::XTypeLiteral:
'XTypeLiteral'
'{'
('arrayDimensions' '{' arrayDimensions+=EString ( "," arrayDimensions+=EString)* '}' )?
'type' type=[types::JvmType|EString]
'}';
XInstanceOfExpression returns xbase::XInstanceOfExpression:
'XInstanceOfExpression'
'{'
'type' type=JvmTypeReference
'expression' expression=XExpression
'}';
XThrowExpression returns xbase::XThrowExpression:
{xbase::XThrowExpression}
'XThrowExpression'
'{'
('expression' expression=XExpression)?
'}';
XTryCatchFinallyExpression returns xbase::XTryCatchFinallyExpression:
{xbase::XTryCatchFinallyExpression}
'XTryCatchFinallyExpression'
'{'
('expression' expression=XExpression)?
('finallyExpression' finallyExpression=XExpression)?
('catchClauses' '{' catchClauses+=XCatchClause ( "," catchClauses+=XCatchClause)* '}' )?
'}';
XAssignment returns xbase::XAssignment:
{xbase::XAssignment}
(explicitStatic?='explicitStatic')?
'XAssignment'
'{'
('feature' feature=[types::JvmIdentifiableElement|EString])?
('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )?
('assignable' assignable=XExpression)?
('value' value=XExpression)?
'}';
Generator wrongly configured
Using Xbase
Using Xbase
I am missing the Maven part…
https://github.com/holgerschill/XtextCon_Xcore_Maven
A full working example can be found here
Tycho
Xtext Maven Plugin
Exec-Maven-Plugin
Xtend Maven Plugin
Pittfalls
<plugin>
<groupId>org.eclipse.xtext</groupId>
<artifactId>xtext-maven-plugin</artifactId>
<version>${xtext-version}</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<languages>
<language>
<setup>org.eclipse.xtext.ecore.EcoreSupport</setup>
</language>
<language>
<setup>org.eclipse.emf.codegen.ecore.xtext.GenModelSupport</setup>
</language>
<language>
<setup>org.eclipse.emf.ecore.xcore.XcoreStandaloneSetup</setup>
</language>
</languages>
<sourceRoots>
<root>${project.basedir}/model</root>
</sourceRoots>
</configuration>
Register right languages for Xcore
Pittfalls
Right dependencies to generate Java out of Xcore
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.resources</artifactId>
<version>3.7.100</version>
</dependency>
<dependency>
<groupId>org.eclipse.text</groupId>
<artifactId>org.eclipse.text</artifactId>
<version>3.5.101</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.codegen.ecore.xtext</artifactId>
<version>${ecore-xtext-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore.xcore.lib</artifactId>
<version>${ecore-xcore-lib-version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore.xcore</artifactId>
<version>${ecore-xcore-version}</version>
</dependency>
</dependencies>
Pittfalls
Set modelDirectory in Xcore files explicitly
@GenModel(modelDirectory="./src-gen")
package org.xtext.example.myfirstdsl
import common.NamedElement
import common.Referenceable
class FirstElement extends NamedElement, Referenceable {
refers Referenceable ref
}
Pittfalls
Don’t use classpath URIs in MWE2
var fileExtensions = "first"
var projectName = "org.xtext.example.firstdsl.lang"
var runtimeProject = "../${projectName}"
var generateXtendStub = true
//var grammarURI = "classpath:/org/xtext/example/firstdsl/Lang.xtext"
var grammarURI = "platform:/resource/${projectName}/src/org/xtext/example/firstdsl/Lang.xtext"
Pittfalls
Explicitly set path to generate Java classes
// generates Java API for the generated EPackages
fragment = ecore.EMFGeneratorFragment auto-inject {
javaModelDirectory = "/${projectName}/src-gen"
}
Questions?
Ad

More Related Content

What's hot (20)

Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)
Khaled Anaqwa
 
hibernate with JPA
hibernate with JPAhibernate with JPA
hibernate with JPA
Mohammad Faizan
 
Applets
AppletsApplets
Applets
SanthiNivas
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
Marc Grabanski
 
Programación Funcional 101 con Scala y ZIO 2.0
Programación Funcional 101 con Scala y ZIO 2.0Programación Funcional 101 con Scala y ZIO 2.0
Programación Funcional 101 con Scala y ZIO 2.0
Jorge Vásquez
 
Hibernate Basic Concepts - Presentation
Hibernate Basic Concepts - PresentationHibernate Basic Concepts - Presentation
Hibernate Basic Concepts - Presentation
Khoa Nguyen
 
Regular expression in javascript
Regular expression in javascriptRegular expression in javascript
Regular expression in javascript
Toan Nguyen
 
Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)
Khaled Anaqwa
 
Android Jetpack Compose - Turkey 2021
Android Jetpack Compose - Turkey 2021Android Jetpack Compose - Turkey 2021
Android Jetpack Compose - Turkey 2021
Nelson Glauber Leal
 
MySQL Basics
MySQL BasicsMySQL Basics
MySQL Basics
mysql content
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
Mohit Kanwar
 
JavaScript Inheritance
JavaScript InheritanceJavaScript Inheritance
JavaScript Inheritance
Jussi Pohjolainen
 
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
 JavaScript - Chapter 9 - TypeConversion and Regular Expressions  JavaScript - Chapter 9 - TypeConversion and Regular Expressions
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
WebStackAcademy
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
Russ Weakley
 
Functional Programming 101 with Scala and ZIO @FunctionalWorld
Functional Programming 101 with Scala and ZIO @FunctionalWorldFunctional Programming 101 with Scala and ZIO @FunctionalWorld
Functional Programming 101 with Scala and ZIO @FunctionalWorld
Jorge Vásquez
 
Vulkan 1.1 Reference Guide
Vulkan 1.1 Reference GuideVulkan 1.1 Reference Guide
Vulkan 1.1 Reference Guide
The Khronos Group Inc.
 
Implementing the IO Monad in Scala
Implementing the IO Monad in ScalaImplementing the IO Monad in Scala
Implementing the IO Monad in Scala
Hermann Hueck
 
New Elements & Features in CSS3
New Elements & Features in CSS3New Elements & Features in CSS3
New Elements & Features in CSS3
Jamshid Hashimi
 
C++20 the small things - Timur Doumler
C++20 the small things - Timur DoumlerC++20 the small things - Timur Doumler
C++20 the small things - Timur Doumler
corehard_by
 
PHP HTML CSS Notes
PHP HTML CSS  NotesPHP HTML CSS  Notes
PHP HTML CSS Notes
Tushar Rajput
 
Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)
Khaled Anaqwa
 
Programación Funcional 101 con Scala y ZIO 2.0
Programación Funcional 101 con Scala y ZIO 2.0Programación Funcional 101 con Scala y ZIO 2.0
Programación Funcional 101 con Scala y ZIO 2.0
Jorge Vásquez
 
Hibernate Basic Concepts - Presentation
Hibernate Basic Concepts - PresentationHibernate Basic Concepts - Presentation
Hibernate Basic Concepts - Presentation
Khoa Nguyen
 
Regular expression in javascript
Regular expression in javascriptRegular expression in javascript
Regular expression in javascript
Toan Nguyen
 
Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)Android Training (Storing data using SQLite)
Android Training (Storing data using SQLite)
Khaled Anaqwa
 
Android Jetpack Compose - Turkey 2021
Android Jetpack Compose - Turkey 2021Android Jetpack Compose - Turkey 2021
Android Jetpack Compose - Turkey 2021
Nelson Glauber Leal
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
Mohit Kanwar
 
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
 JavaScript - Chapter 9 - TypeConversion and Regular Expressions  JavaScript - Chapter 9 - TypeConversion and Regular Expressions
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
WebStackAcademy
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
Russ Weakley
 
Functional Programming 101 with Scala and ZIO @FunctionalWorld
Functional Programming 101 with Scala and ZIO @FunctionalWorldFunctional Programming 101 with Scala and ZIO @FunctionalWorld
Functional Programming 101 with Scala and ZIO @FunctionalWorld
Jorge Vásquez
 
Implementing the IO Monad in Scala
Implementing the IO Monad in ScalaImplementing the IO Monad in Scala
Implementing the IO Monad in Scala
Hermann Hueck
 
New Elements & Features in CSS3
New Elements & Features in CSS3New Elements & Features in CSS3
New Elements & Features in CSS3
Jamshid Hashimi
 
C++20 the small things - Timur Doumler
C++20 the small things - Timur DoumlerC++20 the small things - Timur Doumler
C++20 the small things - Timur Doumler
corehard_by
 

Viewers also liked (20)

Syntaxe concrète des DSL en IDM [avec Xtext]
Syntaxe concrète des DSL en IDM [avec Xtext]Syntaxe concrète des DSL en IDM [avec Xtext]
Syntaxe concrète des DSL en IDM [avec Xtext]
Olivier Le Goaër
 
Building Your Own DSL with Xtext
Building Your Own DSL with XtextBuilding Your Own DSL with Xtext
Building Your Own DSL with Xtext
GlobalLogic Ukraine
 
Java DSLs with Xtext
Java DSLs with XtextJava DSLs with Xtext
Java DSLs with Xtext
Dr. Jan Köhnlein
 
Introduction to Xbase
Introduction to XbaseIntroduction to Xbase
Introduction to Xbase
Holger Schill
 
Language Engineering With Xtext
Language Engineering With XtextLanguage Engineering With Xtext
Language Engineering With Xtext
Sven Efftinge
 
Scoping Tips and Tricks
Scoping Tips and TricksScoping Tips and Tricks
Scoping Tips and Tricks
Sebastian Zarnekow
 
Scoping
ScopingScoping
Scoping
Dr. Jan Köhnlein
 
Pragmatic DSL Design with Xtext, Xbase and Xtend 2
Pragmatic DSL Design with Xtext, Xbase and Xtend 2Pragmatic DSL Design with Xtext, Xbase and Xtend 2
Pragmatic DSL Design with Xtext, Xbase and Xtend 2
Dr. Jan Köhnlein
 
Executable specifications for xtext
Executable specifications for xtextExecutable specifications for xtext
Executable specifications for xtext
meysholdt
 
Future of Xtext
Future of XtextFuture of Xtext
Future of Xtext
Sven Efftinge
 
Xtext Best Practices
Xtext Best PracticesXtext Best Practices
Xtext Best Practices
Sebastian Zarnekow
 
The Xtext Grammar Language
The Xtext Grammar LanguageThe Xtext Grammar Language
The Xtext Grammar Language
Dr. Jan Köhnlein
 
Parsing Expression With Xtext
Parsing Expression With XtextParsing Expression With Xtext
Parsing Expression With Xtext
Sven Efftinge
 
Extending the Xbase Typesystem
Extending the Xbase TypesystemExtending the Xbase Typesystem
Extending the Xbase Typesystem
Sebastian Zarnekow
 
What's Cooking in Xtext 2.0
What's Cooking in Xtext 2.0What's Cooking in Xtext 2.0
What's Cooking in Xtext 2.0
Dr. Jan Köhnlein
 
Codegeneration Goodies
Codegeneration GoodiesCodegeneration Goodies
Codegeneration Goodies
meysholdt
 
Code Generation idioms with Xtend
Code Generation idioms with XtendCode Generation idioms with Xtend
Code Generation idioms with Xtend
Holger Schill
 
Uml to code with acceleo
Uml to code with acceleoUml to code with acceleo
Uml to code with acceleo
Tarun Telang
 
Recipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with XtendRecipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with Xtend
Karsten Thoms
 
EMF - Beyond The Basics
EMF - Beyond The BasicsEMF - Beyond The Basics
EMF - Beyond The Basics
Dr. Jan Köhnlein
 
Syntaxe concrète des DSL en IDM [avec Xtext]
Syntaxe concrète des DSL en IDM [avec Xtext]Syntaxe concrète des DSL en IDM [avec Xtext]
Syntaxe concrète des DSL en IDM [avec Xtext]
Olivier Le Goaër
 
Building Your Own DSL with Xtext
Building Your Own DSL with XtextBuilding Your Own DSL with Xtext
Building Your Own DSL with Xtext
GlobalLogic Ukraine
 
Introduction to Xbase
Introduction to XbaseIntroduction to Xbase
Introduction to Xbase
Holger Schill
 
Language Engineering With Xtext
Language Engineering With XtextLanguage Engineering With Xtext
Language Engineering With Xtext
Sven Efftinge
 
Pragmatic DSL Design with Xtext, Xbase and Xtend 2
Pragmatic DSL Design with Xtext, Xbase and Xtend 2Pragmatic DSL Design with Xtext, Xbase and Xtend 2
Pragmatic DSL Design with Xtext, Xbase and Xtend 2
Dr. Jan Köhnlein
 
Executable specifications for xtext
Executable specifications for xtextExecutable specifications for xtext
Executable specifications for xtext
meysholdt
 
Parsing Expression With Xtext
Parsing Expression With XtextParsing Expression With Xtext
Parsing Expression With Xtext
Sven Efftinge
 
Extending the Xbase Typesystem
Extending the Xbase TypesystemExtending the Xbase Typesystem
Extending the Xbase Typesystem
Sebastian Zarnekow
 
Codegeneration Goodies
Codegeneration GoodiesCodegeneration Goodies
Codegeneration Goodies
meysholdt
 
Code Generation idioms with Xtend
Code Generation idioms with XtendCode Generation idioms with Xtend
Code Generation idioms with Xtend
Holger Schill
 
Uml to code with acceleo
Uml to code with acceleoUml to code with acceleo
Uml to code with acceleo
Tarun Telang
 
Recipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with XtendRecipes to build Code Generators for Non-Xtext Models with Xtend
Recipes to build Code Generators for Non-Xtext Models with Xtend
Karsten Thoms
 
Ad

Similar to Using Xcore with Xtext (20)

Tornadoweb
TornadowebTornadoweb
Tornadoweb
Osman Yuksel
 
The Naked Bundle - Symfony Usergroup Belgium
The Naked Bundle - Symfony Usergroup BelgiumThe Naked Bundle - Symfony Usergroup Belgium
The Naked Bundle - Symfony Usergroup Belgium
Matthias Noback
 
srgoc
srgocsrgoc
srgoc
Gaurav Singh
 
The Naked Bundle - Symfony Barcelona
The Naked Bundle - Symfony BarcelonaThe Naked Bundle - Symfony Barcelona
The Naked Bundle - Symfony Barcelona
Matthias Noback
 
The Naked Bundle - Symfony Live London 2014
The Naked Bundle - Symfony Live London 2014The Naked Bundle - Symfony Live London 2014
The Naked Bundle - Symfony Live London 2014
Matthias Noback
 
Reversing JavaScript
Reversing JavaScriptReversing JavaScript
Reversing JavaScript
Roberto Suggi Liverani
 
Let ColdFusion ORM do the work for you!
Let ColdFusion ORM do the work for you!Let ColdFusion ORM do the work for you!
Let ColdFusion ORM do the work for you!
Masha Edelen
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
ciklum_ods
 
Devoxx08 - Nuxeo Core, JCR 2, CMIS
Devoxx08 - Nuxeo Core, JCR 2, CMIS Devoxx08 - Nuxeo Core, JCR 2, CMIS
Devoxx08 - Nuxeo Core, JCR 2, CMIS
Nuxeo
 
Hack an ASP .NET website? Hard, but possible!
Hack an ASP .NET website? Hard, but possible! Hack an ASP .NET website? Hard, but possible!
Hack an ASP .NET website? Hard, but possible!
Vladimir Kochetkov
 
SAX, DOM & JDOM parsers for beginners
SAX, DOM & JDOM parsers for beginnersSAX, DOM & JDOM parsers for beginners
SAX, DOM & JDOM parsers for beginners
Hicham QAISSI
 
backend
backendbackend
backend
tutorialsruby
 
backend
backendbackend
backend
tutorialsruby
 
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridDatagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrid
Giorgio Cefaro
 
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridDatagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrid
eugenio pombi
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom
kaven yan
 
Global objects in Node.pdf
Global objects in Node.pdfGlobal objects in Node.pdf
Global objects in Node.pdf
SudhanshiBakre1
 
Ian 2014.10.24 weekly report
Ian 2014.10.24 weekly reportIan 2014.10.24 weekly report
Ian 2014.10.24 weekly report
LearningTech
 
Back-2-Basics: .NET Coding Standards For The Real World (2011)
Back-2-Basics: .NET Coding Standards For The Real World (2011)Back-2-Basics: .NET Coding Standards For The Real World (2011)
Back-2-Basics: .NET Coding Standards For The Real World (2011)
David McCarter
 
Writing Swift code with great testability
Writing Swift code with great testabilityWriting Swift code with great testability
Writing Swift code with great testability
John Sundell
 
The Naked Bundle - Symfony Usergroup Belgium
The Naked Bundle - Symfony Usergroup BelgiumThe Naked Bundle - Symfony Usergroup Belgium
The Naked Bundle - Symfony Usergroup Belgium
Matthias Noback
 
The Naked Bundle - Symfony Barcelona
The Naked Bundle - Symfony BarcelonaThe Naked Bundle - Symfony Barcelona
The Naked Bundle - Symfony Barcelona
Matthias Noback
 
The Naked Bundle - Symfony Live London 2014
The Naked Bundle - Symfony Live London 2014The Naked Bundle - Symfony Live London 2014
The Naked Bundle - Symfony Live London 2014
Matthias Noback
 
Let ColdFusion ORM do the work for you!
Let ColdFusion ORM do the work for you!Let ColdFusion ORM do the work for you!
Let ColdFusion ORM do the work for you!
Masha Edelen
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
ciklum_ods
 
Devoxx08 - Nuxeo Core, JCR 2, CMIS
Devoxx08 - Nuxeo Core, JCR 2, CMIS Devoxx08 - Nuxeo Core, JCR 2, CMIS
Devoxx08 - Nuxeo Core, JCR 2, CMIS
Nuxeo
 
Hack an ASP .NET website? Hard, but possible!
Hack an ASP .NET website? Hard, but possible! Hack an ASP .NET website? Hard, but possible!
Hack an ASP .NET website? Hard, but possible!
Vladimir Kochetkov
 
SAX, DOM & JDOM parsers for beginners
SAX, DOM & JDOM parsers for beginnersSAX, DOM & JDOM parsers for beginners
SAX, DOM & JDOM parsers for beginners
Hicham QAISSI
 
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridDatagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrid
Giorgio Cefaro
 
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridDatagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrid
eugenio pombi
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom
kaven yan
 
Global objects in Node.pdf
Global objects in Node.pdfGlobal objects in Node.pdf
Global objects in Node.pdf
SudhanshiBakre1
 
Ian 2014.10.24 weekly report
Ian 2014.10.24 weekly reportIan 2014.10.24 weekly report
Ian 2014.10.24 weekly report
LearningTech
 
Back-2-Basics: .NET Coding Standards For The Real World (2011)
Back-2-Basics: .NET Coding Standards For The Real World (2011)Back-2-Basics: .NET Coding Standards For The Real World (2011)
Back-2-Basics: .NET Coding Standards For The Real World (2011)
David McCarter
 
Writing Swift code with great testability
Writing Swift code with great testabilityWriting Swift code with great testability
Writing Swift code with great testability
John Sundell
 
Ad

Recently uploaded (20)

cardiovascular outcome in trial of new antidiabetic drugs
cardiovascular outcome in trial of new antidiabetic drugscardiovascular outcome in trial of new antidiabetic drugs
cardiovascular outcome in trial of new antidiabetic drugs
Mohammed Ahmed Bamashmos
 
Reflections on an ngo peace conference in zimbabwe
Reflections on an ngo peace conference in zimbabweReflections on an ngo peace conference in zimbabwe
Reflections on an ngo peace conference in zimbabwe
jujuaw05
 
A Bot Identification Model and Tool Based on GitHub Activity Sequences
A Bot Identification Model and Tool Based on GitHub Activity SequencesA Bot Identification Model and Tool Based on GitHub Activity Sequences
A Bot Identification Model and Tool Based on GitHub Activity Sequences
natarajan8993
 
Lec 3 - Chapter 2 Carl Jung’s Theory of Personality.pptx
Lec 3 - Chapter 2 Carl Jung’s Theory of Personality.pptxLec 3 - Chapter 2 Carl Jung’s Theory of Personality.pptx
Lec 3 - Chapter 2 Carl Jung’s Theory of Personality.pptx
TayyabaSiddiqui12
 
Key Elements of a Procurement Plan.docx.
Key Elements of a Procurement Plan.docx.Key Elements of a Procurement Plan.docx.
Key Elements of a Procurement Plan.docx.
NeoRakodu
 
fundamentals of communicationclass notes.pptx
fundamentals of communicationclass notes.pptxfundamentals of communicationclass notes.pptx
fundamentals of communicationclass notes.pptx
Sunkod
 
Updated treatment of hypothyroidism, causes and symptoms
Updated treatment of hypothyroidism,  causes and symptomsUpdated treatment of hypothyroidism,  causes and symptoms
Updated treatment of hypothyroidism, causes and symptoms
Mohammed Ahmed Bamashmos
 
2. Asexual propagation of fruit crops and .pptx
2. Asexual propagation of fruit crops and .pptx2. Asexual propagation of fruit crops and .pptx
2. Asexual propagation of fruit crops and .pptx
aschenakidawit1
 
NASIG ISSN 2025 updated for the_4-30meeting.pptx
NASIG ISSN 2025 updated for the_4-30meeting.pptxNASIG ISSN 2025 updated for the_4-30meeting.pptx
NASIG ISSN 2025 updated for the_4-30meeting.pptx
reine1
 
Setup & Implementation of OutSystems Cloud Connector ODC
Setup & Implementation of OutSystems Cloud Connector ODCSetup & Implementation of OutSystems Cloud Connector ODC
Setup & Implementation of OutSystems Cloud Connector ODC
outsystemspuneusergr
 
ICSE 2025 Keynote: Software Sustainability and its Engineering: How far have ...
ICSE 2025 Keynote: Software Sustainability and its Engineering: How far have ...ICSE 2025 Keynote: Software Sustainability and its Engineering: How far have ...
ICSE 2025 Keynote: Software Sustainability and its Engineering: How far have ...
patricialago3459
 
Bidding World Conference 2027-NSGF Senegal.pdf
Bidding World Conference 2027-NSGF Senegal.pdfBidding World Conference 2027-NSGF Senegal.pdf
Bidding World Conference 2027-NSGF Senegal.pdf
ISGF - International Scout and Guide Fellowship
 
THE SEXUAL HARASSMENT OF WOMAN AT WORKPLACE (PREVENTION, PROHIBITION & REDRES...
THE SEXUAL HARASSMENT OF WOMAN AT WORKPLACE (PREVENTION, PROHIBITION & REDRES...THE SEXUAL HARASSMENT OF WOMAN AT WORKPLACE (PREVENTION, PROHIBITION & REDRES...
THE SEXUAL HARASSMENT OF WOMAN AT WORKPLACE (PREVENTION, PROHIBITION & REDRES...
ASHISHKUMAR504404
 
Bidding World Conference 2027 - NSGF Mexico.pdf
Bidding World Conference 2027 - NSGF Mexico.pdfBidding World Conference 2027 - NSGF Mexico.pdf
Bidding World Conference 2027 - NSGF Mexico.pdf
ISGF - International Scout and Guide Fellowship
 
Basic.pptxsksdjsdjdvkfvfvfvfvfvfvfvfvfvvvv
Basic.pptxsksdjsdjdvkfvfvfvfvfvfvfvfvfvvvvBasic.pptxsksdjsdjdvkfvfvfvfvfvfvfvfvfvvvv
Basic.pptxsksdjsdjdvkfvfvfvfvfvfvfvfvfvvvv
hkthmrz42n
 
2025-05-04 A New Day Dawns 03 (shared slides).pptx
2025-05-04 A New Day Dawns 03 (shared slides).pptx2025-05-04 A New Day Dawns 03 (shared slides).pptx
2025-05-04 A New Day Dawns 03 (shared slides).pptx
Dale Wells
 
The Business Dynamics of Quick Commerce.pdf
The Business Dynamics of Quick Commerce.pdfThe Business Dynamics of Quick Commerce.pdf
The Business Dynamics of Quick Commerce.pdf
RDinuRao
 
Speech 2-Unity in Diversity, Strength in Solidarity
Speech 2-Unity in Diversity, Strength in SolidaritySpeech 2-Unity in Diversity, Strength in Solidarity
Speech 2-Unity in Diversity, Strength in Solidarity
Noraini Yunus
 
Microsoft Azure Data Fundamentals (DP-900) Exam Dumps & Questions 2025.pdf
Microsoft Azure Data Fundamentals (DP-900) Exam Dumps & Questions 2025.pdfMicrosoft Azure Data Fundamentals (DP-900) Exam Dumps & Questions 2025.pdf
Microsoft Azure Data Fundamentals (DP-900) Exam Dumps & Questions 2025.pdf
MinniePfeiffer
 
Besu Shibpur Enquesta 2012 Intra College General Quiz Prelims.pptx
Besu Shibpur Enquesta 2012 Intra College General Quiz Prelims.pptxBesu Shibpur Enquesta 2012 Intra College General Quiz Prelims.pptx
Besu Shibpur Enquesta 2012 Intra College General Quiz Prelims.pptx
Rajdeep Chakraborty
 
cardiovascular outcome in trial of new antidiabetic drugs
cardiovascular outcome in trial of new antidiabetic drugscardiovascular outcome in trial of new antidiabetic drugs
cardiovascular outcome in trial of new antidiabetic drugs
Mohammed Ahmed Bamashmos
 
Reflections on an ngo peace conference in zimbabwe
Reflections on an ngo peace conference in zimbabweReflections on an ngo peace conference in zimbabwe
Reflections on an ngo peace conference in zimbabwe
jujuaw05
 
A Bot Identification Model and Tool Based on GitHub Activity Sequences
A Bot Identification Model and Tool Based on GitHub Activity SequencesA Bot Identification Model and Tool Based on GitHub Activity Sequences
A Bot Identification Model and Tool Based on GitHub Activity Sequences
natarajan8993
 
Lec 3 - Chapter 2 Carl Jung’s Theory of Personality.pptx
Lec 3 - Chapter 2 Carl Jung’s Theory of Personality.pptxLec 3 - Chapter 2 Carl Jung’s Theory of Personality.pptx
Lec 3 - Chapter 2 Carl Jung’s Theory of Personality.pptx
TayyabaSiddiqui12
 
Key Elements of a Procurement Plan.docx.
Key Elements of a Procurement Plan.docx.Key Elements of a Procurement Plan.docx.
Key Elements of a Procurement Plan.docx.
NeoRakodu
 
fundamentals of communicationclass notes.pptx
fundamentals of communicationclass notes.pptxfundamentals of communicationclass notes.pptx
fundamentals of communicationclass notes.pptx
Sunkod
 
Updated treatment of hypothyroidism, causes and symptoms
Updated treatment of hypothyroidism,  causes and symptomsUpdated treatment of hypothyroidism,  causes and symptoms
Updated treatment of hypothyroidism, causes and symptoms
Mohammed Ahmed Bamashmos
 
2. Asexual propagation of fruit crops and .pptx
2. Asexual propagation of fruit crops and .pptx2. Asexual propagation of fruit crops and .pptx
2. Asexual propagation of fruit crops and .pptx
aschenakidawit1
 
NASIG ISSN 2025 updated for the_4-30meeting.pptx
NASIG ISSN 2025 updated for the_4-30meeting.pptxNASIG ISSN 2025 updated for the_4-30meeting.pptx
NASIG ISSN 2025 updated for the_4-30meeting.pptx
reine1
 
Setup & Implementation of OutSystems Cloud Connector ODC
Setup & Implementation of OutSystems Cloud Connector ODCSetup & Implementation of OutSystems Cloud Connector ODC
Setup & Implementation of OutSystems Cloud Connector ODC
outsystemspuneusergr
 
ICSE 2025 Keynote: Software Sustainability and its Engineering: How far have ...
ICSE 2025 Keynote: Software Sustainability and its Engineering: How far have ...ICSE 2025 Keynote: Software Sustainability and its Engineering: How far have ...
ICSE 2025 Keynote: Software Sustainability and its Engineering: How far have ...
patricialago3459
 
THE SEXUAL HARASSMENT OF WOMAN AT WORKPLACE (PREVENTION, PROHIBITION & REDRES...
THE SEXUAL HARASSMENT OF WOMAN AT WORKPLACE (PREVENTION, PROHIBITION & REDRES...THE SEXUAL HARASSMENT OF WOMAN AT WORKPLACE (PREVENTION, PROHIBITION & REDRES...
THE SEXUAL HARASSMENT OF WOMAN AT WORKPLACE (PREVENTION, PROHIBITION & REDRES...
ASHISHKUMAR504404
 
Basic.pptxsksdjsdjdvkfvfvfvfvfvfvfvfvfvvvv
Basic.pptxsksdjsdjdvkfvfvfvfvfvfvfvfvfvvvvBasic.pptxsksdjsdjdvkfvfvfvfvfvfvfvfvfvvvv
Basic.pptxsksdjsdjdvkfvfvfvfvfvfvfvfvfvvvv
hkthmrz42n
 
2025-05-04 A New Day Dawns 03 (shared slides).pptx
2025-05-04 A New Day Dawns 03 (shared slides).pptx2025-05-04 A New Day Dawns 03 (shared slides).pptx
2025-05-04 A New Day Dawns 03 (shared slides).pptx
Dale Wells
 
The Business Dynamics of Quick Commerce.pdf
The Business Dynamics of Quick Commerce.pdfThe Business Dynamics of Quick Commerce.pdf
The Business Dynamics of Quick Commerce.pdf
RDinuRao
 
Speech 2-Unity in Diversity, Strength in Solidarity
Speech 2-Unity in Diversity, Strength in SolidaritySpeech 2-Unity in Diversity, Strength in Solidarity
Speech 2-Unity in Diversity, Strength in Solidarity
Noraini Yunus
 
Microsoft Azure Data Fundamentals (DP-900) Exam Dumps & Questions 2025.pdf
Microsoft Azure Data Fundamentals (DP-900) Exam Dumps & Questions 2025.pdfMicrosoft Azure Data Fundamentals (DP-900) Exam Dumps & Questions 2025.pdf
Microsoft Azure Data Fundamentals (DP-900) Exam Dumps & Questions 2025.pdf
MinniePfeiffer
 
Besu Shibpur Enquesta 2012 Intra College General Quiz Prelims.pptx
Besu Shibpur Enquesta 2012 Intra College General Quiz Prelims.pptxBesu Shibpur Enquesta 2012 Intra College General Quiz Prelims.pptx
Besu Shibpur Enquesta 2012 Intra College General Quiz Prelims.pptx
Rajdeep Chakraborty
 

Using Xcore with Xtext

  • 5. You will come to the point… Where you want to take control…
  • 6. Problem grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals generate myDsl "http://www.xtext.org/example/mydsl/MyDsl" Model: elements+=AbstractElement*; AbstractElement: Element | SecondElement | ThirdElement ; Element: 'Element' name=ID ref=[AbstractElement] ; SecondElement: 'SecondElement' name=ID ; ThirdElement: 'ThirdElement' name=ID ; Example
  • 7. Problem grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals generate myDsl "http://www.xtext.org/example/mydsl/MyDsl" Model: elements+=AbstractElement*; AbstractElement: Element | SecondElement | ThirdElement ; Element: 'Element' name=ID ref=[AbstractElement] ; SecondElement: 'SecondElement' name=ID ; ThirdElement: 'ThirdElement' name=ID ; Example
  • 8. grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals generate myDsl "http://www.xtext.org/example/mydsl/MyDsl" Model: elements+=AbstractElement*; AbstractElement: Element | SecondElement | ThirdElement ; Element: 'Element' name=ID ref=[Referenceable] ; SecondElement: 'SecondElement' name=ID ; ThirdElement: 'ThirdElement' name=ID ; Referenceable: SecondElement | ThirdElement ; Never invoked by the parser Example Fake Rules to influence EMF Generator
  • 9. For rapid prototyping the generated model is fine When to stay with the generated model
  • 10. For rapid prototyping the generated model is fine Automatic synchronisation from grammar to model When to stay with the generated model
  • 11. For rapid prototyping the generated model is fine Automatic synchronisation from grammar to model If you do not need to introduce fake rules When to stay with the generated model
  • 12. But what if… DSL DSL DSL Order for generating DSLs is important
  • 13. But what if… DSL DSL DSL Order for generating DSLs is important Eagerly loaded
  • 14. DSL DSL DSLs reference each other But what if…
  • 18. Still that tree editor…
  • 19. Still that tree editor… Merging can be difficult
  • 22. The MyDSL example in Xcore
  • 23. Derives ecore and genmodel
  • 24. Put code directly in the model
  • 25. Put code directly in the model
  • 26. Load Xcore file No Registration needed Workflow configuration
  • 27. Don’t forget the Xcore dependency
  • 28. Don’t forget the Xcore dependency Caused by: org.xml.sax.SAXParseExceptionpublicId: platform:/resource/org.xtext.example.mydsl.model/model/MyDsl.xcore; systemId: platform:/resource/org.xtext.example.mydsl.model/model/MyDsl.xcore; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:999) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java: 510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) Invokes XcoreStandaloneSetup to register *.xcore
  • 29. There is a wizard for that…
  • 30. More complex setups Ecore model Xcore model Xtext DSL Xcore imports another ecore model Xtext DSL imports Xcore
  • 33. Caused by: java.lang.IllegalStateException: Problem parsing 'classpath:/org/xtext/example/ mydsl/MyDsl.xtext': TransformationDiagnostic: null:9 Cannot find compatible feature name in sealed EClass Greeting from imported package http://www.xtext.org/example/mydsl/MyDsl: The type 'Greeting' does not have a feature 'name'. (ErrorCode: CannotCreateTypeInSealedMetamodel) at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:247) ... 42 more You will face that Exception
  • 34. Caused by: java.lang.IllegalStateException: Problem parsing 'classpath:/org/xtext/example/ mydsl/MyDsl.xtext': TransformationDiagnostic: null:9 Cannot find compatible feature name in sealed EClass Greeting from imported package http://www.xtext.org/example/mydsl/MyDsl: The type 'Greeting' does not have a feature 'name'. (ErrorCode: CannotCreateTypeInSealedMetamodel) at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:247) ... 42 more You will face that Exception Ecore model Xcore model Proxy not resolvable Index is not aware of genmodel that the Xcore model links against Proxy
  • 35. But I added that stuff in the StandaloneSetup…?
  • 36. But I added that stuff in the StandaloneSetup…? ResourceSet Resource Resource Resource Resource ResourceSet Resource Resource
  • 37. Ecore model Xcore model Proxy What’s happening? ResourceSet Grammar Xcore resource Ecore model Genmodel Index ResourceDescription ResourceDescription ResourceDescription ResourceDescription
  • 43. More complex example Xtext DSL Xtext DSL Languages referencing each other
  • 44. More complex example Xtext DSL Xtext DSL Languages referencing each other Plugin Xtext DSL 1 Plugin Xtext DSL 1 Problem Circular dependency Buddypolicy
  • 45. Introduce a Ecore model as a protocol Xtext DSL Xtext DSL Ecore model Generated Model Generated Model
  • 46. grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals generate myDsl "http://www.xtext.org/example/mydsl/MyDsl" import "http://www.xtext.org/common/model" as common PackageDeclaration returns common::PackageDeclaration: 'package' name=FQN content+=Element ; Element returns common::NamedElement: {Element} 'element' name=ID '{' ref=[common::Referenceable | FQN]? '}' ; FQN: ID ('.' ID)* ; Introduce a Ecore model as a protocol
  • 47. grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals generate myDsl "http://www.xtext.org/example/mydsl/MyDsl" import "http://www.xtext.org/common/model" as common PackageDeclaration returns common::PackageDeclaration: 'package' name=FQN content+=Element ; Element returns common::NamedElement: {Element} 'element' name=ID '{' ref=[common::Referenceable | FQN]? '}' ; FQN: ID ('.' ID)* ; Introduce a Ecore model as a protocol
  • 48. More complex example Xtext DSL Xtext DSL Xcore model Xcore model Imported Model Imported Model
  • 49. More complex example Xtext DSL Xtext DSL Xcore model Xcore model Imported Model Imported Model Same Plugin
  • 50. More complex example Xtext DSL Xtext DSL Xcore model Xcore model Imported Model Imported Model Different plugins
  • 51. More complex example Xtext DSL Xtext DSL Ecore model Xcore model Xcore model Imported Model Imported Model
  • 53. grammar org.xtext.example.firstdsl.Lang with org.eclipse.xtext.common.Terminals import "org.xtext.example.myfirstdsl" import "http://www.eclipse.org/emf/2002/Ecore" as ecore import "http://www.xtext.org/common/model" as common import "org.xtext.example.myseconddsl" as second PackageDeclaration returns common::PackageDeclaration : 'package' name=FQN content+=FirstElement* ; FirstElement : 'element' name=ID '{' ref=[second::SecondElement| FQN]? '}' ; FQN: ID ('.' ID)* ; A lot of imports…
  • 54. grammar org.xtext.example.firstdsl.Lang with org.eclipse.xtext.common.Terminals import "org.xtext.example.myfirstdsl" import "http://www.eclipse.org/emf/2002/Ecore" as ecore import "http://www.xtext.org/common/model" as common import "org.xtext.example.myseconddsl" as second PackageDeclaration returns common::PackageDeclaration : 'package' name=FQN content+=FirstElement* ; FirstElement : 'element' name=ID '{' ref=[second::SecondElement| FQN]? '}' ; FQN: ID ('.' ID)* ; Have same root node…
  • 55. grammar org.xtext.example.firstdsl.Lang with org.eclipse.xtext.common.Terminals import "org.xtext.example.myfirstdsl" import "http://www.eclipse.org/emf/2002/Ecore" as ecore import "http://www.xtext.org/common/model" as common import "org.xtext.example.myseconddsl" as second PackageDeclaration returns common::PackageDeclaration : 'package' name=FQN content+=FirstElement* ; FirstElement : 'element' name=ID '{' ref=[second::SecondElement| FQN]? '}' ; FQN: ID ('.' ID)* ; Use implicitly imported classifier
  • 56. MWE2 configuration Same for both languages
  • 57. grammar org.xtext.example.firstdsl.Lang with org.eclipse.xtext.common.Terminals import "org.xtext.example.myfirstdsl" import "http://www.eclipse.org/emf/2002/Ecore" as ecore import "http://www.xtext.org/common/model" as common import "org.xtext.example.myseconddsl" as second PackageDeclaration returns common::PackageDeclaration : 'package' name=FQN content+=FirstElement* ; FirstElement : 'element' name=ID '{' ref=[second::SecondElement| FQN]? '}' ; FQN: ID ('.' ID)* ; But there is a small problem
  • 58. grammar org.xtext.example.firstdsl.Lang with org.eclipse.xtext.common.Terminals import "org.xtext.example.myfirstdsl" import "http://www.eclipse.org/emf/2002/Ecore" as ecore import "http://www.xtext.org/common/model" as common import "org.xtext.example.myseconddsl" as second PackageDeclaration returns common::PackageDeclaration : 'package' name=FQN content+=FirstElement* ; FirstElement : 'element' name=ID '{' ref=[second::SecondElement| FQN]? '}' ; FQN: ID ('.' ID)* ; CA is showing both elements?
  • 59. grammar org.xtext.example.firstdsl.Lang with org.eclipse.xtext.common.Terminals import "org.xtext.example.myfirstdsl" import "http://www.eclipse.org/emf/2002/Ecore" as ecore import "http://www.xtext.org/common/model" as common import "org.xtext.example.myseconddsl" as second PackageDeclaration returns common::PackageDeclaration : 'package' name=FQN content+=FirstElement* ; FirstElement : 'element' name=ID '{' ref=[second::SecondElement| FQN]? '}' ; FQN: ID ('.' ID)* ; CA is showing both elements?
  • 60. Xtext DSL Xtext DSL Ecore model Xcore model Xcore model generated Model generated Model One way to solve that…
  • 61. One way to solve that…
  • 62. One way to solve that… grammar org.xtext.example.seconddsl.Lang with org.eclipse.xtext.common.Terminals generate generatedSecondModel "http://www.xtext.org/generatedSecondModel" import "org.xtext.example.myseconddsl" import "http://www.xtext.org/common/model" as common import "http://www.eclipse.org/emf/2002/Ecore" as ecore import "org.xtext.example.myfirstdsl" as first PackageDeclaration returns common::PackageDeclaration : 'package' name=FQN content+=SecondElement* ; SecondElement returns SecondElement: {CustomSecondElement} 'element' name=ID '{' ref=[first::FirstElement | FQN]? '}' ; FQN: ID ('.' ID)* ;
  • 63. One way to solve that… grammar org.xtext.example.seconddsl.Lang with org.eclipse.xtext.common.Terminals generate generatedSecondModel "http://www.xtext.org/generatedSecondModel" import "org.xtext.example.myseconddsl" import "http://www.xtext.org/common/model" as common import "http://www.eclipse.org/emf/2002/Ecore" as ecore import "org.xtext.example.myfirstdsl" as first PackageDeclaration returns common::PackageDeclaration : 'package' name=FQN content+=SecondElement* ; SecondElement returns SecondElement: {CustomSecondElement} 'element' name=ID '{' ref=[first::FirstElement | FQN]? '}' ; FQN: ID ('.' ID)* ;
  • 64. But when I run it…. [ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: Generator) java.lang.RuntimeException: Could not find a GenModel for EPackage 'http://www.xtext.org/ generatedSecondModel' from http://www.xtext.org/generatedSecondModel If the missing GenModel has been generated via EMFGeneratorFragment or EcoreGeneratorFragment make sure to run it first in the workflow. If you have a *.genmodel-file, make sure to register it via StandaloneSetup.registerGenModelFile(String) at org.eclipse.xtext.generator.GenModelAccess.getGenModelResource(GenModelAccess.java:137) at org.eclipse.xtext.generator.GenModelAccess.getGenPackage(GenModelAccess.java:85)
  • 65. But when I run it…. // generates Java API for the generated EPackages fragment = ecore.EMFGeneratorFragment auto-inject {} Don’t forget the EMFGeneratorFragment [ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: Generator) java.lang.RuntimeException: Could not find a GenModel for EPackage 'http://www.xtext.org/ generatedSecondModel' from http://www.xtext.org/generatedSecondModel If the missing GenModel has been generated via EMFGeneratorFragment or EcoreGeneratorFragment make sure to run it first in the workflow. If you have a *.genmodel-file, make sure to register it via StandaloneSetup.registerGenModelFile(String) at org.eclipse.xtext.generator.GenModelAccess.getGenModelResource(GenModelAccess.java:137) at org.eclipse.xtext.generator.GenModelAccess.getGenPackage(GenModelAccess.java:85)
  • 66. There was nothing about Xbase so far…
  • 68. Wizard does crazy things…// automatically generated by Xtext grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals import "http://www.xtext.org/example/xbase" import "http://www.eclipse.org/xtext/common/JavaVMTypes" as types import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase import "http://www.eclipse.org/emf/2002/Ecore" as ecore MyClass returns MyClass: {MyClass} 'MyClass' '{' ('ref' ref=JvmTypeReference)? ('body' body=XBlockExpression)? '}'; JvmTypeReference returns types::JvmTypeReference: JvmParameterizedTypeReference_Impl | JvmGenericArrayTypeReference | JvmWildcardTypeReference | JvmAnyTypeReference | JvmMultiTypeReference | JvmDelegateTypeReference | JvmSynonymTypeReference | JvmUnknownTypeReference | JvmInnerTypeReference; XExpression returns xbase::XExpression: XIfExpression | XSwitchExpression | XBlockExpression | XVariableDeclaration | XMemberFeatureCall | XFeatureCall | XConstructorCall | XBooleanLiteral | XNullLiteral | XNumberLiteral | XStringLiteral | XListLiteral | XSetLiteral | XClosure | XCastedExpression | XBinaryOperation | XUnaryOperation | XPostfixOperation | XForLoopExpression | XBasicForLoopExpression | XDoWhileExpression | XWhileExpression | XTypeLiteral | XInstanceOfExpression | XThrowExpression | XTryCatchFinallyExpression | XAssignment | XReturnExpression | XSynchronizedExpression; JvmType returns types::JvmType: JvmVoid | JvmPrimitiveType | JvmArrayType | JvmTypeParameter | JvmAnnotationType | JvmEnumerationType | JvmGenericType; JvmTypeConstraint returns types::JvmTypeConstraint: JvmUpperBound | JvmLowerBound; JvmParameterizedTypeReference returns types::JvmParameterizedTypeReference: JvmParameterizedTypeReference_Impl | JvmInnerTypeReference; JvmMember returns types::JvmMember: JvmAnnotationType | JvmEnumerationType | JvmEnumerationLiteral | JvmGenericType | JvmField_Impl | JvmConstructor | JvmOperation; JvmAnnotationValue returns types::JvmAnnotationValue: JvmIntAnnotationValue | JvmBooleanAnnotationValue | JvmByteAnnotationValue | JvmShortAnnotationValue | JvmLongAnnotationValue | JvmDoubleAnnotationValue | JvmFloatAnnotationValue | JvmCharAnnotationValue | JvmStringAnnotationValue | JvmTypeAnnotationValue | JvmAnnotationAnnotationValue | JvmEnumAnnotationValue | JvmCustomAnnotationValue; JvmIdentifiableElement returns types::JvmIdentifiableElement: JvmVoid | JvmPrimitiveType | JvmArrayType | JvmTypeParameter | JvmAnnotationType | JvmEnumerationType | JvmEnumerationLiteral | JvmGenericType | JvmField_Impl | JvmConstructor | JvmOperation | JvmFormalParameter; XBlockExpression returns xbase::XBlockExpression: {xbase::XBlockExpression} 'XBlockExpression' '{' ('expressions' '{' expressions+=XExpression ( "," expressions+=XExpression)* '}' )? '}'; JvmParameterizedTypeReference_Impl returns types::JvmParameterizedTypeReference: {types::JvmParameterizedTypeReference} 'JvmParameterizedTypeReference' '{' ('type' type=[types::JvmType|EString])? ('arguments' '{' arguments+=JvmTypeReference ( "," arguments+=JvmTypeReference)* '}' )? '}'; JvmGenericArrayTypeReference returns types::JvmGenericArrayTypeReference: {types::JvmGenericArrayTypeReference} 'JvmGenericArrayTypeReference' '{' ('componentType' componentType=JvmTypeReference)? '}'; JvmWildcardTypeReference returns types::JvmWildcardTypeReference: {types::JvmWildcardTypeReference} 'JvmWildcardTypeReference' '{' ('constraints' '{' constraints+=JvmTypeConstraint ( "," constraints+=JvmTypeConstraint)* '}' )? '}'; JvmAnyTypeReference returns types::JvmAnyTypeReference: {types::JvmAnyTypeReference} 'JvmAnyTypeReference' '{' ('type' type=[types::JvmType|EString])? '}'; JvmMultiTypeReference returns types::JvmMultiTypeReference: {types::JvmMultiTypeReference} 'JvmMultiTypeReference' '{' ('type' type=[types::JvmType|EString])? ('references' '{' references+=JvmTypeReference ( "," references+=JvmTypeReference)* '}' )? '}'; JvmDelegateTypeReference returns types::JvmDelegateTypeReference: {types::JvmDelegateTypeReference} 'JvmDelegateTypeReference' '{' ('delegate' delegate=[types::JvmTypeReference|EString])? '}'; JvmSynonymTypeReference returns types::JvmSynonymTypeReference: {types::JvmSynonymTypeReference} 'JvmSynonymTypeReference' '{' ('type' type=[types::JvmType|EString])? ('references' '{' references+=JvmTypeReference ( "," references+=JvmTypeReference)* '}' )? '}'; JvmUnknownTypeReference returns types::JvmUnknownTypeReference: {types::JvmUnknownTypeReference} 'JvmUnknownTypeReference' ; JvmInnerTypeReference returns types::JvmInnerTypeReference: {types::JvmInnerTypeReference} 'JvmInnerTypeReference' '{' ('type' type=[types::JvmType|EString])? ('arguments' '{' arguments+=JvmTypeReference ( "," arguments+=JvmTypeReference)* '}' )? ('outer' outer=JvmParameterizedTypeReference)? '}'; JvmVoid returns types::JvmVoid: {types::JvmVoid} 'JvmVoid' ; JvmPrimitiveType returns types::JvmPrimitiveType: {types::JvmPrimitiveType} 'JvmPrimitiveType' '{' ('simpleName' simpleName=EString)? ('arrayType' arrayType=JvmArrayType)? '}'; JvmArrayType returns types::JvmArrayType: {types::JvmArrayType} 'JvmArrayType' '{' ('arrayType' arrayType=JvmArrayType)? '}'; JvmTypeParameter returns types::JvmTypeParameter: {types::JvmTypeParameter} 'JvmTypeParameter' name=EString '{' ('arrayType' arrayType=JvmArrayType)? ('constraints' '{' constraints+=JvmTypeConstraint ( "," constraints+=JvmTypeConstraint)* '}' )? '}'; JvmAnnotationType returns types::JvmAnnotationType: {types::JvmAnnotationType} (deprecated?='deprecated')? (abstract?='abstract')? (static?='static')? (final?='final')? 'JvmAnnotationType' '{' ('visibility' visibility=JvmVisibility)? ('simpleName' simpleName=EString)? ('packageName' packageName=EString)? ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('arrayType' arrayType=JvmArrayType)? ('superTypes' '{' superTypes+=JvmTypeReference ( "," superTypes+=JvmTypeReference)* '}' )? ('members' '{' members+=JvmMember ( "," members+=JvmMember)* '}' )? '}'; JvmEnumerationType returns types::JvmEnumerationType: {types::JvmEnumerationType} (deprecated?='deprecated')? (abstract?='abstract')? (static?='static')? (final?='final')? 'JvmEnumerationType' '{' ('visibility' visibility=JvmVisibility)? ('simpleName' simpleName=EString)? ('packageName' packageName=EString)? ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('arrayType' arrayType=JvmArrayType)? ('superTypes' '{' superTypes+=JvmTypeReference ( "," superTypes+=JvmTypeReference)* '}' )? ('members' '{' members+=JvmMember ( "," members+=JvmMember)* '}' )? '}'; JvmGenericType returns types::JvmGenericType: {types::JvmGenericType} (deprecated?='deprecated')? (abstract?='abstract')? (static?='static')? (final?='final')? (interface?='interface')? (strictFloatingPoint?='strictFloatingPoint')? (anonymous?='anonymous')? 'JvmGenericType' '{' ('visibility' visibility=JvmVisibility)? ('simpleName' simpleName=EString)? ('packageName' packageName=EString)? ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('arrayType' arrayType=JvmArrayType)? ('superTypes' '{' superTypes+=JvmTypeReference ( "," superTypes+=JvmTypeReference)* '}' )? ('members' '{' members+=JvmMember ( "," members+=JvmMember)* '}' )? ('typeParameters' '{' typeParameters+=JvmTypeParameter ( "," typeParameters+=JvmTypeParameter)* '}' )? '}'; EString returns ecore::EString: STRING | ID; JvmAnnotationReference returns types::JvmAnnotationReference: {types::JvmAnnotationReference} 'JvmAnnotationReference' '{' ('annotation' annotation=[types::JvmAnnotationType|EString])? ('explicitValues' '{' explicitValues+=JvmAnnotationValue ( "," explicitValues+=JvmAnnotationValue)* '}' )? '}'; enum JvmVisibility returns types::JvmVisibility: DEFAULT = 'DEFAULT' | PRIVATE = 'PRIVATE' | PROTECTED = 'PROTECTED' | PUBLIC = 'PUBLIC'; EBoolean returns ecore::EBoolean: 'true' | 'false'; JvmOperation returns types::JvmOperation: {types::JvmOperation} (deprecated?='deprecated')? (varArgs?='varArgs')? (static?='static')? (final?='final')? (abstract?='abstract')? (synchronized?='synchronized')? (default?='default')? (native?='native')? (strictFloatingPoint?='strictFloatingPoint')? 'JvmOperation' '{' ('visibility' visibility=JvmVisibility)? ('simpleName' simpleName=EString)? ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )? ('typeParameters' '{' typeParameters+=JvmTypeParameter ( "," typeParameters+=JvmTypeParameter)* '}' )? ('parameters' '{' parameters+=JvmFormalParameter ( "," parameters+=JvmFormalParameter)* '}' )? ('exceptions' '{' exceptions+=JvmTypeReference ( "," exceptions+=JvmTypeReference)* '}' )? ('returnType' returnType=JvmTypeReference)? ('defaultValue' defaultValue=JvmAnnotationValue)? '}'; JvmIntAnnotationValue returns types::JvmIntAnnotationValue: {types::JvmIntAnnotationValue} 'JvmIntAnnotationValue' '{' ('values' '{' values+=EInt ( "," values+=EInt)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmBooleanAnnotationValue returns types::JvmBooleanAnnotationValue: {types::JvmBooleanAnnotationValue} 'JvmBooleanAnnotationValue' '{' ('values' '{' values+=EBoolean ( "," values+=EBoolean)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmByteAnnotationValue returns types::JvmByteAnnotationValue: {types::JvmByteAnnotationValue} 'JvmByteAnnotationValue' '{' ('values' '{' values+=EByte ( "," values+=EByte)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmShortAnnotationValue returns types::JvmShortAnnotationValue: {types::JvmShortAnnotationValue} 'JvmShortAnnotationValue' '{' ('values' '{' values+=EShort ( "," values+=EShort)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmLongAnnotationValue returns types::JvmLongAnnotationValue: {types::JvmLongAnnotationValue} 'JvmLongAnnotationValue' '{' ('values' '{' values+=ELong ( "," values+=ELong)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmDoubleAnnotationValue returns types::JvmDoubleAnnotationValue: {types::JvmDoubleAnnotationValue} 'JvmDoubleAnnotationValue' '{' ('values' '{' values+=EDouble ( "," values+=EDouble)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmFloatAnnotationValue returns types::JvmFloatAnnotationValue: {types::JvmFloatAnnotationValue} 'JvmFloatAnnotationValue' '{' ('values' '{' values+=EFloat ( "," values+=EFloat)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmCharAnnotationValue returns types::JvmCharAnnotationValue: {types::JvmCharAnnotationValue} 'JvmCharAnnotationValue' '{' ('values' '{' values+=EChar ( "," values+=EChar)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmStringAnnotationValue returns types::JvmStringAnnotationValue: {types::JvmStringAnnotationValue} 'JvmStringAnnotationValue' '{' ('values' '{' values+=EString ( "," values+=EString)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmTypeAnnotationValue returns types::JvmTypeAnnotationValue: {types::JvmTypeAnnotationValue} 'JvmTypeAnnotationValue' '{' ('operation' operation=[types::JvmOperation|EString])? ('values' '{' values+=JvmTypeReference ( "," values+=JvmTypeReference)* '}' )? '}'; JvmAnnotationAnnotationValue returns types::JvmAnnotationAnnotationValue: {types::JvmAnnotationAnnotationValue} 'JvmAnnotationAnnotationValue' '{' ('operation' operation=[types::JvmOperation|EString])? ('values' '{' values+=JvmAnnotationReference ( "," values+=JvmAnnotationReference)* '}' )? '}'; JvmEnumAnnotationValue returns types::JvmEnumAnnotationValue: {types::JvmEnumAnnotationValue} 'JvmEnumAnnotationValue' '{' ('operation' operation=[types::JvmOperation|EString])? ('values' '(' values+=[types::JvmEnumerationLiteral|EString] ( "," values+=[types::JvmEnumerationLiteral|EString])* ')' )? '}'; JvmCustomAnnotationValue returns types::JvmCustomAnnotationValue: {types::JvmCustomAnnotationValue} 'JvmCustomAnnotationValue' '{' ('operation' operation=[types::JvmOperation|EString])? ('values' '(' values+=[ecore::EObject|EString] ( "," values+=[ecore::EObject|EString])* ')' )? '}'; JvmFormalParameter returns types::JvmFormalParameter: {types::JvmFormalParameter} 'JvmFormalParameter' name=EString '{' ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('parameterType' parameterType=JvmTypeReference)? '}'; EInt returns ecore::EInt: '-'? INT; EByte returns ecore::EByte: '-'? INT; EShort returns ecore::EShort: '-'? INT; ELong returns ecore::ELong: '-'? INT; EDouble returns ecore::EDouble: '-'? INT? '.' INT (('E'|'e') '-'? INT)?; EFloat returns ecore::EFloat: '-'? INT? '.' INT (('E'|'e') '-'? INT)?; EChar returns ecore::EChar: '-'? INT; JvmEnumerationLiteral returns types::JvmEnumerationLiteral: {types::JvmEnumerationLiteral} (deprecated?='deprecated')? (static?='static')? (final?='final')? (volatile?='volatile')? (transient?='transient')? (constant?='constant')? 'JvmEnumerationLiteral' '{' ('visibility' visibility=JvmVisibility)? ('simpleName' simpleName=EString)? ('constantValue' constantValue=EJavaObject)? ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )? ('type' type=JvmTypeReference)? '}'; EJavaObject returns ecore::EJavaObject: 'EJavaObject' /* TODO: implement this rule and an appropriate IValueConverter */; EObject returns ecore::EObject: {ecore::EObject} 'EObject' ; JvmField_Impl returns types::JvmField: {types::JvmField} (deprecated?='deprecated')? (static?='static')? (final?='final')? (volatile?='volatile')? (transient?='transient')? (constant?='constant')? 'JvmField' '{' ('visibility' visibility=JvmVisibility)? ('simpleName' simpleName=EString)? ('constantValue' constantValue=EJavaObject)? ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )? ('type' type=JvmTypeReference)? '}'; JvmConstructor returns types::JvmConstructor: {types::JvmConstructor} (deprecated?='deprecated')? (varArgs?='varArgs')? 'JvmConstructor' '{' ('visibility' visibility=JvmVisibility)? ('simpleName' simpleName=EString)? ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )? ('typeParameters' '{' typeParameters+=JvmTypeParameter ( "," typeParameters+=JvmTypeParameter)* '}' )? ('parameters' '{' parameters+=JvmFormalParameter ( "," parameters+=JvmFormalParameter)* '}' )? ('exceptions' '{' exceptions+=JvmTypeReference ( "," exceptions+=JvmTypeReference)* '}' )? '}'; JvmUpperBound returns types::JvmUpperBound: {types::JvmUpperBound} 'JvmUpperBound' '{' ('typeReference' typeReference=JvmTypeReference)? '}'; JvmLowerBound returns types::JvmLowerBound: {types::JvmLowerBound} 'JvmLowerBound' '{' ('typeReference' typeReference=JvmTypeReference)? '}'; XIfExpression returns xbase::XIfExpression: {xbase::XIfExpression} 'XIfExpression' '{' ('if' if=XExpression)? ('then' then=XExpression)? ('else' else=XExpression)? '}'; XSwitchExpression returns xbase::XSwitchExpression: {xbase::XSwitchExpression} 'XSwitchExpression' '{' ('switch' switch=XExpression)? ('cases' '{' cases+=XCasePart ( "," cases+=XCasePart)* '}' )? ('default' default=XExpression)? ('declaredParam' declaredParam=JvmFormalParameter)? '}'; XVariableDeclaration returns xbase::XVariableDeclaration: {xbase::XVariableDeclaration} (writeable?='writeable')? 'XVariableDeclaration' name=EString '{' ('type' type=JvmTypeReference)? ('right' right=XExpression)? '}'; XMemberFeatureCall returns xbase::XMemberFeatureCall: {xbase::XMemberFeatureCall} (explicitOperationCall?='explicitOperationCall')? (explicitStatic?='explicitStatic')? (nullSafe?='nullSafe')? 'XMemberFeatureCall' '{' ('feature' feature=[types::JvmIdentifiableElement|EString])? ('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )? ('memberCallTarget' memberCallTarget=XExpression)? ('memberCallArguments' '{' memberCallArguments+=XExpression ( "," memberCallArguments+=XExpression)* '}' )? '}'; XFeatureCall returns xbase::XFeatureCall: {xbase::XFeatureCall} (explicitOperationCall?='explicitOperationCall')? 'XFeatureCall' '{' ('feature' feature=[types::JvmIdentifiableElement|EString])? ('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )? ('featureCallArguments' '{' featureCallArguments+=XExpression ( "," featureCallArguments+=XExpression)* '}' )? '}'; XConstructorCall returns xbase::XConstructorCall: {xbase::XConstructorCall} (explicitConstructorCall?='explicitConstructorCall')? 'XConstructorCall' '{' ('constructor' constructor=[types::JvmConstructor|EString])? ('arguments' '{' arguments+=XExpression ( "," arguments+=XExpression)* '}' )? ('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )? '}'; XBooleanLiteral returns xbase::XBooleanLiteral: {xbase::XBooleanLiteral} (isTrue?='isTrue')? 'XBooleanLiteral' ; XNullLiteral returns xbase::XNullLiteral: {xbase::XNullLiteral} 'XNullLiteral' ; XNumberLiteral returns xbase::XNumberLiteral: {xbase::XNumberLiteral} 'XNumberLiteral' '{' ('value' value=EString)? '}'; XStringLiteral returns xbase::XStringLiteral: {xbase::XStringLiteral} 'XStringLiteral' '{' ('value' value=EString)? '}'; XListLiteral returns xbase::XListLiteral: {xbase::XListLiteral} 'XListLiteral' '{' ('elements' '{' elements+=XExpression ( "," elements+=XExpression)* '}' )? '}'; XSetLiteral returns xbase::XSetLiteral: {xbase::XSetLiteral} 'XSetLiteral' '{' ('elements' '{' elements+=XExpression ( "," elements+=XExpression)* '}' )? '}'; XClosure returns xbase::XClosure: {xbase::XClosure} (explicitSyntax?='explicitSyntax')? 'XClosure' '{' ('declaredFormalParameters' '{' declaredFormalParameters+=JvmFormalParameter ( "," declaredFormalParameters+=JvmFormalParameter)* '}' )? ('expression' expression=XExpression)? '}'; XCastedExpression returns xbase::XCastedExpression: {xbase::XCastedExpression} 'XCastedExpression' '{' ('type' type=JvmTypeReference)? ('target' target=XExpression)? '}'; XBinaryOperation returns xbase::XBinaryOperation: {xbase::XBinaryOperation} (reassignFirstArgument?='reassignFirstArgument')? 'XBinaryOperation' '{' ('feature' feature=[types::JvmIdentifiableElement|EString])? ('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )? ('leftOperand' leftOperand=XExpression)? ('rightOperand' rightOperand=XExpression)? '}'; XUnaryOperation returns xbase::XUnaryOperation: {xbase::XUnaryOperation} 'XUnaryOperation' '{' ('feature' feature=[types::JvmIdentifiableElement|EString])? ('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )? ('operand' operand=XExpression)? '}'; XPostfixOperation returns xbase::XPostfixOperation: {xbase::XPostfixOperation} 'XPostfixOperation' '{' ('feature' feature=[types::JvmIdentifiableElement|EString])? ('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )? ('operand' operand=XExpression)? '}'; XForLoopExpression returns xbase::XForLoopExpression: {xbase::XForLoopExpression} 'XForLoopExpression' '{' ('forExpression' forExpression=XExpression)? ('eachExpression' eachExpression=XExpression)? ('declaredParam' declaredParam=JvmFormalParameter)? '}'; XBasicForLoopExpression returns xbase::XBasicForLoopExpression: {xbase::XBasicForLoopExpression} 'XBasicForLoopExpression' '{' ('expression' expression=XExpression)? ('eachExpression' eachExpression=XExpression)? ('initExpressions' '{' initExpressions+=XExpression ( "," initExpressions+=XExpression)* '}' )? ('updateExpressions' '{' updateExpressions+=XExpression ( "," updateExpressions+=XExpression)* '}' )? '}'; XDoWhileExpression returns xbase::XDoWhileExpression: {xbase::XDoWhileExpression} 'XDoWhileExpression' '{' ('predicate' predicate=XExpression)? ('body' body=XExpression)? '}'; XWhileExpression returns xbase::XWhileExpression: {xbase::XWhileExpression} 'XWhileExpression' '{' ('predicate' predicate=XExpression)? ('body' body=XExpression)? '}'; XTypeLiteral returns xbase::XTypeLiteral: 'XTypeLiteral' '{' ('arrayDimensions' '{' arrayDimensions+=EString ( "," arrayDimensions+=EString)* '}' )? 'type' type=[types::JvmType|EString] '}'; XInstanceOfExpression returns xbase::XInstanceOfExpression: 'XInstanceOfExpression' '{' 'type' type=JvmTypeReference 'expression' expression=XExpression '}'; XThrowExpression returns xbase::XThrowExpression: {xbase::XThrowExpression} 'XThrowExpression' '{' ('expression' expression=XExpression)? '}'; XTryCatchFinallyExpression returns xbase::XTryCatchFinallyExpression: {xbase::XTryCatchFinallyExpression} 'XTryCatchFinallyExpression' '{' ('expression' expression=XExpression)? ('finallyExpression' finallyExpression=XExpression)? ('catchClauses' '{' catchClauses+=XCatchClause ( "," catchClauses+=XCatchClause)* '}' )? '}'; XAssignment returns xbase::XAssignment: {xbase::XAssignment} (explicitStatic?='explicitStatic')? 'XAssignment' '{' ('feature' feature=[types::JvmIdentifiableElement|EString])? ('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )? ('assignable' assignable=XExpression)? ('value' value=XExpression)? '}'; Rebuilds Xbase grammar without reusing it…
  • 69. Wizard does crazy things…// automatically generated by Xtext grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals import "http://www.xtext.org/example/xbase" import "http://www.eclipse.org/xtext/common/JavaVMTypes" as types import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase import "http://www.eclipse.org/emf/2002/Ecore" as ecore MyClass returns MyClass: {MyClass} 'MyClass' '{' ('ref' ref=JvmTypeReference)? ('body' body=XBlockExpression)? '}'; JvmTypeReference returns types::JvmTypeReference: JvmParameterizedTypeReference_Impl | JvmGenericArrayTypeReference | JvmWildcardTypeReference | JvmAnyTypeReference | JvmMultiTypeReference | JvmDelegateTypeReference | JvmSynonymTypeReference | JvmUnknownTypeReference | JvmInnerTypeReference; XExpression returns xbase::XExpression: XIfExpression | XSwitchExpression | XBlockExpression | XVariableDeclaration | XMemberFeatureCall | XFeatureCall | XConstructorCall | XBooleanLiteral | XNullLiteral | XNumberLiteral | XStringLiteral | XListLiteral | XSetLiteral | XClosure | XCastedExpression | XBinaryOperation | XUnaryOperation | XPostfixOperation | XForLoopExpression | XBasicForLoopExpression | XDoWhileExpression | XWhileExpression | XTypeLiteral | XInstanceOfExpression | XThrowExpression | XTryCatchFinallyExpression | XAssignment | XReturnExpression | XSynchronizedExpression; JvmType returns types::JvmType: JvmVoid | JvmPrimitiveType | JvmArrayType | JvmTypeParameter | JvmAnnotationType | JvmEnumerationType | JvmGenericType; JvmTypeConstraint returns types::JvmTypeConstraint: JvmUpperBound | JvmLowerBound; JvmParameterizedTypeReference returns types::JvmParameterizedTypeReference: JvmParameterizedTypeReference_Impl | JvmInnerTypeReference; JvmMember returns types::JvmMember: JvmAnnotationType | JvmEnumerationType | JvmEnumerationLiteral | JvmGenericType | JvmField_Impl | JvmConstructor | JvmOperation; JvmAnnotationValue returns types::JvmAnnotationValue: JvmIntAnnotationValue | JvmBooleanAnnotationValue | JvmByteAnnotationValue | JvmShortAnnotationValue | JvmLongAnnotationValue | JvmDoubleAnnotationValue | JvmFloatAnnotationValue | JvmCharAnnotationValue | JvmStringAnnotationValue | JvmTypeAnnotationValue | JvmAnnotationAnnotationValue | JvmEnumAnnotationValue | JvmCustomAnnotationValue; JvmIdentifiableElement returns types::JvmIdentifiableElement: JvmVoid | JvmPrimitiveType | JvmArrayType | JvmTypeParameter | JvmAnnotationType | JvmEnumerationType | JvmEnumerationLiteral | JvmGenericType | JvmField_Impl | JvmConstructor | JvmOperation | JvmFormalParameter; XBlockExpression returns xbase::XBlockExpression: {xbase::XBlockExpression} 'XBlockExpression' '{' ('expressions' '{' expressions+=XExpression ( "," expressions+=XExpression)* '}' )? '}'; JvmParameterizedTypeReference_Impl returns types::JvmParameterizedTypeReference: {types::JvmParameterizedTypeReference} 'JvmParameterizedTypeReference' '{' ('type' type=[types::JvmType|EString])? ('arguments' '{' arguments+=JvmTypeReference ( "," arguments+=JvmTypeReference)* '}' )? '}'; JvmGenericArrayTypeReference returns types::JvmGenericArrayTypeReference: {types::JvmGenericArrayTypeReference} 'JvmGenericArrayTypeReference' '{' ('componentType' componentType=JvmTypeReference)? '}'; JvmWildcardTypeReference returns types::JvmWildcardTypeReference: {types::JvmWildcardTypeReference} 'JvmWildcardTypeReference' '{' ('constraints' '{' constraints+=JvmTypeConstraint ( "," constraints+=JvmTypeConstraint)* '}' )? '}'; JvmAnyTypeReference returns types::JvmAnyTypeReference: {types::JvmAnyTypeReference} 'JvmAnyTypeReference' '{' ('type' type=[types::JvmType|EString])? '}'; JvmMultiTypeReference returns types::JvmMultiTypeReference: {types::JvmMultiTypeReference} 'JvmMultiTypeReference' '{' ('type' type=[types::JvmType|EString])? ('references' '{' references+=JvmTypeReference ( "," references+=JvmTypeReference)* '}' )? '}'; JvmDelegateTypeReference returns types::JvmDelegateTypeReference: {types::JvmDelegateTypeReference} 'JvmDelegateTypeReference' '{' ('delegate' delegate=[types::JvmTypeReference|EString])? '}'; JvmSynonymTypeReference returns types::JvmSynonymTypeReference: {types::JvmSynonymTypeReference} 'JvmSynonymTypeReference' '{' ('type' type=[types::JvmType|EString])? ('references' '{' references+=JvmTypeReference ( "," references+=JvmTypeReference)* '}' )? '}'; JvmUnknownTypeReference returns types::JvmUnknownTypeReference: {types::JvmUnknownTypeReference} 'JvmUnknownTypeReference' ; JvmInnerTypeReference returns types::JvmInnerTypeReference: {types::JvmInnerTypeReference} 'JvmInnerTypeReference' '{' ('type' type=[types::JvmType|EString])? ('arguments' '{' arguments+=JvmTypeReference ( "," arguments+=JvmTypeReference)* '}' )? ('outer' outer=JvmParameterizedTypeReference)? '}'; JvmVoid returns types::JvmVoid: {types::JvmVoid} 'JvmVoid' ; JvmPrimitiveType returns types::JvmPrimitiveType: {types::JvmPrimitiveType} 'JvmPrimitiveType' '{' ('simpleName' simpleName=EString)? ('arrayType' arrayType=JvmArrayType)? '}'; JvmArrayType returns types::JvmArrayType: {types::JvmArrayType} 'JvmArrayType' '{' ('arrayType' arrayType=JvmArrayType)? '}'; JvmTypeParameter returns types::JvmTypeParameter: {types::JvmTypeParameter} 'JvmTypeParameter' name=EString '{' ('arrayType' arrayType=JvmArrayType)? ('constraints' '{' constraints+=JvmTypeConstraint ( "," constraints+=JvmTypeConstraint)* '}' )? '}'; JvmAnnotationType returns types::JvmAnnotationType: {types::JvmAnnotationType} (deprecated?='deprecated')? (abstract?='abstract')? (static?='static')? (final?='final')? 'JvmAnnotationType' '{' ('visibility' visibility=JvmVisibility)? ('simpleName' simpleName=EString)? ('packageName' packageName=EString)? ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('arrayType' arrayType=JvmArrayType)? ('superTypes' '{' superTypes+=JvmTypeReference ( "," superTypes+=JvmTypeReference)* '}' )? ('members' '{' members+=JvmMember ( "," members+=JvmMember)* '}' )? '}'; JvmEnumerationType returns types::JvmEnumerationType: {types::JvmEnumerationType} (deprecated?='deprecated')? (abstract?='abstract')? (static?='static')? (final?='final')? 'JvmEnumerationType' '{' ('visibility' visibility=JvmVisibility)? ('simpleName' simpleName=EString)? ('packageName' packageName=EString)? ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('arrayType' arrayType=JvmArrayType)? ('superTypes' '{' superTypes+=JvmTypeReference ( "," superTypes+=JvmTypeReference)* '}' )? ('members' '{' members+=JvmMember ( "," members+=JvmMember)* '}' )? '}'; JvmGenericType returns types::JvmGenericType: {types::JvmGenericType} (deprecated?='deprecated')? (abstract?='abstract')? (static?='static')? (final?='final')? (interface?='interface')? (strictFloatingPoint?='strictFloatingPoint')? (anonymous?='anonymous')? 'JvmGenericType' '{' ('visibility' visibility=JvmVisibility)? ('simpleName' simpleName=EString)? ('packageName' packageName=EString)? ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('arrayType' arrayType=JvmArrayType)? ('superTypes' '{' superTypes+=JvmTypeReference ( "," superTypes+=JvmTypeReference)* '}' )? ('members' '{' members+=JvmMember ( "," members+=JvmMember)* '}' )? ('typeParameters' '{' typeParameters+=JvmTypeParameter ( "," typeParameters+=JvmTypeParameter)* '}' )? '}'; EString returns ecore::EString: STRING | ID; JvmAnnotationReference returns types::JvmAnnotationReference: {types::JvmAnnotationReference} 'JvmAnnotationReference' '{' ('annotation' annotation=[types::JvmAnnotationType|EString])? ('explicitValues' '{' explicitValues+=JvmAnnotationValue ( "," explicitValues+=JvmAnnotationValue)* '}' )? '}'; enum JvmVisibility returns types::JvmVisibility: DEFAULT = 'DEFAULT' | PRIVATE = 'PRIVATE' | PROTECTED = 'PROTECTED' | PUBLIC = 'PUBLIC'; EBoolean returns ecore::EBoolean: 'true' | 'false'; JvmOperation returns types::JvmOperation: {types::JvmOperation} (deprecated?='deprecated')? (varArgs?='varArgs')? (static?='static')? (final?='final')? (abstract?='abstract')? (synchronized?='synchronized')? (default?='default')? (native?='native')? (strictFloatingPoint?='strictFloatingPoint')? 'JvmOperation' '{' ('visibility' visibility=JvmVisibility)? ('simpleName' simpleName=EString)? ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )? ('typeParameters' '{' typeParameters+=JvmTypeParameter ( "," typeParameters+=JvmTypeParameter)* '}' )? ('parameters' '{' parameters+=JvmFormalParameter ( "," parameters+=JvmFormalParameter)* '}' )? ('exceptions' '{' exceptions+=JvmTypeReference ( "," exceptions+=JvmTypeReference)* '}' )? ('returnType' returnType=JvmTypeReference)? ('defaultValue' defaultValue=JvmAnnotationValue)? '}'; JvmIntAnnotationValue returns types::JvmIntAnnotationValue: {types::JvmIntAnnotationValue} 'JvmIntAnnotationValue' '{' ('values' '{' values+=EInt ( "," values+=EInt)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmBooleanAnnotationValue returns types::JvmBooleanAnnotationValue: {types::JvmBooleanAnnotationValue} 'JvmBooleanAnnotationValue' '{' ('values' '{' values+=EBoolean ( "," values+=EBoolean)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmByteAnnotationValue returns types::JvmByteAnnotationValue: {types::JvmByteAnnotationValue} 'JvmByteAnnotationValue' '{' ('values' '{' values+=EByte ( "," values+=EByte)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmShortAnnotationValue returns types::JvmShortAnnotationValue: {types::JvmShortAnnotationValue} 'JvmShortAnnotationValue' '{' ('values' '{' values+=EShort ( "," values+=EShort)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmLongAnnotationValue returns types::JvmLongAnnotationValue: {types::JvmLongAnnotationValue} 'JvmLongAnnotationValue' '{' ('values' '{' values+=ELong ( "," values+=ELong)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmDoubleAnnotationValue returns types::JvmDoubleAnnotationValue: {types::JvmDoubleAnnotationValue} 'JvmDoubleAnnotationValue' '{' ('values' '{' values+=EDouble ( "," values+=EDouble)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmFloatAnnotationValue returns types::JvmFloatAnnotationValue: {types::JvmFloatAnnotationValue} 'JvmFloatAnnotationValue' '{' ('values' '{' values+=EFloat ( "," values+=EFloat)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmCharAnnotationValue returns types::JvmCharAnnotationValue: {types::JvmCharAnnotationValue} 'JvmCharAnnotationValue' '{' ('values' '{' values+=EChar ( "," values+=EChar)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmStringAnnotationValue returns types::JvmStringAnnotationValue: {types::JvmStringAnnotationValue} 'JvmStringAnnotationValue' '{' ('values' '{' values+=EString ( "," values+=EString)* '}' )? ('operation' operation=[types::JvmOperation|EString])? '}'; JvmTypeAnnotationValue returns types::JvmTypeAnnotationValue: {types::JvmTypeAnnotationValue} 'JvmTypeAnnotationValue' '{' ('operation' operation=[types::JvmOperation|EString])? ('values' '{' values+=JvmTypeReference ( "," values+=JvmTypeReference)* '}' )? '}'; JvmAnnotationAnnotationValue returns types::JvmAnnotationAnnotationValue: {types::JvmAnnotationAnnotationValue} 'JvmAnnotationAnnotationValue' '{' ('operation' operation=[types::JvmOperation|EString])? ('values' '{' values+=JvmAnnotationReference ( "," values+=JvmAnnotationReference)* '}' )? '}'; JvmEnumAnnotationValue returns types::JvmEnumAnnotationValue: {types::JvmEnumAnnotationValue} 'JvmEnumAnnotationValue' '{' ('operation' operation=[types::JvmOperation|EString])? ('values' '(' values+=[types::JvmEnumerationLiteral|EString] ( "," values+=[types::JvmEnumerationLiteral|EString])* ')' )? '}'; JvmCustomAnnotationValue returns types::JvmCustomAnnotationValue: {types::JvmCustomAnnotationValue} 'JvmCustomAnnotationValue' '{' ('operation' operation=[types::JvmOperation|EString])? ('values' '(' values+=[ecore::EObject|EString] ( "," values+=[ecore::EObject|EString])* ')' )? '}'; JvmFormalParameter returns types::JvmFormalParameter: {types::JvmFormalParameter} 'JvmFormalParameter' name=EString '{' ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('parameterType' parameterType=JvmTypeReference)? '}'; EInt returns ecore::EInt: '-'? INT; EByte returns ecore::EByte: '-'? INT; EShort returns ecore::EShort: '-'? INT; ELong returns ecore::ELong: '-'? INT; EDouble returns ecore::EDouble: '-'? INT? '.' INT (('E'|'e') '-'? INT)?; EFloat returns ecore::EFloat: '-'? INT? '.' INT (('E'|'e') '-'? INT)?; EChar returns ecore::EChar: '-'? INT; JvmEnumerationLiteral returns types::JvmEnumerationLiteral: {types::JvmEnumerationLiteral} (deprecated?='deprecated')? (static?='static')? (final?='final')? (volatile?='volatile')? (transient?='transient')? (constant?='constant')? 'JvmEnumerationLiteral' '{' ('visibility' visibility=JvmVisibility)? ('simpleName' simpleName=EString)? ('constantValue' constantValue=EJavaObject)? ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )? ('type' type=JvmTypeReference)? '}'; EJavaObject returns ecore::EJavaObject: 'EJavaObject' /* TODO: implement this rule and an appropriate IValueConverter */; EObject returns ecore::EObject: {ecore::EObject} 'EObject' ; JvmField_Impl returns types::JvmField: {types::JvmField} (deprecated?='deprecated')? (static?='static')? (final?='final')? (volatile?='volatile')? (transient?='transient')? (constant?='constant')? 'JvmField' '{' ('visibility' visibility=JvmVisibility)? ('simpleName' simpleName=EString)? ('constantValue' constantValue=EJavaObject)? ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )? ('type' type=JvmTypeReference)? '}'; JvmConstructor returns types::JvmConstructor: {types::JvmConstructor} (deprecated?='deprecated')? (varArgs?='varArgs')? 'JvmConstructor' '{' ('visibility' visibility=JvmVisibility)? ('simpleName' simpleName=EString)? ('annotations' '{' annotations+=JvmAnnotationReference ( "," annotations+=JvmAnnotationReference)* '}' )? ('localClasses' '{' localClasses+=JvmGenericType ( "," localClasses+=JvmGenericType)* '}' )? ('typeParameters' '{' typeParameters+=JvmTypeParameter ( "," typeParameters+=JvmTypeParameter)* '}' )? ('parameters' '{' parameters+=JvmFormalParameter ( "," parameters+=JvmFormalParameter)* '}' )? ('exceptions' '{' exceptions+=JvmTypeReference ( "," exceptions+=JvmTypeReference)* '}' )? '}'; JvmUpperBound returns types::JvmUpperBound: {types::JvmUpperBound} 'JvmUpperBound' '{' ('typeReference' typeReference=JvmTypeReference)? '}'; JvmLowerBound returns types::JvmLowerBound: {types::JvmLowerBound} 'JvmLowerBound' '{' ('typeReference' typeReference=JvmTypeReference)? '}'; XIfExpression returns xbase::XIfExpression: {xbase::XIfExpression} 'XIfExpression' '{' ('if' if=XExpression)? ('then' then=XExpression)? ('else' else=XExpression)? '}'; XSwitchExpression returns xbase::XSwitchExpression: {xbase::XSwitchExpression} 'XSwitchExpression' '{' ('switch' switch=XExpression)? ('cases' '{' cases+=XCasePart ( "," cases+=XCasePart)* '}' )? ('default' default=XExpression)? ('declaredParam' declaredParam=JvmFormalParameter)? '}'; XVariableDeclaration returns xbase::XVariableDeclaration: {xbase::XVariableDeclaration} (writeable?='writeable')? 'XVariableDeclaration' name=EString '{' ('type' type=JvmTypeReference)? ('right' right=XExpression)? '}'; XMemberFeatureCall returns xbase::XMemberFeatureCall: {xbase::XMemberFeatureCall} (explicitOperationCall?='explicitOperationCall')? (explicitStatic?='explicitStatic')? (nullSafe?='nullSafe')? 'XMemberFeatureCall' '{' ('feature' feature=[types::JvmIdentifiableElement|EString])? ('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )? ('memberCallTarget' memberCallTarget=XExpression)? ('memberCallArguments' '{' memberCallArguments+=XExpression ( "," memberCallArguments+=XExpression)* '}' )? '}'; XFeatureCall returns xbase::XFeatureCall: {xbase::XFeatureCall} (explicitOperationCall?='explicitOperationCall')? 'XFeatureCall' '{' ('feature' feature=[types::JvmIdentifiableElement|EString])? ('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )? ('featureCallArguments' '{' featureCallArguments+=XExpression ( "," featureCallArguments+=XExpression)* '}' )? '}'; XConstructorCall returns xbase::XConstructorCall: {xbase::XConstructorCall} (explicitConstructorCall?='explicitConstructorCall')? 'XConstructorCall' '{' ('constructor' constructor=[types::JvmConstructor|EString])? ('arguments' '{' arguments+=XExpression ( "," arguments+=XExpression)* '}' )? ('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )? '}'; XBooleanLiteral returns xbase::XBooleanLiteral: {xbase::XBooleanLiteral} (isTrue?='isTrue')? 'XBooleanLiteral' ; XNullLiteral returns xbase::XNullLiteral: {xbase::XNullLiteral} 'XNullLiteral' ; XNumberLiteral returns xbase::XNumberLiteral: {xbase::XNumberLiteral} 'XNumberLiteral' '{' ('value' value=EString)? '}'; XStringLiteral returns xbase::XStringLiteral: {xbase::XStringLiteral} 'XStringLiteral' '{' ('value' value=EString)? '}'; XListLiteral returns xbase::XListLiteral: {xbase::XListLiteral} 'XListLiteral' '{' ('elements' '{' elements+=XExpression ( "," elements+=XExpression)* '}' )? '}'; XSetLiteral returns xbase::XSetLiteral: {xbase::XSetLiteral} 'XSetLiteral' '{' ('elements' '{' elements+=XExpression ( "," elements+=XExpression)* '}' )? '}'; XClosure returns xbase::XClosure: {xbase::XClosure} (explicitSyntax?='explicitSyntax')? 'XClosure' '{' ('declaredFormalParameters' '{' declaredFormalParameters+=JvmFormalParameter ( "," declaredFormalParameters+=JvmFormalParameter)* '}' )? ('expression' expression=XExpression)? '}'; XCastedExpression returns xbase::XCastedExpression: {xbase::XCastedExpression} 'XCastedExpression' '{' ('type' type=JvmTypeReference)? ('target' target=XExpression)? '}'; XBinaryOperation returns xbase::XBinaryOperation: {xbase::XBinaryOperation} (reassignFirstArgument?='reassignFirstArgument')? 'XBinaryOperation' '{' ('feature' feature=[types::JvmIdentifiableElement|EString])? ('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )? ('leftOperand' leftOperand=XExpression)? ('rightOperand' rightOperand=XExpression)? '}'; XUnaryOperation returns xbase::XUnaryOperation: {xbase::XUnaryOperation} 'XUnaryOperation' '{' ('feature' feature=[types::JvmIdentifiableElement|EString])? ('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )? ('operand' operand=XExpression)? '}'; XPostfixOperation returns xbase::XPostfixOperation: {xbase::XPostfixOperation} 'XPostfixOperation' '{' ('feature' feature=[types::JvmIdentifiableElement|EString])? ('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )? ('operand' operand=XExpression)? '}'; XForLoopExpression returns xbase::XForLoopExpression: {xbase::XForLoopExpression} 'XForLoopExpression' '{' ('forExpression' forExpression=XExpression)? ('eachExpression' eachExpression=XExpression)? ('declaredParam' declaredParam=JvmFormalParameter)? '}'; XBasicForLoopExpression returns xbase::XBasicForLoopExpression: {xbase::XBasicForLoopExpression} 'XBasicForLoopExpression' '{' ('expression' expression=XExpression)? ('eachExpression' eachExpression=XExpression)? ('initExpressions' '{' initExpressions+=XExpression ( "," initExpressions+=XExpression)* '}' )? ('updateExpressions' '{' updateExpressions+=XExpression ( "," updateExpressions+=XExpression)* '}' )? '}'; XDoWhileExpression returns xbase::XDoWhileExpression: {xbase::XDoWhileExpression} 'XDoWhileExpression' '{' ('predicate' predicate=XExpression)? ('body' body=XExpression)? '}'; XWhileExpression returns xbase::XWhileExpression: {xbase::XWhileExpression} 'XWhileExpression' '{' ('predicate' predicate=XExpression)? ('body' body=XExpression)? '}'; XTypeLiteral returns xbase::XTypeLiteral: 'XTypeLiteral' '{' ('arrayDimensions' '{' arrayDimensions+=EString ( "," arrayDimensions+=EString)* '}' )? 'type' type=[types::JvmType|EString] '}'; XInstanceOfExpression returns xbase::XInstanceOfExpression: 'XInstanceOfExpression' '{' 'type' type=JvmTypeReference 'expression' expression=XExpression '}'; XThrowExpression returns xbase::XThrowExpression: {xbase::XThrowExpression} 'XThrowExpression' '{' ('expression' expression=XExpression)? '}'; XTryCatchFinallyExpression returns xbase::XTryCatchFinallyExpression: {xbase::XTryCatchFinallyExpression} 'XTryCatchFinallyExpression' '{' ('expression' expression=XExpression)? ('finallyExpression' finallyExpression=XExpression)? ('catchClauses' '{' catchClauses+=XCatchClause ( "," catchClauses+=XCatchClause)* '}' )? '}'; XAssignment returns xbase::XAssignment: {xbase::XAssignment} (explicitStatic?='explicitStatic')? 'XAssignment' '{' ('feature' feature=[types::JvmIdentifiableElement|EString])? ('typeArguments' '{' typeArguments+=JvmTypeReference ( "," typeArguments+=JvmTypeReference)* '}' )? ('assignable' assignable=XExpression)? ('value' value=XExpression)? '}'; Generator wrongly configured
  • 72. I am missing the Maven part…
  • 73. https://github.com/holgerschill/XtextCon_Xcore_Maven A full working example can be found here Tycho Xtext Maven Plugin Exec-Maven-Plugin Xtend Maven Plugin
  • 75. Pittfalls Right dependencies to generate Java out of Xcore <dependencies> <dependency> <groupId>org.osgi</groupId> <artifactId>org.osgi.core</artifactId> <version>4.3.1</version> </dependency> <dependency> <groupId>org.eclipse.core</groupId> <artifactId>org.eclipse.core.resources</artifactId> <version>3.7.100</version> </dependency> <dependency> <groupId>org.eclipse.text</groupId> <artifactId>org.eclipse.text</artifactId> <version>3.5.101</version> </dependency> <dependency> <groupId>org.eclipse.emf</groupId> <artifactId>org.eclipse.emf.codegen.ecore.xtext</artifactId> <version>${ecore-xtext-version}</version> </dependency> <dependency> <groupId>org.eclipse.emf</groupId> <artifactId>org.eclipse.emf.ecore.xcore.lib</artifactId> <version>${ecore-xcore-lib-version}</version> </dependency> <dependency> <groupId>org.eclipse.emf</groupId> <artifactId>org.eclipse.emf.ecore.xcore</artifactId> <version>${ecore-xcore-version}</version> </dependency> </dependencies>
  • 76. Pittfalls Set modelDirectory in Xcore files explicitly @GenModel(modelDirectory="./src-gen") package org.xtext.example.myfirstdsl import common.NamedElement import common.Referenceable class FirstElement extends NamedElement, Referenceable { refers Referenceable ref }
  • 77. Pittfalls Don’t use classpath URIs in MWE2 var fileExtensions = "first" var projectName = "org.xtext.example.firstdsl.lang" var runtimeProject = "../${projectName}" var generateXtendStub = true //var grammarURI = "classpath:/org/xtext/example/firstdsl/Lang.xtext" var grammarURI = "platform:/resource/${projectName}/src/org/xtext/example/firstdsl/Lang.xtext"
  • 78. Pittfalls Explicitly set path to generate Java classes // generates Java API for the generated EPackages fragment = ecore.EMFGeneratorFragment auto-inject { javaModelDirectory = "/${projectName}/src-gen" }