Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » cross reference issue across multiple grammars
cross reference issue across multiple grammars [message #1701934] Thu, 16 July 2015 21:40 Go to next message
Siva Gaddam is currently offline Siva GaddamFriend
Messages: 22
Registered: June 2015
Junior Member
I'm trying hard to get cross referencing work fine across multiple grammars.

Grammar 1: (de)
spec element_name text

Grammar 2:(Profile)
Rid:
entityName='RID' name=INTID '{' (attributes+=(RidAttribute | ProfileAttribute))* '}'
;

RidAttribute:
(RidBidAttribute | RidPcrAttribute | RidAltAuthRidAttribute )
;

RidBidAttribute:
attributeName='bid' ':' bid=[Bid|INTID]
;

RidPcrAttribute:
attributeName='pcr' ':' pcr=[Pcr|INTID]
;

RidAltAuthRidAttribute:
attributeName='alt_auth_rid' ':' '{' altAuthRid+=[AltRid|INTID] (',' altAuthRid+=[AltRid|INTID])* '}'
;

Grammar 3: (Rules) --> // Both grammar 2 and grammar 1 are referenced and imported
RidExpression:
'RID' '(' left=[de::DataElement] ')' '->' (right=[profile::RidAttribute])
;

PcrExpression:
'PCR' '(' left=[de::DataElement] ')' '->' (right=[profile::PcrAttribute])
;


When I'm trying to write spec using grammar#3 as below. I end up having "could not reference to Rid Attribute"

RID (test_data_element) -> rid_attribute // rid_attribute is not resolved.

I really appreciate any help.

Re: cross reference issue across multiple grammars [message #1701946 is a reply to message #1701934] Fri, 17 July 2015 04:16 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
The grammar you posted is incomplete (how is pcrattribute and ridattribute defined)
Asume you have a typo
How does the qualified name provider of grammar 2 look like? Your attributes have no names and are not indexed and therefore cannot be referenced.
Use the open model element dialog to see what is indexed


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:How to represent EBNF rule A - B (matches any string that matches A but does not match B)
Next Topic:Rename Refactoring also rename Files
Goto Forum:
  


Current Time: Fri Apr 26 05:23:46 GMT 2024

Powered by FUDForum. Page generated in 0.02653 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top