using qualifiedNameConverter for the output [message #1771731] |
Tue, 29 August 2017 23:57  |
Eclipse User |
|
|
|
Hello Experts,
This is my dsl(or I am trying to implement this)
augment "/if-mib:IF-MIB/if-mib:ifTable/if-mib:ifEntry"
{
status deprecated;
description
"An entry containing objects for invoking tests on an
interface.";
smiv2:oid "1.3.6.1.2.1.31.1.3.1";
leaf ifTestId {
type snmpv2-tc:TestAndIncr;
status deprecated;
description
"This object identifies the current invocation of the
interface's test.";
smiv2:max-access "read-write";
smiv2:oid "1.3.6.1.2.1.31.1.3.1.1";
}
This is my Xtext grammar.
DatadefStatement:
ContainerStatement |
LeafStatement |
ListStatement |
LeafListStatement
;
AugmentStatement:
'augment' path = SchemaNodeIdentifier
(';' | '{'
(augmentsubstatements+= AugmentSubStatement)*
'}'
)
;
AugmentSubStatement:
DescriptionStatement |
ContainerStatement |
UsesStatement |
LeafStatement |
StatusStatement |
UnknownStatement
;
SchemaNodeIdentifier returns SchemaNodeIdentifier:
RootSchemaNodeIdentifier ({SchemaNodeIdentifier.target=current}'/'((prefix=STRINGARG':')? schemaNode=[DatadefStatement]))*
;
RootSchemaNodeIdentifier returns SchemaNodeIdentifier:
isAbsolute?='/'? ((prefix=STRINGARG':')?schemaNode=[DatadefStatement])
;
This is my qualifiedNameProvider
public class YangDefinitionQualifiedNameProvider extends DefaultDeclarativeQualifiedNameProvider {
@Inject
private IQualifiedNameConverter qnc;
public QualifiedNameValueConverter qualifiedNameValueConverter(DatadefStatement d)
{
return qualifiedNameValueConverter(d);
}
I am getting this error:
mismatched input '{' expecting ':'
When I try to implement my grammar,
I am getting an output like mentioned below:
[color=darkred] augment / if-mib:IF-MIB / if-mib:IF-MIB.ifTable / if-mib:IF-MIB.ifTable.ifEntry [/color]
{
status deprecated;
description
"An entry containing objects for invoking tests on an
interface.";
smiv2:oid "1.3.6.1.2.1.31.1.3.1";
leaf ifTestId {
type snmpv2-tc:TestAndIncr;
status deprecated;
description
"This object identifies the current invocation of the
interface's test.";
smiv2:max-access "read-write";
smiv2:oid "1.3.6.1.2.1.31.1.3.1.1";
}
I am not using scope provider.
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.12289 seconds