diff options
author | Nathan Binkert <nate@binkert.org> | 2011-07-05 18:30:05 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2011-07-05 18:30:05 -0700 |
commit | 831e9b3b7a658663f5bffafef175d4f4a5615cfd (patch) | |
tree | e2ac76e79b6e3f0f1fe5e5c471004c3e391dee2b /src/mem/slicc/main.py | |
parent | 3d252f8e5fa2ec3f55730ab6d5d1a4a1b21b2cdf (diff) | |
download | gem5-831e9b3b7a658663f5bffafef175d4f4a5615cfd.tar.xz |
slicc: cleanup slicc code and make it less verbose
Diffstat (limited to 'src/mem/slicc/main.py')
-rw-r--r-- | src/mem/slicc/main.py | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/mem/slicc/main.py b/src/mem/slicc/main.py index f8efcc323..15eb9d4be 100644 --- a/src/mem/slicc/main.py +++ b/src/mem/slicc/main.py @@ -60,6 +60,8 @@ def main(args=None): help="Path where html output goes") parser.add_option("-F", "--print-files", help="Print files that SLICC will generate") + parser.add_option("--tb", "--traceback", action='store_true', + help="print traceback on error") parser.add_option("-q", "--quiet", help="don't print messages") opts,files = parser.parse_args(args=args) @@ -71,30 +73,26 @@ def main(args=None): output = nprint if opts.quiet else eprint output("SLICC v0.4") - slicc = SLICC(debug=opts.debug) - output("Parsing...") - for filename in slicc.load(files, verbose=True): - output(" %s", filename) + + slicc = SLICC(debug=opts.debug) + slicc.load(files) if opts.print_files: for i in sorted(slicc.files()): print ' %s' % i else: - output("Generator pass 1...") - slicc.findMachines() - - output("Generator pass 2...") - slicc.generate() + output("Processing AST...") + slicc.process() - output("Generating C++ files...") + output("Writing C++ files...") slicc.writeCodeFiles(opts.code_path) if opts.html_path: - nprint("Writing HTML files...") + output("Writing HTML files...") slicc.writeHTMLFiles(opts.html_path) - eprint("SLICC is Done.") + output("SLICC is Done.") if __name__ == "__main__": main() |