Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext returns statement(Xtext returns statement)
Xtext returns statement [message #1732058] Thu, 12 May 2016 10:28 Go to next message
RamaRao Nandamuri is currently offline RamaRao NandamuriFriend
Messages: 120
Registered: April 2016
Senior Member
Model: {Model} NL* statements+=Statement*;

If {Model} is not there then I am getting error like

The rule 'Model' may be consumed without object
instantiation. Add an action to ensure object creation, e.g.
'{Model}'.
Why it is can explain?

Statement returns Statement: If|Switch;

What is returns Statement do here?

Can anybody tell me?
Re: Xtext returns statement [message #1732059 is a reply to message #1732058] Thu, 12 May 2016 10:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13193
Registered: July 2009
Senior Member
the returns statement tells which is the returntype. e.g. you could have 2 different rules returning the same return type.

with an unassigend action you can do two things

- force the creation of a subtype

e.g

Parent: {Subtype1} "st1" name=ID | {Subtype2} "st2" name=ID;

or force the creation of an eobject even if no attributes are assigned (xtext by default creates object only if the have at least one assignment

StringType: {StringType}"string";

in your case

Statement returns Statement: If|Switch;

the returns Statement is not necessary


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext returns statement [message #1732061 is a reply to message #1732059] Thu, 12 May 2016 10:47 Go to previous message
RamaRao Nandamuri is currently offline RamaRao NandamuriFriend
Messages: 120
Registered: April 2016
Senior Member
Thanks
Previous Topic:Not allowing empty lines at beginning of the page
Next Topic:P2 update site for latest builds broken?
Goto Forum:
  


Current Time: Sat Nov 16 02:41:40 GMT 2019

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

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

Back to the top