main.py (6657:ef5fae93a3b2) main.py (6714:028047200ff7)
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 64 unchanged lines hidden (view full) ---

73 output("SLICC v0.4")
74 slicc = SLICC(debug=opts.debug)
75
76 output("Parsing...")
77 for filename in slicc.load(files, verbose=True):
78 output(" %s", filename)
79
80 if opts.print_files:
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 64 unchanged lines hidden (view full) ---

73 output("SLICC v0.4")
74 slicc = SLICC(debug=opts.debug)
75
76 output("Parsing...")
77 for filename in slicc.load(files, verbose=True):
78 output(" %s", filename)
79
80 if opts.print_files:
81 hh, cc = slicc.files()
82 hh = sorted(hh)
83 cc = sorted(cc)
84 print 'Headers:'
85 for i in hh:
81 for i in sorted(slicc.files()):
86 print ' %s' % i
82 print ' %s' % i
87
88 print 'Sources:'
89 for i in cc:
90 print ' %s' % i
91 else:
92 output("Generator pass 1...")
93 slicc.findMachines()
94
95 output("Generator pass 2...")
96 slicc.generate()
97
98 output("Generating C++ files...")
99 slicc.writeCodeFiles(opts.code_path)
100
101 if opts.html_path:
102 nprint("Writing HTML files...")
103 slicc.writeHTMLFiles(opts.html_path)
104
105 eprint("SLICC is Done.")
106
107if __name__ == "__main__":
108 main()
83 else:
84 output("Generator pass 1...")
85 slicc.findMachines()
86
87 output("Generator pass 2...")
88 slicc.generate()
89
90 output("Generating C++ files...")
91 slicc.writeCodeFiles(opts.code_path)
92
93 if opts.html_path:
94 nprint("Writing HTML files...")
95 slicc.writeHTMLFiles(opts.html_path)
96
97 eprint("SLICC is Done.")
98
99if __name__ == "__main__":
100 main()