Hi!
This is my first attempt at Xtext.
Here is the grammar I built:
grammar com.x.x.x.XxxDsl with org.eclipse.xtext.common.Terminals
generate xxxDsl "...www.x.x.x.com/xxx/xtext/XxxDsl"
Root:
catalogs+=Catalog*
instances+=Instance*
;
Catalog returns Catalog:
'Catalog' name=ID
'{'
models+=Model*
'}'
;
Model returns Model:
'Model' name=ID
;
Instance returns Instance:
'Instance'
name=ID
'of'
model=[Model]
;
And here is my text:
Catalog myCatalog
{
Model meteo
Model storm
}
Instance wintermeteo of meteo
Instance strongstorm of storm
The 2 last lines are in error, `meteo` and `storm` being marked with:
Couldn't resolve reference to Model 'meteo'/'storm'
If I change my grammar so that the Models are directly in Root (and not inside Catalogs anymore) and update the text accordingly, then the models are correctly recognized.
What did I do wrong? Thanks