[SOLVED] Cannot cross reference element composed of multiple IDs [message #1754414] |
Fri, 17 February 2017 13:16 |
Tam Gom Messages: 36 Registered: July 2011 |
Member |
|
|
Hi all,
I have two DSLs. In the first, I'm defining services, and in the second I would like to reference them.
The code I intend to achieve looks like this:
service org.myapp.MyService {
...
}
The service name is something like a fully qualified name where at least two segments are mandatory.
Here's the relevant part of my grammar:
ServiceName:
ID ('.' ID)*
;
ServiceDeclaration:
'service' name = ServiceName '{'
...
'}'
;
Now, in the second DSL I would like to create a cross reference to the ServiceDeclaration:
The grammar with which I describe this is the following:
Host:
'host' service = [service::ServiceDeclaration]
;
That being said, I get the following error in my second DSL:
Quote:Couldn't resolve reference to ContractDeclaration 'org'.
From this it seems only the first segment is getting recognized, but if I write
in my second DSL, the error is still thrown.
Also, if I put the Host definition into my first DSL's grammar, it works fine. Of course doing this is impossible with my requirements.
Does anyone have some insights what's wrong with my grammars and how I could make them work?
Thank you.
[Updated on: Mon, 20 February 2017 08:22] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03194 seconds