Overview
| Comment: | [build] darg: code cleaning (pylint) |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | build | rg |
| Files: | files | file ages | folders |
| SHA3-256: |
ac1f3586679d24bc26bae0ca791790e1 |
| User & Date: | olr on 2018-06-24 16:25:27 |
| Other Links: | branch diff | manifest | tags |
Context
|
2018-06-24
| ||
| 16:30 | [cli] code cleaning (pylint) check-in: 90a0252af0 user: olr tags: cli, rg | |
| 16:25 | [build] darg: code cleaning (pylint) check-in: ac1f358667 user: olr tags: build, rg | |
| 16:19 | [build] make.py: code cleaning (pylint) check-in: 6839c99323 user: olr tags: build, rg | |
Changes
Modified darg.py from [182863e043] to [5a6ef5f70e].
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | + - - + + + - - - - - - + + - - + + | #!python3 """ |
| ︙ | |||
68 69 70 71 72 73 74 | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | - + |
oNode = self.lUncheckedNodes[-1][2]
iToken = nCommonPrefix
for sToken in aRule[nCommonPrefix:]:
oNextNode = Node()
oNode.dArcs[sToken] = oNextNode
self.lUncheckedNodes.append((oNode, sToken, oNextNode))
|
| ︙ | |||
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | + + + + - + + + - + + - + |
oNode.dArcs[sToken] = self.lMinimizedNodes[oChildNode]
else:
# add the state to the minimized nodes.
self.lMinimizedNodes[oChildNode] = oChildNode
self.lUncheckedNodes.pop()
def countNodes (self):
"count nodes within the whole graph"
self.nNode = len(self.lMinimizedNodes)
def countArcs (self):
"count arcs within the whole graph"
self.nArc = 0
for oNode in self.lMinimizedNodes:
self.nArc += len(oNode.dArcs)
def displayInfo (self):
"display informations about the rule graph"
print(" * {:<12} {:>16,}".format("Rules:", self.nRule))
print(" * {:<12} {:>16,}".format("Nodes:", self.nNode))
print(" * {:<12} {:>16,}".format("Arcs:", self.nArc))
def createGraph (self):
"create the graph as a dictionary"
dGraph = { 0: self.oRoot.getNodeAsDict() }
for oNode in self.lMinimizedNodes:
|
| ︙ |