Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » one file extension, multiple sub-grammars(or grammars w/o root element)
one file extension, multiple sub-grammars [message #1355860] Wed, 14 May 2014 22:45
Andriy Gerasika is currently offline Andriy GerasikaFriend
Messages: 1
Registered: May 2014
Junior Member
A question somewhat similar to stackoverflow.com/questions/16831139/xtext-multiple-files-language

The problem is that DSL sub-dialect is specified using folder/file name, there is no root element, i.e:

recipes/recipe1.txt
borsch = {
some stuff
ingredients = { apple }
}

fruits/fruit1.txt
apple = {
color = { green yellow red }
}

There is no root element to use --> folder/file name is the root element

Is there any way to somehow make xtext pass folder or file name to grammar? So I could write something like:

Model: [if parent_folder="recipes"] Recipe | [if parent_folder="fruits"] Fruit;
Recipe: ...;
Fruit: ...;

Thanks
Previous Topic:Cross Referencing Problem
Next Topic:xtext builder hangs eclipse on unrelated changes
Goto Forum:
  


Current Time: Wed Sep 23 11:04:01 GMT 2020

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

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

Back to the top