Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Use Tab and Enter for Scobe
Use Tab and Enter for Scobe [message #1036476] Mon, 08 April 2013 08:40 Go to next message
Eclipse UserFriend
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 09:05 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Use Tab and Enter for Scobe [message #1037046 is a reply to message #1036497] Tue, 09 April 2013 01:48 Go to previous message
Eclipse UserFriend
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 03:21] by 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: Mon Jul 07 18:59:51 EDT 2025

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

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

Back to the top