Use of proposalprovider for content-assist [message #1772235] |
Thu, 07 September 2017 00:02  |
Eclipse User |
|
|
|
Hello Experts,
I am trying to implement content-assist in pathexpression using cross-reference within double quotes.
I read these articles to solve reference problems and pathexpression implementation.
https://christiandietrich.wordpress.com/2015/03/19/xtext-and-strings-as-cross-references/
https://christiandietrich.wordpress.com/2013/05/18/xtext-and-dot-expressions/
I am writing grammar for yang language. While writing my yang file in new eclipse application I am getting error in schemanodeidentifier.
This is what I am trying to implement.
submodule "NAME"{
container "N"{
leaf-list "A"{
leaf "M"{
list "E";
}
}
}
augment "/N/A/M/E";
}
I am getting this error:
Couldn't resolve reference to SchemaNode '"/N/A/M/E"'.
I am not getting error when I write like this:
augment /"N"/"A"/"M"/"E";
This is my grammar.
YangFile:
Module|
SubModule
;
Module:
"module" name=STRINGARG
"{"
(statements+=Statement)*
"}"
;
SubModule:
"submodule" name =STRINGARG
"{"
(statements+=Statement)*
"}"
;
Statement:
SchemaNode | OtherStatement
;
SchemaNode :
DataSchemaNode ;
OtherStatement:
Augment
;
DataSchemaNode :
Container |
List |
Leaf |
LeafList
;
Container:
'container' name=STRINGARG (';'|
'{'
(substatements+=DataSchemaNode)
'}'
)
;
Leaf :
'leaf' name=STRINGARG (';'|
'{'
(substatements+=DataSchemaNode)
'}'
)
;
LeafList:
'leaf-list' name=STRINGARG (';'|
'{'
(substatements+=DataSchemaNode)
'}'
)
;
List:
'list' name=STRINGARG (';'|
'{'
(substatements+=DataSchemaNode)
'}'
)
;
Augment:
'augment' path=SchemaNodeIdentifier ';'
;
SchemaNodeIdentifier returns SchemaNodeIdentifier :
RootSchemaNodeIdentifier ({SchemaNodeIdentifier.target=current}"/"?(schemanode=[SchemaNode|QNAME]))*
;
RootSchemaNodeIdentifier returns SchemaNodeIdentifier:
{RootSchemaNodeIdentifier}isAbsolute?="/"?(schemanode=[SchemaNode|QNAME])
;
STRINGARG:
ID|"default"|INT | STRING ;
QNAME:
(STRINGARG ':')? STRINGARG
;
I haven't use proposal provider or scope provider.
I am confused that what should I use to achieve my output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.49635 seconds