Not quite understanding how x-referencing works [message #1456947] |
Thu, 30 October 2014 18:06  |
Eclipse User |
|
|
|
Hi,
I'm new to Xtext (and compilers apparently) and I am trying to parse a DSL with the following relevant piece of grammar:
Architecture:
(components+=Component)+
(connectors+=Connector)*;
Component:
'component' name=ID ':' namespace=PackageName;
Connector:
from=[Component|ID]( '=>' to=[Component|ID]);
The files written in this DSL parse fine, with the exception of Connector.from and Connector.to not being resolved. In other words
architecture.getConnectors().get(0).getFrom()
returns null!
All this is done in a standalone (non-Eclipse) application. To parse I inject org.eclipse.xtext.parser.IParser and I set it up with createInjectorAndDoEMFRegistration() and injectMembers(), the exact same way as it is done in Approach 1 in Dave Hoffman's blog (the forum won't let me post the hyperlink, sorry :/ ).
Am I missing something really obvious here? How come references from within the same file aren't resolved? Can anyone please help?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05757 seconds