Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Keep the Grammar structure same as before saving the file(Keep the Grammar structure same as before saving the file)
Keep the Grammar structure same as before saving the file [message #1806731] Tue, 14 May 2019 13:21
Nagashree KN is currently offline Nagashree KNFriend
Messages: 20
Registered: September 2018
Junior Member
Hi,

I am facing problem in the Structure of the Grammar. on saving the xtext editor (runtime) , Grammar format is changing. it is displaying the grammar in 1 line. How i can retain the grammar structure same ,before and after saving the file.
My grammar is given below-

grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals

import "http://www.eclipse.org/sirius/sample/basicfamily"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore

Family returns Family:
{Family}
'Family{'
name=EString
('members{' members+=Person ( "," members+=Person)* '}' )?
'}';

Person returns Person:
Man | Woman;

EString returns ecore::EString:
STRING | ID;

Man returns Man:
{Man}
'Man{'
name=EString
('children{' children+=[Person|EString] ( "," children+=
[Person|EString])* '}' )?
('parents{' parents+=[Person|EString] ( "," parents+=
[Person|EString])* '}' )?
'}';

Woman returns Woman:
{Woman}
'Woman{'
name=EString
('children{' children+=[Person|EString] ( "," children+=
[Person|EString])* '}' )?
('parents{' parents+=[Person|EString] ( "," parents+=
[Person|EString])* '}' )?
'}';
And i have attached some screenshots.

Please help i how to solve.
Previous Topic:How to add cascading content assist in xtext
Next Topic:Serializing Instances based on the Domainmodel (15 minutes tutorial)
Goto Forum:
  


Current Time: Wed Nov 20 20:36:55 GMT 2019

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

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

Back to the top