我正在尝试扩展XCore语言。 为此,我在Eclipse Oxygen中创建了一个新的XText项目。这里是Xtext文件:
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.emf.ecore.xcore.Xcore
generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"
Model:
pack=XExpression
;
在清单文件中,我向Xcore v.1.5添加了一个依赖项。
最后,将MWE2文件插入int,添加以下行:
component = XtextGenerator {
[...]
language = StandardLanguage {
[...]
referencedResource = "platform:/resource/org.eclipse.emf.ecore.xcore/model/Xcore.genmodel"
[...]
}
}
但是,执行MWE2工作流程时出现以下错误:
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.emf.ecore.impl.EReferenceImpl@5734eaa7 (name: null) (ordered: true, unique: true, lowerBound: 0, upperBound: 1) (changeable: true, volatile: false, transient: false, defaultValueLiteral: null, unsettable: false, derived: false) (containment: false, resolveProxies: true)' is not legal. (platform:/resource/org.xtext.example.mydsl/model/generated/MyDsl.genmodel, 10, 129)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.emf.ecore.impl.EReferenceImpl@5734eaa7 (name: null) (ordered: true, unique: true, lowerBound: 0, upperBound: 1) (changeable: true, volatile: false, transient: false, defaultValueLiteral: null, unsettable: false, derived: false) (containment: false, resolveProxies: true)' is not legal. (platform:/resource/org.xtext.example.mydsl/model/generated/MyDsl.genmodel, 10, 129)
Caused by: java.lang.ClassCastException: The value of type 'org.eclipse.emf.ecore.impl.EClassImpl@5abca1e0 (name: EReference) (instanceClassName: null) (abstract: false, interface: false)' must be of type 'org.eclipse.emf.ecore.impl.EClassImpl@5ecba515 (name: EStructuralFeature) (instanceClassName: null) (abstract: true, interface: false)'
我测试过的东西