Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Rule is treated as Uncalled rule even if called
Rule is treated as Uncalled rule even if called [message #1280937] Mon, 31 March 2014 05:42 Go to next message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
I have 2 xtext files:

Rule1.xtext is the main grammar file.
grammer org.Rule1 with org.Rule2
generate rule1 "http://www.Rule1.org"
Model:
  def+=Test*
;

Test:
  Hello | Goodbye
;

Hello:
  'Hi' name=ID greet=Greeting
;

Goodbye:
  'Bye' name=ID close=Closing '!'
;


Rule2.xtext
grammar org.Rule2 with org.eclipse.xtext.common.Terminals
generate rule2 "http://www.Rule2.org"

Greeting:
 'HOW' 'ARE' 'YOU' '?' name=ID
;

Closing:
'SEE' 'YOU' 'AGAIN' name=ID '!'
;


I am wondering why the rule Closing is in gray (uncalled rule) even if it is being called in rule1.xtext..?
Re: Rule is treated as Uncalled rule even if called [message #1280948 is a reply to message #1280937] Mon, 31 March 2014 06:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
It is not called since you do NOT use the with clause.

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Rule is treated as Uncalled rule even if called [message #1280959 is a reply to message #1280948] Mon, 31 March 2014 06:34 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
So do not care since the rule is abstract by your semantics

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Rule is treated as Uncalled rule even if called [message #1280968 is a reply to message #1280959] Mon, 31 March 2014 06:54 Go to previous messageGo to next message
chris yo is currently offline chris yoFriend
Messages: 146
Registered: February 2013
Senior Member
Hi Christian,

I am using the with clause in both the grammar file.
Rule1.xtext --> grammer org.Rule1 with org.Rule2
Rule2.xtext --> grammar org.Rule2 with org.eclipse.xtext.common.Terminals

I do not want the rule to be in gray if it is called, because this will make it hard for me to debug later. Is there a way not to make it abstract?
Re: Rule is treated as Uncalled rule even if called [message #1281005 is a reply to message #1280968] Mon, 31 March 2014 08:01 Go to previous message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
seen from your Rule2.xtext only, closing is not called.
In it's scope, xtext is not aware that this grammar is used with Rule1.xtext grammar
Re: Rule is treated as Uncalled rule even if called [message #1281007 is a reply to message #1280968] Mon, 31 March 2014 08:00 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi Xtext cannot check all grammars in the world if your grammar is
subclassed somewhere

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Dual License with EPL and Apache 2.0
Next Topic:User-defined reusable type of properties and enumerations in "library" models
Goto Forum:
  


Current Time: Fri Apr 19 11:10:33 GMT 2024

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

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

Back to the top