Grammalecte  Check-in [c46f8d907b]

Overview
Comment:[build] debug: remove rules printing
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | build | rg
Files: files | file ages | folders
SHA3-256: c46f8d907be98890a6499813726c84e3f9511e5c8718667aed1172b3374ed760
User & Date: olr on 2018-06-19 16:55:58
Other Links: branch diff | manifest | tags
Context
2018-06-19
17:52
[build] debugging info update check-in: 0b591a67d1 user: olr tags: build, rg
16:55
[build] debug: remove rules printing check-in: c46f8d907b user: olr tags: build, rg
16:47
[build] debug: remove rules printing check-in: fa229d6ee5 user: olr tags: build, rg
Changes

Modified compile_rules_graph.py from [33628f88ed] to [13a87fa5df].

   314    314       # processing rules
   315    315       print("  preparing rules...")
   316    316       for sGraphName, lRuleLine in dAllGraph.items():
   317    317           lPreparedRule = []
   318    318           for i, sRuleGroup, sTokenLine, iActionBlock, sActions, nPriority in lRuleLine:
   319    319               for lRule in createRule(i, sRuleGroup, sTokenLine, iActionBlock, sActions, nPriority, dDef):
   320    320                   lPreparedRule.append(lRule)
   321         -        # Show rules
   322         -        #for e in lPreparedRule:
   323         -        #    print(e)
   324    321           # Graph creation
   325    322           oDARG = darg.DARG(lPreparedRule, sLang)
   326    323           dAllGraph[sGraphName] = oDARG.createGraph()
          324  +        # Debugging
          325  +        #print("\nGRAPH:", sGraphName)
          326  +        #for e in lPreparedRule:
          327  +        #    print(e)
          328  +        #for k, v in dAllGraph[sGraphName].items():
          329  +        #    print(k, "\t", v)
   327    330   
   328    331       # creating file with all functions callable by rules
   329    332       print("  creating callables...")
   330    333       sPyCallables = "# generated code, do not edit\n"
   331    334       #sJSCallables = "// generated code, do not edit\nconst oEvalFunc = {\n"
   332    335       for sFuncName, sReturn in dFUNCTIONS.items():
   333    336           if sFuncName.startswith("g_c_"): # condition

Modified darg.py from [5aaa4b1525] to [2922c13402].

   106    106       def displayInfo (self):
   107    107           print(" * {:<12} {:>16,}".format("Rules:", self.nRule))
   108    108           print(" * {:<12} {:>16,}".format("Nodes:", self.nNode))
   109    109           print(" * {:<12} {:>16,}".format("Arcs:", self.nArc))
   110    110   
   111    111       def createGraph (self):
   112    112           dGraph = { 0: self.oRoot.getNodeAsDict() }
   113         -        print(0, "\t", self.oRoot.getNodeAsDict())
   114    113           for oNode in self.lMinimizedNodes:
   115    114               sHashId = oNode.__hash__() 
   116    115               if sHashId not in dGraph:
   117    116                   dGraph[sHashId] = oNode.getNodeAsDict()
   118         -                print(sHashId, "\t", dGraph[sHashId])
   119    117               else:
   120    118                   print("Error. Double node… same id: ", sHashId)
   121    119                   print(str(oNode.getNodeAsDict()))
   122    120           return dGraph
   123    121   
   124    122   
   125    123