[Xtext 2.8] : Cross-references howto with indexed references [message #1516489] |
Thu, 18 December 2014 23:07 |
|
Hi,
If my language allows writing the qualified name of a reference like this :
The qualified name can't be defined as a terminal.
As a result, it must be handled by a parser rules set involving those of expressions.
Nevertheless, xtext demands these rules are data type rules. They aren't.
What to do in this case ?
Thanks a lot if you answer me.
[Updated on: Thu, 18 December 2014 23:48] Report message to a moderator
|
|
|
|
|
Re: [Xtext 2.8] : Cross-references howto with indexed references [message #1521667 is a reply to message #1516905] |
Sun, 21 December 2014 23:41 |
|
Christian Dietrich wrote on Fri, 19 December 2014 05:54Datatype rules are parser rules, aren't they
Yes, I agree. (I've discovered all this stuff after writing my post and didn't update it very well. It's why it is a bit inconsistent.)
Christian Dietrich wrote on Fri, 19 December 2014 05:54
But if you want a cross ref inside a cross ref the outer stuff may be a kind of derived cross refs
This is not my primary concern. The example is to show the difficulty of taking into account references with indexes and more of that, arithmetic expressions in it.
My concern is : "How to specify a cross-reference involving a field of a composite type."
Of course,it is interesting to link i to its definition as well but my thinking is to link c to its definition.
My concern is that [i]a.b[i*2].c[3][/i] is handled by a set of parser rules and I have some difficulties to wrap them in EDataType.
And I wanted to know what is the method.
Christian Dietrich wrote on Fri, 19 December 2014 05:54Btw arent a b c 3 separate references?
I would like to crossref c and i only.
About crossrefs, What am I supposed to do with :
The rule 'Simple_name' is not valid for a cross reference since it does not return an EString. You'll have to wrap it in a data type rule.
Simple_name: {Simple_name}
(IDENTIFIER P)* (IDENTIFIER | OPERATOR_SYMBOL);
Thanks a lot.
[Updated on: Mon, 22 December 2014 00:39] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02199 seconds