Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-471

Use of reference keyword in a YANG extension causes YangSyntaxErrorException

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 3859

    Description

      Here is a small example of a yang file to demonstrate the problem. It includes the extension in the same module for brevity. The Yangtools version is 0.6.5-Helium-SR3.

      module extension-with-reference {
      namespace "http://example.com/extension-with-reference";
      prefix "ewr";

      description
      "Simple example to see an extension with reference";

      extension myalias

      { argument "descriptor"; }

      container foo {
      ewr:myalias some-alias

      { description "..."; reference "..."; }

      }
      }

      This causes following exception:

      org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException: extraneous input 'reference' expecting

      {'}

      ', 'yin-element', 'yang-version', 'when', 'value', 'uses', 'units', 'unique', 'typedef', 'type', 'submodule', 'status', 'rpc', 'revision-date', 'revision', 'require-instance', 'refine', 'range', 'presence', 'prefix', 'position', 'pattern', 'path', 'output', 'organization', 'ordered-by', 'notification', 'namespace', 'must', 'module', 'min-elements', 'max-elements', 'mandatory', 'list', 'length', 'leaf-list', 'leaf', 'key', 'input', 'include', 'import', 'if-feature', 'identity', 'grouping', 'fraction-digits', 'feature', 'deviate', 'deviation', 'extension', 'error-message', 'error-app-tag', 'enum', 'description', 'default', 'container', 'contact', 'config', 'choice', 'case', 'bit', 'belongs-to', 'base', 'augment', 'anyxml', IDENTIFIER} in module extension-with-reference on line 15 character 12
      at org.opendaylight.yangtools.yang.parser.impl.YangErrorListener.syntaxError(YangErrorListener.java:30)
      at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:57)
      at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:367)
      at org.antlr.v4.runtime.DefaultErrorStrategy.reportUnwantedToken(DefaultErrorStrategy.java:255)
      at org.antlr.v4.runtime.DefaultErrorStrategy.sync(DefaultErrorStrategy.java:197)
      at org.opendaylight.yangtools.antlrv4.code.gen.YangParser.identifier_stmt(YangParser.java:330)
      at org.opendaylight.yangtools.antlrv4.code.gen.YangParser.container_stmt(YangParser.java:5274)
      at org.opendaylight.yangtools.antlrv4.code.gen.YangParser.data_def_stmt(YangParser.java:9809)
      at org.opendaylight.yangtools.antlrv4.code.gen.YangParser.body_stmts(YangParser.java:10002)
      at org.opendaylight.yangtools.antlrv4.code.gen.YangParser.module_stmt(YangParser.java:10805)
      at org.opendaylight.yangtools.antlrv4.code.gen.YangParser.yang(YangParser.java:170)
      at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.parseYangSource(YangParserImpl.java:656)
      at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.parseYangSources(YangParserImpl.java:641)
      at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.parseSourcesToBuilders(YangParserImpl.java:385)
      at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.resolveSources(YangParserImpl.java:378)
      at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.parseYangModelSources(YangParserImpl.java:350)
      at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.parseSources(YangParserImpl.java:195)

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            martin.ciglan Martin Ciglan
            claudia.hwang@ontology.com Claudia Hwang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: