|
|
|
|
|
|
|
Re: mismatched input '"urn:ietf:params:xml:ns:yang:smiv2:SNMPv2-MIB"' expecting '"' [message #1767902 is a reply to message #1767898] |
Wed, 12 July 2017 05:41 |
|
hi,
there a a problem. as i said lexers are context free.
=> if something can be parsed as a STRING, it will be parsed as a STRING
you would have to write a custom lexer for that and this is not a trivial task
what you could do instead:
- using STRING and write a check in the MyDslValidator that checks the format
- using a datatype rule on STRING and a custom Value converter that checks the format
maybe you can try to rearrange your grammar as well,
but you need to check how this conflicts with the places you exect a string
NamespaceStatement:
'namespace'
uri=STRINGARG4
';';
terminal STRINGARG4:
'"' (((ID+':'ID) + (':' +ID)+)| (':'+KEY_IDENTIFIER)+) '"';
terminal KEY_IDENTIFIER:
('value' | 'status' | 'namespace' | 'notification' | 'path' | 'description' | 'string' |
'error-message' | 'config' |'range' | 'revision' | 'type' | 'boolean' | 'prefix' |
'key' | 'fraction-digits')+;
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05838 seconds