summaryrefslogtreecommitdiff
path: root/examples/verilogParse.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2020-11-02 18:14:56 -0600
committerptmcg <ptmcg@austin.rr.com>2020-11-02 18:14:56 -0600
commit2dd2e2bb70407eea91f18de2caea5ba4527eb7dc (patch)
treec0a8824908983d6b4b81a6081af629e6ba8064b0 /examples/verilogParse.py
parent96e0fab07788fca87e1473b0ae755335d6988895 (diff)
downloadpyparsing-git-2dd2e2bb70407eea91f18de2caea5ba4527eb7dc.tar.gz
Add IndentedBlock class; made vertical keyword arg more visible when creating railroad diags; changed create_diagram from monkeypatch to included method on ParserElement; better debug exception if Dict is constructed with non-Group expressionpyparsing_3.0.0b1
Diffstat (limited to 'examples/verilogParse.py')
-rw-r--r--examples/verilogParse.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/verilogParse.py b/examples/verilogParse.py
index 8a809d1..cba0ac0 100644
--- a/examples/verilogParse.py
+++ b/examples/verilogParse.py
@@ -914,6 +914,9 @@ if 0:
else:
def main():
+ import sys
+
+ sys.setrecursionlimit(5000)
print("Verilog parser test (V %s)" % __version__)
print(" - using pyparsing version", pyparsing.__version__)
print(" - using Python version", sys.version)
@@ -927,8 +930,8 @@ else:
failCount = 0
Verilog_BNF()
numlines = 0
- startTime = time.clock()
- fileDir = "verilog"
+ startTime = time.time()
+ fileDir = "../scratch/verilog"
# ~ fileDir = "verilog/new"
# ~ fileDir = "verilog/new2"
# ~ fileDir = "verilog/new3"
@@ -950,9 +953,9 @@ else:
print(fnam, len(filelines), end=" ")
numlines += len(filelines)
teststr = "".join(filelines)
- time1 = time.clock()
+ time1 = time.time()
tokens = test(teststr)
- time2 = time.clock()
+ time2 = time.time()
elapsed = time2 - time1
totalTime += elapsed
if len(tokens):
@@ -974,7 +977,7 @@ else:
failCount += 1
for i, line in enumerate(filelines, 1):
print("%4d: %s" % (i, line.rstrip()))
- endTime = time.clock()
+ endTime = time.time()
print("Total parse time:", totalTime)
print("Total source lines:", numlines)
print("Average lines/sec:", ("%.1f" % (float(numlines) / (totalTime + 0.05))))