[Help me] broken cross-reference error [message #665902] |
Mon, 18 April 2011 05:17 |
|
I use a simple grammar like this,
Model:
(elements += Element ';')*
;
Element :
Def
| Use
;
Def :
'def' name = ID
;
Use :
'use' def = [Def]
;
and the case is following,
def var;
use var;
It works well.
But when the "def var" is deleted, an exception will be thrown out (the version of xtext i use is: 1.0.0.v201006170321 )
java.lang.ClassCastException: org.xtext.example.mydsl12.myDsl.impl.UseImpl cannot be cast to org.xtext.example.mydsl12.myDsl.Def
at org.xtext.example.mydsl12.myDsl.impl.UseImpl.getDef(UseImpl. java:75)
at org.xtext.example.mydsl12.myDsl.impl.UseImpl.eGet(UseImpl.ja va:119)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1021)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:1013)
at org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImp l.hasNext(EContentsEList.java:409)
at org.eclipse.xtext.EcoreUtil2.resolveCrossReferences(EcoreUti l2.java:485)
at org.eclipse.xtext.EcoreUtil2.resolveAll(EcoreUtil2.java:469)
at org.eclipse.xtext.validation.ResourceValidatorImpl.resolvePr oxies(ResourceValidatorImpl.java:122)
at org.eclipse.xtext.validation.ResourceValidatorImpl.validate( ResourceValidatorImpl.java:60)
at org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec( ValidationJob.java:76)
at org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec( ValidationJob.java:1)
at org.eclipse.xtext.util.concurrent.IStateAccess$AbstractImpl. readOnly(IStateAccess.java:40)
at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(Xte xtDocument.java:58)
at org.eclipse.xtext.ui.editor.validation.ValidationJob.createI ssues(ValidationJob.java:74)
at org.eclipse.xtext.ui.editor.validation.ValidationJob.run(Val idationJob.java:63)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03820 seconds