one file extension, multiple sub-grammars [message #1355860] |
Wed, 14 May 2014 18:45 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03038 seconds