|
|
|
|
|
|
Re: narrow cross references [message #965569 is a reply to message #965537] |
Wed, 31 October 2012 10:35 |
|
Hi,
you grammar is highly amigous. thus in scoping the context object may not be a concrete instance company_crossRef but its parent.
i dont know a clean solution to this besides introducing different keywords
it may work if you change the grammar but i dont know
company_crossRef: comp1=[Company] ':' bla= empId_crossRef;
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
|
|
Re: narrow cross references [message #965704 is a reply to message #965688] |
Wed, 31 October 2012 12:51 |
|
P.S: if you dont care about semantics and spaces around the : and this is your only cross ref
Model: cs+=Company* employees+=Emp* block+=Block
;
Block:
ref=[empId|QName]
;
QName : ID (":" ID)*;
Company: c='Company' name=ID '{' emp+=Emp+ '}';
Emp: r='Emp' name=ID '{' empIdName+= empId* '}'';' ;
empId: 'Employee_id' name=ID;
public class MyDslRuntimeModule extends org.xtext.example.mydsl.AbstractMyDslRuntimeModule {
public Class<? extends IQualifiedNameConverter> bindIQualifiedNameConverter() {
return MyQNC.class;
}
}
public class MyQNC extends IQualifiedNameConverter.DefaultImpl{
@Override
public String getDelimiter() {
return ":";
}
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: narrow cross references [message #968198 is a reply to message #965704] |
Fri, 02 November 2012 09:24 |
sri sri Messages: 20 Registered: October 2012 |
Junior Member |
|
|
Hi,
The dropdown is successfully showing all fully qualified names:
sony:sony_emp:sony_1
amazon_emp1:amazon_1
In case of first example, can we have qualified name only upto: "sony:sony_emp" and then ctrl+space should show me : and then the list of corresponding employee Ids
Similarly, I should be able to get : and amazon_1 after amazon_emp1
[Updated on: Fri, 02 November 2012 09:51] Report message to a moderator
|
|
|
|
Re: narrow cross references [message #968234 is a reply to message #968208] |
Fri, 02 November 2012 09:55 |
|
P.S: if this is about whitespace between the ids and the :
public class MyQNC extends IQualifiedNameConverter.DefaultImpl{
@Override
public String getDelimiter() {
return ":";
}
@Override
public QualifiedName toQualifiedName(String qualifiedNameAsString) {
return super.toQualifiedName(qualifiedNameAsString.replaceAll(" ", ""));
}
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
Re: narrow cross references [message #971915 is a reply to message #968295] |
Mon, 05 November 2012 08:01 |
sri sri Messages: 20 Registered: October 2012 |
Junior Member |
|
|
Hi,
thank you for your replies.
Can I get cross referencing of both at a time with eager linking instead of xtext's lazy linking? I tried by mentioning eager linking in mwe2 file, however did not see any difference in the confusion of xtext after the first ":" .
Is customization of doGenerate method or ProposalProvider class related to the cross referencing problem i am trying to solve?
[Updated on: Wed, 07 November 2012 07:37] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.05614 seconds