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

Provide new Parser constructor

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: Windows
      Platform: PC

    Description

      What I need is an option like

      parseYangModels(File yangFile, File directory)

      Currently I need to do something like this this :

      List<File> yangFiles = new ArrayList<File>();
      yangFiles.add(new File("IF-MIB.yang"));
      yangFiles.add(new File("iana-if-type.yang"));
      yangFiles.add(new File("SNMPv2-TC.yang"));
      yangFiles.add(new File("ietf-yang-types.yang"));

      YangModelParser parser = new YangParserImpl();
      Set<Module> modules = new HashSet<Module>();
      modules = parser.parseYangModels(yangFiles);

      Of course hard-coding won't work, so otherwise I'll need to parse each Yang file and compute the import transitive closure myself.

      I think this would be a useful addition to the API.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            chrhartl@cisco.com Christopher Hartley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: