Index: compile_rules_graph.py ================================================================== --- compile_rules_graph.py +++ compile_rules_graph.py @@ -316,16 +316,19 @@ for sGraphName, lRuleLine in dAllGraph.items(): lPreparedRule = [] for i, sRuleGroup, sTokenLine, iActionBlock, sActions, nPriority in lRuleLine: for lRule in createRule(i, sRuleGroup, sTokenLine, iActionBlock, sActions, nPriority, dDef): lPreparedRule.append(lRule) - # Show rules - #for e in lPreparedRule: - # print(e) # Graph creation oDARG = darg.DARG(lPreparedRule, sLang) dAllGraph[sGraphName] = oDARG.createGraph() + # Debugging + #print("\nGRAPH:", sGraphName) + #for e in lPreparedRule: + # print(e) + #for k, v in dAllGraph[sGraphName].items(): + # print(k, "\t", v) # creating file with all functions callable by rules print(" creating callables...") sPyCallables = "# generated code, do not edit\n" #sJSCallables = "// generated code, do not edit\nconst oEvalFunc = {\n" Index: darg.py ================================================================== --- darg.py +++ darg.py @@ -108,16 +108,14 @@ print(" * {:<12} {:>16,}".format("Nodes:", self.nNode)) print(" * {:<12} {:>16,}".format("Arcs:", self.nArc)) def createGraph (self): dGraph = { 0: self.oRoot.getNodeAsDict() } - print(0, "\t", self.oRoot.getNodeAsDict()) for oNode in self.lMinimizedNodes: sHashId = oNode.__hash__() if sHashId not in dGraph: dGraph[sHashId] = oNode.getNodeAsDict() - print(sHashId, "\t", dGraph[sHashId]) else: print("Error. Double nodeā€¦ same id: ", sHashId) print(str(oNode.getNodeAsDict())) return dGraph