Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext Error Message
Xtext Error Message [message #881784] Tue, 05 June 2012 08:46 Go to next message
Hans-Georg Glöckler is currently offline Hans-Georg GlöcklerFriend
Messages: 88
Registered: July 2009
Member
I have in my grammar redefined XBase.
I want that the ';' in Xbase is necessary.

XBlockExpression returns XExpression: 
{XBlockExpression}
'{'
(expressions+=XExpressionInsideBlock ';')*
'}';


In Runtime I get now the following error.

!STACK 0
java.lang.IllegalArgumentException: Type computation is not implemented for org.lunifera.metamodel.dsl.entity.entity.impl.XBlockExpressionImpl@6ec5b02e
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider._type(AbstractTypeProvider.java:283)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider.type(AbstractTypeProvider.java:321)
at org.eclipse.xtext.xbase.typing.XbaseTypeProvider.type(XbaseTypeProvider.java:188)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider$2.doComputation(AbstractTypeProvider.java:290)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider$2.doComputation(AbstractTypeProvider.java:1)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider$CyclicHandlingSupport$3.get(AbstractTypeProvider.java:627)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider$CyclicHandlingSupport$3.get(AbstractTypeProvider.java:1)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider$1.get(AbstractTypeProvider.java:158)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider$CyclicHandlingSupport.getType(AbstractTypeProvider.java:624)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider.doGetType(AbstractTypeProvider.java:346)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider.getType(AbstractTypeProvider.java:362)
at org.eclipse.xtext.xbase.typing.AbstractTypeProvider.getType(AbstractTypeProvider.java:354)
at org.eclipse.xtext.xbase.validation.XbaseJavaValidator.checkImplicitReturn(XbaseJavaValidator.java:419)
at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.xtext.validation.AbstractDeclarativeValidator$MethodWrapper.invoke(AbstractDeclarativeValidator.java:109)
at org.eclipse.xtext.validation.AbstractDeclarativeValidator.internalValidate(AbstractDeclarativeValidator.java:291)
at org.eclipse.xtext.validation.AbstractInjectableValidator.validate(AbstractInjectableValidator.java:62)
at org.eclipse.xtext.validation.CompositeEValidator.validate(CompositeEValidator.java:126)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:165)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:143)
at org.eclipse.xtext.validation.CancelableDiagnostician.validate(CancelableDiagnostician.java:36)
at org.eclipse.emf.ecore.util.Diagnostician.doValidateContents(Diagnostician.java:184)
at org.eclipse.xtext.validation.CancelableDiagnostician.doValidateContents(CancelableDiagnostician.java:48)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:168)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:143)
at org.eclipse.xtext.validation.CancelableDiagnostician.validate(CancelableDiagnostician.java:36)
at org.eclipse.emf.ecore.util.Diagnostician.doValidateContents(Diagnostician.java:184)
at org.eclipse.xtext.validation.CancelableDiagnostician.doValidateContents(CancelableDiagnostician.java:48)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:168)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:143)
at org.eclipse.xtext.validation.CancelableDiagnostician.validate(CancelableDiagnostician.java:36)
at org.eclipse.emf.ecore.util.Diagnostician.doValidateContents(Diagnostician.java:184)
at org.eclipse.xtext.validation.CancelableDiagnostician.doValidateContents(CancelableDiagnostician.java:48)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:168)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:143)
at org.eclipse.xtext.validation.CancelableDiagnostician.validate(CancelableDiagnostician.java:36)
at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:126)
at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:108)
at org.eclipse.xtext.ui.validation.DefaultResourceUIValidatorExtension.addMarkers(DefaultResourceUIValidatorExtension.java:65)
at org.eclipse.xtext.ui.validation.DefaultResourceUIValidatorExtension.updateValidationMarkers(DefaultResourceUIValidatorExtension.java:44)
at org.eclipse.xtext.builder.builderState.MarkerUpdaterImpl.updateMarker(MarkerUpdaterImpl.java:56)
at org.eclipse.xtext.builder.builderState.AbstractBuilderState.updateMarkers(AbstractBuilderState.java:76)
at org.eclipse.xtext.builder.clustering.ClusteringBuilderState.doUpdate(ClusteringBuilderState.java:268)
at org.eclipse.xtext.builder.builderState.AbstractBuilderState.update(AbstractBuilderState.java:107)
at org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBuilder.java:158)
at org.eclipse.xtext.builder.impl.XtextBuilder.incrementalBuild(XtextBuilder.java:141)
at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:91)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Re: Xtext Error Message [message #881797 is a reply to message #881784] Tue, 05 June 2012 09:11 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3108
Registered: July 2009
Senior Member
You probably meant to use

xbase::XExpression and xbase::XBlockExpression

I assume that your grammar inferred new types with the very same name.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 05.06.12 10:46, schrieb hans-georg Mising name:
> I have in my grammar redefined XBase.
> I want that the ';' in Xbase is necessary.
>
>
> XBlockExpression returns XExpression: {XBlockExpression}
> '{'
> (expressions+=XExpressionInsideBlock ';')*
> '}';
>
>
> In Runtime I get now the following error.
>
> !STACK 0
> java.lang.IllegalArgumentException: Type computation is not implemented
> for
> mailto:org.lunifera.metamodel.dsl.entity.entity.impl.XBlockExpressionImpl@6ec5b02e
>
> at
> org.eclipse.xtext.xbase.typing.AbstractTypeProvider._type(AbstractTypeProvider.java:283)
>
> at
> org.eclipse.xtext.xbase.typing.AbstractTypeProvider.type(AbstractTypeProvider.java:321)
>
> at
> org.eclipse.xtext.xbase.typing.XbaseTypeProvider.type(XbaseTypeProvider.java:188)
>
> at
> org.eclipse.xtext.xbase.typing.AbstractTypeProvider$2.doComputation(AbstractTypeProvider.java:290)
>
> at
> org.eclipse.xtext.xbase.typing.AbstractTypeProvider$2.doComputation(AbstractTypeProvider.java:1)
>
> at
> org.eclipse.xtext.xbase.typing.AbstractTypeProvider$CyclicHandlingSupport$3.get(AbstractTypeProvider.java:627)
>
> at
> org.eclipse.xtext.xbase.typing.AbstractTypeProvider$CyclicHandlingSupport$3.get(AbstractTypeProvider.java:1)
>
> at
> org.eclipse.xtext.xbase.typing.AbstractTypeProvider$1.get(AbstractTypeProvider.java:158)
>
> at
> org.eclipse.xtext.xbase.typing.AbstractTypeProvider$CyclicHandlingSupport.getType(AbstractTypeProvider.java:624)
>
> at
> org.eclipse.xtext.xbase.typing.AbstractTypeProvider.doGetType(AbstractTypeProvider.java:346)
>
> at
> org.eclipse.xtext.xbase.typing.AbstractTypeProvider.getType(AbstractTypeProvider.java:362)
>
> at
> org.eclipse.xtext.xbase.typing.AbstractTypeProvider.getType(AbstractTypeProvider.java:354)
>
> at
> org.eclipse.xtext.xbase.validation.XbaseJavaValidator.checkImplicitReturn(XbaseJavaValidator.java:419)
>
> at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.eclipse.xtext.validation.AbstractDeclarativeValidator$MethodWrapper.invoke(AbstractDeclarativeValidator.java:109)
>
> at
> org.eclipse.xtext.validation.AbstractDeclarativeValidator.internalValidate(AbstractDeclarativeValidator.java:291)
>
> at
> org.eclipse.xtext.validation.AbstractInjectableValidator.validate(AbstractInjectableValidator.java:62)
>
> at
> org.eclipse.xtext.validation.CompositeEValidator.validate(CompositeEValidator.java:126)
>
> at
> org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:165)
> at
> org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:143)
> at
> org.eclipse.xtext.validation.CancelableDiagnostician.validate(CancelableDiagnostician.java:36)
>
> at
> org.eclipse.emf.ecore.util.Diagnostician.doValidateContents(Diagnostician.java:184)
>
> at
> org.eclipse.xtext.validation.CancelableDiagnostician.doValidateContents(CancelableDiagnostician.java:48)
>
> at
> org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:168)
> at
> org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:143)
> at
> org.eclipse.xtext.validation.CancelableDiagnostician.validate(CancelableDiagnostician.java:36)
>
> at
> org.eclipse.emf.ecore.util.Diagnostician.doValidateContents(Diagnostician.java:184)
>
> at
> org.eclipse.xtext.validation.CancelableDiagnostician.doValidateContents(CancelableDiagnostician.java:48)
>
> at
> org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:168)
> at
> org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:143)
> at
> org.eclipse.xtext.validation.CancelableDiagnostician.validate(CancelableDiagnostician.java:36)
>
> at
> org.eclipse.emf.ecore.util.Diagnostician.doValidateContents(Diagnostician.java:184)
>
> at
> org.eclipse.xtext.validation.CancelableDiagnostician.doValidateContents(CancelableDiagnostician.java:48)
>
> at
> org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:168)
> at
> org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:143)
> at
> org.eclipse.xtext.validation.CancelableDiagnostician.validate(CancelableDiagnostician.java:36)
>
> at
> org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:126)
> at
> org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:108)
>
> at
> org.eclipse.xtext.ui.validation.DefaultResourceUIValidatorExtension.addMarkers(DefaultResourceUIValidatorExtension.java:65)
>
> at
> org.eclipse.xtext.ui.validation.DefaultResourceUIValidatorExtension.updateValidationMarkers(DefaultResourceUIValidatorExtension.java:44)
>
> at
> org.eclipse.xtext.builder.builderState.MarkerUpdaterImpl.updateMarker(MarkerUpdaterImpl.java:56)
>
> at
> org.eclipse.xtext.builder.builderState.AbstractBuilderState.updateMarkers(AbstractBuilderState.java:76)
>
> at
> org.eclipse.xtext.builder.clustering.ClusteringBuilderState.doUpdate(ClusteringBuilderState.java:268)
>
> at
> org.eclipse.xtext.builder.builderState.AbstractBuilderState.update(AbstractBuilderState.java:107)
>
> at
> org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBuilder.java:158)
> at
> org.eclipse.xtext.builder.impl.XtextBuilder.incrementalBuild(XtextBuilder.java:141)
>
> at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:91)
> at
> org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
>
> at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
>
> at
> org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at
> org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
>
> at
> org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
>
> at
> org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
> at
> org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
>
> at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
>
Re: Xtext Error Message [message #881806 is a reply to message #881797] Tue, 05 June 2012 09:28 Go to previous messageGo to next message
Hans-Georg Glöckler is currently offline Hans-Georg GlöcklerFriend
Messages: 88
Registered: July 2009
Member
No, my grammar don't inferred new types with the same name.


grammar org.lunifera.metamodel.dsl.entity.Entity with org.eclipse.xtext.xbase.Xbase

generate entity "http://www.lunifera.org/metamodel/dsl/entity/Entity"

EntityModel:
	package=PackageDeclaration & elements+=AbstractElement*;

PackageDeclaration:
	'package' name=QualifiedName ';';

AbstractElement:
	Import | Entity;

Import:
	'import' importedNamespace=QualifiedNameWithWildCard ';';

Entity:
	'entity' name=ValidID ('extends' superType=JvmParameterizedTypeReference)? '{'
	features+=Feature*
	'}';

Feature:
	Property | Operation;

Property:
	(modifier=Modifier)? (refType=RefType)? (varType='var'|'ref') type=JvmTypeReference name=ValidID ';';

Operation:
	(modifier=Modifier)? 'def' type=JvmTypeReference name=ValidID '(' (params+=FullJvmFormalParameter (',' params+=FullJvmFormalParameter)*)?
	')'
	body=XBlockExpression;

Modifier:
	final?='final'? & static?='static'? & visibility=Visibility;

enum Visibility:
	PACKAGE='package' | PRIVATE='private' | PROTECTED='protected' | PUBLIC='public';

enum RefType:
	CONTAIN='contain' | EMBEDDED='embedded';

QualifiedNameWithWildCard:
	QualifiedName ('.' '*')?;

XBlockExpression returns XExpression:
	{XBlockExpression}
	'{'
	(expressions+=XExpressionInsideBlock ';')*
	'}';
Re: Xtext Error Message [message #881813 is a reply to message #881806] Tue, 05 June 2012 09:41 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3108
Registered: July 2009
Senior Member
Hans,

you'll have to import the xbase model if you refer to types like
XExpression or XBlockExpression. Please look into the ecore file for
your EPackage to find an EClass XExpression and XBlockExpression.
Ctrl+Shift+T in Eclipse will reveal these classes in your project, too.

So the short answer: Yes, your grammar inferrs new types with the same name.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 05.06.12 11:28, schrieb hans-georg Mising name:
> No, my grammar don't inferred new types with the same name.
>
>
> grammar org.lunifera.metamodel.dsl.entity.Entity with
> org.eclipse.xtext.xbase.Xbase
>
> generate entity "http://www.lunifera.org/metamodel/dsl/entity/Entity"
>
> EntityModel:
> package=PackageDeclaration & elements+=AbstractElement*;
>
> PackageDeclaration:
> 'package' name=QualifiedName ';';
>
> AbstractElement:
> Import | Entity;
>
> Import:
> 'import' importedNamespace=QualifiedNameWithWildCard ';';
>
> Entity:
> 'entity' name=ValidID ('extends'
> superType=JvmParameterizedTypeReference)? '{'
> features+=Feature*
> '}';
>
> Feature:
> Property | Operation;
>
> Property:
> (modifier=Modifier)? (refType=RefType)? (varType='var'|'ref')
> type=JvmTypeReference name=ValidID ';';
>
> Operation:
> (modifier=Modifier)? 'def' type=JvmTypeReference name=ValidID '('
> (params+=FullJvmFormalParameter (',' params+=FullJvmFormalParameter)*)?
> ')'
> body=XBlockExpression;
>
> Modifier:
> final?='final'? & static?='static'? & visibility=Visibility;
>
> enum Visibility:
> PACKAGE='package' | PRIVATE='private' | PROTECTED='protected' |
> PUBLIC='public';
>
> enum RefType:
> CONTAIN='contain' | EMBEDDED='embedded';
>
> QualifiedNameWithWildCard:
> QualifiedName ('.' '*')?;
>
> XBlockExpression returns XExpression:
> {XBlockExpression}
> '{'
> (expressions+=XExpressionInsideBlock ';')*
> '}';
>
Re: Xtext Error Message [message #881817 is a reply to message #881813] Tue, 05 June 2012 09:49 Go to previous message
Hans-Georg Glöckler is currently offline Hans-Georg GlöcklerFriend
Messages: 88
Registered: July 2009
Member
Thanks, I understand.
Have a lot of thanks.
Previous Topic:Resolve External References
Next Topic:Problems since recent update (2.3 RC1)?
Goto Forum:
  


Current Time: Fri Oct 30 23:02:34 GMT 2020

Powered by FUDForum. Page generated in 0.02163 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top