|Help with recursive grammar [message #1792431]
||Tue, 17 July 2018 22:08
| Jean Macena
Registered: July 2018
Hello, guys. I would first like to apologize for my English (I am not a native English speaker).|
I'm looking at Xtext to create a model of a scheme from an xml file. I was able to extract the xml's structure using Ruby with the gem Nokogiri. Now I have a txt file that tells me all the attributes and types of xml tags. I need to transform this file into a model that follows the attached image.
However, when trying to generate the nested structure I need I'm getting the error:
"decision can match input such as "'is'" using multiple alternatives: 1, 2
As a result, alternative (s) 2 were disabled for that input"
I saw this topic: https://www.eclipse.org/forums/index.php/t/1094040/
And it helps, but I feel like I can not really apply my situation.
My code so far:
Model: releaseSet += ClinVarSet*;
'is' 'child' 'ClinVarSet' 'id' Number=ID (children+=Child)*
'is' GranChild 'child' Name=ID ('contentTag' Type+=TypeName)* (children+=Child)*
name = ID
name = ID
This is what I would like to do:
And this is my steps so far:
Step 1 - Get the xml
Step 2 - Extract xml's structure
Step 3 - Create a grama for generates model with the result from Step 2
Thanks a lot.
Powered by FUDForum
. Page generated in 0.06617 seconds