453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
|
def make (lRule, sLang, dDef, dDecl, dOptPriority):
"compile rules, returns a dictionary of values"
# for clarity purpose, don’t create any file here
# removing comments, zeroing empty lines, creating definitions, storing tests, merging rule lines
print(" parsing rules...")
lTokenLine = []
lActions = []
bActionBlock = False
nPriority = -1
dAllGraph = {}
dGraphCode = {}
sGraphName = ""
|
|
|
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
|
def make (lRule, sLang, dDef, dDecl, dOptPriority):
"compile rules, returns a dictionary of values"
# for clarity purpose, don’t create any file here
# removing comments, zeroing empty lines, creating definitions, storing tests, merging rule lines
print(" parsing graph rules...")
lTokenLine = []
lActions = []
bActionBlock = False
nPriority = -1
dAllGraph = {}
dGraphCode = {}
sGraphName = ""
|
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
|
lActions.clear()
iActionBlock += 1
else:
print("Unknown line at:", iLine)
print(sLine)
# processing rules
print(" processing rules...")
initProcessPoolExecutor()
fStartTimer = time.time()
# build graph
lResult = []
nRule = 0
for sGraphName, lRuleLine in dAllGraph.items():
nRule += len(lRuleLine)
|
|
|
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
|
lActions.clear()
iActionBlock += 1
else:
print("Unknown line at:", iLine)
print(sLine)
# processing rules
print(" processing graph rules...")
initProcessPoolExecutor()
fStartTimer = time.time()
# build graph
lResult = []
nRule = 0
for sGraphName, lRuleLine in dAllGraph.items():
nRule += len(lRuleLine)
|