Skip to main content



      Home
Home » Modeling » TMF (Xtext) » I lost my arithmetics ;)
I lost my arithmetics ;) [message #1758698] Fri, 31 March 2017 13:55 Go to next message
Eclipse UserFriend
Hi guys,
i'm implementing a very basic grammar, extending xbase, but when doing so i lost all arithmetic operations (!).
Would you be so kind to take a look at my (probably messed up) grammar and see if you spot the issue?
grammar cityfox.CLang with org.eclipse.xtext.xbase.Xbase

generate cLang "http://www.CLang.cit"

Model:
	'pack'  name=QualifiedName
	(imports+=XImportSection)*
	(sections+=Section)*;

Section:
	 Command |Method
;	
	
Command returns Section:
	{Command} 'Command' 
	name=ID  
				arguments=ArgDefinition? 
				('require' '['
				              (requires+=RequireExpression)*
				']')?
				(block=XBlockExpression)
;

RequireExpression:
	type=JvmTypeReference name=ID ':' kind=('threaded'|'service' )
;

Method returns Section:
	{Method} 'def' type=JvmTypeReference name=ID args=ArgDefinition (block=XBlockExpression)?
	;

ArgDefinition:
	{ArgDefinition}'(' (args+=Argument (',' args+=Argument)*)? ')'
;
Argument:
	type=JvmTypeReference name=ID
;


when typing simple XExpressions like
val a=1+2

i get: "+ cannot be resolved"

Any tip is very appreciated.
Regards
Re: I lost my arithmetics ;) [message #1758701 is a reply to message #1758698] Fri, 31 March 2017 14:13 Go to previous messageGo to next message
Eclipse UserFriend
this might have todo with that you do in your inferrer. so: what do you do in your inferrer.
and is your project with the dsl file a java project. and has it xbase.lib on the classpath
Re: I lost my arithmetics ;) [message #1758702 is a reply to message #1758701] Fri, 31 March 2017 14:21 Go to previous message
Eclipse UserFriend
thanks! adding the .lib in the cp solved the issue.
Much appreciated!
Previous Topic:Hyperlink to external file
Next Topic:Scope for custom XVariableDeclaration
Goto Forum:
  


Current Time: Wed Jul 02 22:20:54 EDT 2025

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

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

Back to the top