Skip to main content



      Home
Home » Modeling » TMF (Xtext) » completion proposal not work for nested XExpression
completion proposal not work for nested XExpression [message #1408280] Thu, 14 August 2014 12:58
Eclipse UserFriend
I want to extend the entity definition language from Xtext documentation(Five simple steps to your JVM language) as:

entity e{
	firstName : String
	op setFirstName(String firstName) : void{
		checker:{name!=null} ⇐
		this.firstName = firstName.toFirstLower
	}
}


where "checker" is a customized expression and "{name!=null}" is a nested XExpression.
To do this, I append following to grammar:
XPrimaryExpression returns xbase::XExpression:
	XConstructorCall |
	XBlockExpression |
	XSwitchExpression |
	XSynchronizedExpression |
	XFeatureCall |
	XLiteral |
	XIfExpression |
	XForLoopExpression |
	XBasicForLoopExpression |
	XWhileExpression |
	XDoWhileExpression |
	XThrowExpression |
	XReturnExpression |
	XTryCatchFinallyExpression |
	XParenthesizedExpression |
	MyChecker 
;
MyChecker:
	'checker' ':' expression = XBlockExpression



I also implement the TypeComputer for MyChecker to avoid 'Missing type computation' exception.

But it seems that the completion proposal not work in 'checker:{ | }', expression contained in MyChecker rule can't reference it's outer scope.

Thanks very much.
Previous Topic:XTend integration within maven
Next Topic:How to call a model from another model
Goto Forum:
  


Current Time: Thu Jul 10 05:45:21 EDT 2025

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

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

Back to the top