Beispiel #1
0
def chk_stmts():
    global found_error
    stmtmaps = [(grammar.stmt_map, "grammar.stmt_map"),
                (xsd.yang_keywords, "xsd.yang_keywords"),
                (syntax.yin_map, "syntax.yin_map")]
    for (map, name) in stmtmaps:
        for stmt in map:
            targets = util.listsdelete((map,name), stmtmaps)
            for (tmap, tname) in targets: 
                if stmt not in tmap:
                    print >> sys.stderr, \
                        "Stmt %s in %s not found in %s" % \
                        (stmt, name, tname)
                    found_error = True
    if found_error:
        return
    for s in syntax.yin_map:
        (argname, yinelem) = syntax.yin_map[s]
        (xargname, xyinelem, xsdappinfo) = xsd.yang_keywords[s]
        if argname != xargname:
            print >> sys.stderr, \
                "Stmt %s argname mismatch in syntax.yin_map " \
                "and xsd.yang_keywords" % s
            found_error = True
        if yinelem != xyinelem:
            print >> sys.stderr, \
                "Stmt %s yinelem mismatch in syntax.yin_map " \
                "and xsd.yang_keywords" % s
            found_error = True
Beispiel #2
0
def chk_stmts():
    stmtmaps = [(grammar.stmt_map, "grammar.stmt_map"),
                (syntax.yin_map, "syntax.yin_map")]
    for (map, name) in stmtmaps:
        for stmt in map:
            targets = util.listsdelete((map, name), stmtmaps)
            for (tmap, tname) in targets:
                if stmt not in tmap:
                    sys.stderr.write("Stmt %s in %s not found in %s" % \
                                         (stmt, name, tname))
Beispiel #3
0
def chk_stmts():
    stmtmaps = [(grammar.stmt_map, "grammar.stmt_map"),
                (syntax.yin_map, "syntax.yin_map")]
    for (map, name) in stmtmaps:
        for stmt in map:
            targets = util.listsdelete((map,name), stmtmaps)
            for (tmap, tname) in targets:
                if stmt not in tmap:
                    sys.stderr.write("Stmt %s in %s not found in %s" % \
                                         (stmt, name, tname))