Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Use Tab and Enter for Scobe
Use Tab and Enter for Scobe [message #1036476] Mon, 08 April 2013 12:40 Go to next message
junior developer is currently offline junior developerFriend
Messages: 354
Registered: January 2013
Senior Member
Hi all ,

Is it possible install meaning to tab and enter? Let's say i push enter button and begin scoping of a component then i write that components property with tab(indent). When i push enter,scoping of that component should finish so may i use enter instead of curly brackets.i want write a grammar without curly brackets.

For Example:Defined A in the language, b is defined under the A (A'scoping is fineshed when B's scoping is stared)

Element A //started A's scoping
b //b is in the A's scoping
Element B //star B's scoping and A's scoping is finished
c

Best regards;
Re: Use Tab and Enter for Scobe [message #1036497 is a reply to message #1036476] Mon, 08 April 2013 13:05 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

if I understand your question correctly

Model: elements+=Element*;

Element: 'Element' name=ID
  children+=Child*
;

Child: name=ID;


should do what you are looking for in the easy case. Curly brackets are not necessary for "nesting", they only make it much easier in many cases.

If tabulators are significant in your language, it becomes a bit more complicated as white spaces is something Xtext does not care about by default. However, there are examples for languages where indentation plays a role (e.g. http://www.eclipse.org/forums/index.php/mv/msg/174823/556885/)

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Use Tab and Enter for Scobe [message #1037046 is a reply to message #1036497] Tue, 09 April 2013 05:48 Go to previous message
junior developer is currently offline junior developerFriend
Messages: 354
Registered: January 2013
Senior Member
Hi Alexander,
Yes I wanted to learn exact to it .Example have been very helpful for me but source code is not found githup.com. Thank you very much

Best regards

[Updated on: Tue, 09 April 2013 07:21]

Report message to a moderator

Previous Topic:Why there is an additional .smap file when code are automatically generated?
Next Topic:Path expressions with dot and imports/packages
Goto Forum:
  


Current Time: Tue Apr 16 23:01:58 GMT 2024

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

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

Back to the top