[XPAND] Generating More Than One Instance [message #808859] |
Tue, 28 February 2012 03:23  |
Eclipse User |
|
|
|
Hi,
I have some problems about generating more than one instance elements.
I have 3 distinct instance "input" elements in my model. I want to generate a file and put all instance element's name in it. For example:
Sample.txt:
input1
input2
input3
Unfortunally I see only one of them in my generated files with these codes:
Xtext file:
main:
(input+=Input|output+=Output)*
Input:
'Input' name=ID ';' ;
Output:
'Output' name=ID ';';
Template file:
«IMPORT org::xtext::example::mydsl2::myDsl»
«EXTENSION templates::Extensions»
«DEFINE main FOR Input»
«FOREACH ((main)eContainer()).input AS in»
«FOREACH ((main)eContainer()).output AS out»
«FILE name+".txt"»
This is an example of a generated file.
«in.name»
«out.name»
«ENDFILE-»
«ENDDEFINE»
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04543 seconds