Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » I lost my arithmetics ;)
I lost my arithmetics ;) [message #1758698] Fri, 31 March 2017 17:55 Go to next message
Rodrigo Ruiz is currently offline Rodrigo RuizFriend
Messages: 28
Registered: March 2017
Junior Member
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 18:13 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: I lost my arithmetics ;) [message #1758702 is a reply to message #1758701] Fri, 31 March 2017 18:21 Go to previous message
Rodrigo Ruiz is currently offline Rodrigo RuizFriend
Messages: 28
Registered: March 2017
Junior Member
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: Tue Apr 16 08:42:44 GMT 2024

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

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

Back to the top