Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Cross-reference problem.
Cross-reference problem. [message #642143] Tue, 30 November 2010 05:12 Go to next message
No real name is currently offline No real nameFriend
Messages: 101
Registered: August 2010
Senior Member
If I have a grammar like this:

HLMModel	:
			'module' name=ID '(' (inputs+=ID (',' inputs+=ID)*)? ')' 
				('returns' '(' (outputs+=ID (',' outputs+=ID)*) ')')? '{'
				startup=Startup
				(states+=MyState)+
			'}' 
			;
			
Startup		:
			'startup' '{' nextState=[MyState] '}' ;

MyState :
		'state' name=ID '{' 'next' '=' nextState=[MyState] '}';


and an example like this:

module T() {
startup {a}
state a { next = b}
state b { next = a}
} 


The cross-referencing to the State doesn't seem to work. However, if I change my HLMModel rule by commenting out the 'module' part, i.e.,

HLMModel	:
//			'module' name=ID '(' (inputs+=ID (',' inputs+=ID)*)? ')' 
//				('returns' '(' (outputs+=ID (',' outputs+=ID)*) ')')? '{'
				startup=Startup
				(states+=MyState)+
			'}' 
			;


Then, cross-referencing works OK. What am I doing wrong in the above grammar? Thank you for any ideas.
Re: Cross-reference problem. [message #642185 is a reply to message #642143] Tue, 30 November 2010 09:59 Go to previous messageGo to next message
Meinte Boersma is currently offline Meinte BoersmaFriend
Messages: 434
Registered: July 2009
Location: Leiden, Netherlands
Senior Member
Have you got the SimpleNamesFragment or the QualifiedNamesFragment configured in your .mwe2 workflow file? I'm betting on the latter Wink

Re: Cross-reference problem. [message #642311 is a reply to message #642185] Tue, 30 November 2010 18:29 Go to previous message
No real name is currently offline No real nameFriend
Messages: 101
Registered: August 2010
Senior Member
Hi,

Thank you for your help. I had enabled SimpleNamesFragment. By disabling that, and enabling QualifiedNamesFragment, it works nicely now!

Thanks.
Previous Topic:Performance of saving a XtextResource
Next Topic:Insert Automatic NewLine After 80 character In editor Xtext
Goto Forum:
  


Current Time: Thu Apr 25 00:25:18 GMT 2024

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

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

Back to the top