annotate python/zcc.py @ 315:084cccaa5deb

Added console and screen
author Windel Bouwman
date Sat, 21 Dec 2013 10:03:01 +0100
parents 38f5f298ce0e
children 56e6ff84f646
rev   line source
292
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
1 #!/usr/bin/env python
104
ed230e947dc6 Added hexviewer
windel
parents:
diff changeset
2
287
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
3 import sys
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
4 import argparse
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
5 import logging
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
6
313
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 312
diff changeset
7 from ppci.c3 import Builder, AstPrinter
287
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
8 import ppci
312
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
9 from ppci.irutils import Verifier, Writer
301
6753763d3bec merge codegen into ppci package
Windel Bouwman
parents: 300
diff changeset
10 from ppci.codegen import CodeGenerator
205
d77cb5962cc5 Added some handcoded arm code generation
Windel Bouwman
parents: 204
diff changeset
11 import outstream
292
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
12 from utils import HexFile
290
7b38782ed496 File moves
Windel Bouwman
parents: 289
diff changeset
13 import target
311
ff665880a6b0 Added testcase for kernel and userspace
Windel Bouwman
parents: 306
diff changeset
14 from ppci import irutils
ff665880a6b0 Added testcase for kernel and userspace
Windel Bouwman
parents: 306
diff changeset
15 import io
253
74c6a20302d5 Added better logging
Windel Bouwman
parents: 252
diff changeset
16
289
bd2593de3ff8 Semifix burn2
Windel Bouwman
parents: 288
diff changeset
17
281
4496cae24d7f Improved logview
Windel Bouwman
parents: 276
diff changeset
18 logformat='%(asctime)s|%(levelname)s|%(name)s|%(message)s'
4496cae24d7f Improved logview
Windel Bouwman
parents: 276
diff changeset
19
289
bd2593de3ff8 Semifix burn2
Windel Bouwman
parents: 288
diff changeset
20
253
74c6a20302d5 Added better logging
Windel Bouwman
parents: 252
diff changeset
21 def logLevel(s):
312
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
22 """ Converts a string to a valid logging level """
253
74c6a20302d5 Added better logging
Windel Bouwman
parents: 252
diff changeset
23 numeric_level = getattr(logging, s.upper(), None)
74c6a20302d5 Added better logging
Windel Bouwman
parents: 252
diff changeset
24 if not isinstance(numeric_level, int):
74c6a20302d5 Added better logging
Windel Bouwman
parents: 252
diff changeset
25 raise ValueError('Invalid log level: {}'.format(s))
74c6a20302d5 Added better logging
Windel Bouwman
parents: 252
diff changeset
26 return numeric_level
105
6a303f835c6d Removed compilers directory
Windel Bouwman
parents: 104
diff changeset
27
289
bd2593de3ff8 Semifix burn2
Windel Bouwman
parents: 288
diff changeset
28
312
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
29 class RstFormatter(logging.Formatter):
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
30 """ Formatter that tries to create an rst document """
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
31 def __init__(self):
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
32 super().__init__(fmt=logformat)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
33
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
34 def format(self, record):
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
35 s = super().format(record)
314
38f5f298ce0e Add log for interference graph
Windel Bouwman
parents: 313
diff changeset
36 s += '\n'
313
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 312
diff changeset
37 if hasattr(record, 'c3_ast'):
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 312
diff changeset
38 f = io.StringIO()
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 312
diff changeset
39 print('', file=f)
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 312
diff changeset
40 print('', file=f)
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 312
diff changeset
41 print('.. code::', file=f)
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 312
diff changeset
42 print('', file=f)
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 312
diff changeset
43 AstPrinter().printAst(record.c3_ast, f)
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 312
diff changeset
44 print('', file=f)
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 312
diff changeset
45 s += '\n' + f.getvalue()
312
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
46 if hasattr(record, 'ircode'):
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
47 f = io.StringIO()
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
48 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
49 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
50 print('.. code::', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
51 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
52 Writer(' ').write(record.ircode, f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
53 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
54 s += '\n' + f.getvalue()
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
55 if hasattr(record, 'irfunc'):
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
56 f = io.StringIO()
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
57 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
58 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
59 print('.. code::', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
60 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
61 Writer(' ').write_function(record.irfunc, f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
62 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
63 s += '\n' + f.getvalue()
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
64 if hasattr(record, 'ppci_frame'):
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
65 f = io.StringIO()
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
66 frame = record.ppci_frame
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
67 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
68 print('.. code::', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
69 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
70 print(' {}'.format(frame.name), file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
71 for i in frame.instructions:
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
72 print(' {}'.format(i),file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
73 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
74 s += '\n' + f.getvalue()
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
75 if hasattr(record, 'ra_cfg'):
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
76 f = io.StringIO()
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
77 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
78 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
79 print('.. graphviz::', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
80 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
81 print(' digraph G {', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
82 cfg = record.ra_cfg
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
83 cfg.to_dot(f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
84 print(' }', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
85 print('', file=f)
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
86 s += '\n' + f.getvalue()
314
38f5f298ce0e Add log for interference graph
Windel Bouwman
parents: 313
diff changeset
87 if hasattr(record, 'ra_ig'):
38f5f298ce0e Add log for interference graph
Windel Bouwman
parents: 313
diff changeset
88 f = io.StringIO()
38f5f298ce0e Add log for interference graph
Windel Bouwman
parents: 313
diff changeset
89 print('', file=f)
38f5f298ce0e Add log for interference graph
Windel Bouwman
parents: 313
diff changeset
90 print('', file=f)
38f5f298ce0e Add log for interference graph
Windel Bouwman
parents: 313
diff changeset
91 print('.. graphviz::', file=f)
38f5f298ce0e Add log for interference graph
Windel Bouwman
parents: 313
diff changeset
92 print('', file=f)
38f5f298ce0e Add log for interference graph
Windel Bouwman
parents: 313
diff changeset
93 print(' digraph G {', file=f)
38f5f298ce0e Add log for interference graph
Windel Bouwman
parents: 313
diff changeset
94 ig = record.ra_ig
38f5f298ce0e Add log for interference graph
Windel Bouwman
parents: 313
diff changeset
95 ig.to_dot(f)
38f5f298ce0e Add log for interference graph
Windel Bouwman
parents: 313
diff changeset
96 print(' }', file=f)
38f5f298ce0e Add log for interference graph
Windel Bouwman
parents: 313
diff changeset
97 print('', file=f)
38f5f298ce0e Add log for interference graph
Windel Bouwman
parents: 313
diff changeset
98 s += '\n' + f.getvalue()
312
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
99 return s
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
100
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
101
290
7b38782ed496 File moves
Windel Bouwman
parents: 289
diff changeset
102 target_list = [target.armtarget]
292
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
103 targets = {t.name: t for t in target_list}
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
104 targetnames = list(targets.keys())
290
7b38782ed496 File moves
Windel Bouwman
parents: 289
diff changeset
105
205
d77cb5962cc5 Added some handcoded arm code generation
Windel Bouwman
parents: 204
diff changeset
106 # Parse arguments:
204
de3a68f677a5 Added long comment to c3 parser
Windel Bouwman
parents: 107
diff changeset
107 parser = argparse.ArgumentParser(description='lcfos Compiler')
287
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
108 # Input:
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 207
diff changeset
109 parser.add_argument('source', type=argparse.FileType('r'), \
287
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
110 help='the source file to build', nargs="+")
290
7b38782ed496 File moves
Windel Bouwman
parents: 289
diff changeset
111 parser.add_argument('-i', '--imp', type=argparse.FileType('r'), \
296
9417caea2eb3 Directorized some backend files
Windel Bouwman
parents: 293
diff changeset
112 help='Possible import module', action='append', default=[])
287
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
113
255
7416c923a02a Added more logging
Windel Bouwman
parents: 253
diff changeset
114 parser.add_argument('--optimize', action='store_true', help="Optimize")
290
7b38782ed496 File moves
Windel Bouwman
parents: 289
diff changeset
115 parser.add_argument('--target', help="Backend selection",
292
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
116 choices=targetnames, required=True)
205
d77cb5962cc5 Added some handcoded arm code generation
Windel Bouwman
parents: 204
diff changeset
117 parser.add_argument('-o', '--output', help='Output file', metavar='filename')
290
7b38782ed496 File moves
Windel Bouwman
parents: 289
diff changeset
118 parser.add_argument('--hexfile', help='Output hexfile',
7b38782ed496 File moves
Windel Bouwman
parents: 289
diff changeset
119 type=argparse.FileType('w'))
315
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
120 parser.add_argument('--log', help='Log level (INFO,DEBUG,[WARN])',
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
121 type=logLevel, default='WARN')
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
122 parser.add_argument('--report', help='Specify a file to write the compile report to',
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
123 type=argparse.FileType('w'))
104
ed230e947dc6 Added hexviewer
windel
parents:
diff changeset
124
288
a747a45dcd78 Various styling work
Windel Bouwman
parents: 287
diff changeset
125
315
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
126 def zcc(srcs, imps, tg, outs, diag):
287
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
127 """
315
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
128 Compiler driver
287
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
129 Compile sources into output stream.
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
130 Sources is an iterable of open files.
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
131 """
315
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
132 logging.info('Zcc started {}'.format(srcs))
207
8b2f20aae086 cleaning of files
Windel Bouwman
parents: 205
diff changeset
133 # Front end:
301
6753763d3bec merge codegen into ppci package
Windel Bouwman
parents: 300
diff changeset
134 c3b = Builder(diag, tg)
6753763d3bec merge codegen into ppci package
Windel Bouwman
parents: 300
diff changeset
135 cg = CodeGenerator(tg)
292
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
136
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
137 # TODO: remove this arm specifics:
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
138 outs.getSection('code').address = 0x08000000
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
139 outs.getSection('data').address = 0x20000000
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
140
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
141 # Emit some custom start code:
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
142 tg.startCode(outs)
287
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
143 for ircode in c3b.build(srcs, imps):
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
144 if not ircode:
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
145 return
313
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 312
diff changeset
146
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 312
diff changeset
147 d = {'ircode':ircode}
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 312
diff changeset
148 logging.info('Verifying code {}'.format(ircode), extra=d)
290
7b38782ed496 File moves
Windel Bouwman
parents: 289
diff changeset
149 # Optimization passes, TODO
312
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
150 Verifier().verify(ircode)
289
bd2593de3ff8 Semifix burn2
Windel Bouwman
parents: 288
diff changeset
151
287
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
152 # Code generation:
312
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
153 d = {'ircode':ircode}
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
154 logging.info('Starting code generation for {}'.format(ircode), extra=d)
292
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
155 cg.generate(ircode, outs)
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
156 # TODO: fixup references, do this in another way?
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
157 outs.backpatch()
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
158 outs.backpatch() # Why two times?
288
a747a45dcd78 Various styling work
Windel Bouwman
parents: 287
diff changeset
159 return c3b.ok
a747a45dcd78 Various styling work
Windel Bouwman
parents: 287
diff changeset
160
249
e41e4109addd Added current position arrow
Windel Bouwman
parents: 246
diff changeset
161
e41e4109addd Added current position arrow
Windel Bouwman
parents: 246
diff changeset
162 def main(args):
315
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
163 # Configure some logging:
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
164 logging.getLogger().setLevel(logging.DEBUG)
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
165 ch = logging.StreamHandler()
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
166 ch.setFormatter(logging.Formatter(logformat))
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
167 ch.setLevel(args.log)
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
168 logging.getLogger().addHandler(ch)
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
169 if args.report:
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
170 fh = logging.StreamHandler(stream=args.report)
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
171 fh.setFormatter(RstFormatter())
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
172 logging.getLogger().addHandler(fh)
312
2c9768114877 Added cool logging formatter
Windel Bouwman
parents: 311
diff changeset
173
292
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
174 tg = targets[args.target]
249
e41e4109addd Added current position arrow
Windel Bouwman
parents: 246
diff changeset
175 diag = ppci.DiagnosticsManager()
e41e4109addd Added current position arrow
Windel Bouwman
parents: 246
diff changeset
176 outs = outstream.TextOutputStream()
e41e4109addd Added current position arrow
Windel Bouwman
parents: 246
diff changeset
177
315
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
178 res = zcc(args.source, args.imp, tg, outs, diag)
249
e41e4109addd Added current position arrow
Windel Bouwman
parents: 246
diff changeset
179 if not res:
293
6aa721e7b10b Try to improve build sequence
Windel Bouwman
parents: 292
diff changeset
180 diag.printErrors()
276
Windel Bouwman
parents: 272
diff changeset
181 return 1
205
d77cb5962cc5 Added some handcoded arm code generation
Windel Bouwman
parents: 204
diff changeset
182
313
04cf4d26a3bc Added constant function
Windel Bouwman
parents: 312
diff changeset
183 logging.info('Assembly created', extra={'zcc_outs':outs})
105
6a303f835c6d Removed compilers directory
Windel Bouwman
parents: 104
diff changeset
184
237
81752b0f85a5 Added burn led test program
Windel Bouwman
parents: 219
diff changeset
185 code_bytes = outs.sections['code'].to_bytes()
207
8b2f20aae086 cleaning of files
Windel Bouwman
parents: 205
diff changeset
186 if args.output:
8b2f20aae086 cleaning of files
Windel Bouwman
parents: 205
diff changeset
187 output_filename = args.output
287
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
188 with open(output_filename, 'wb') as f:
1c7c1e619be8 File movage
Windel Bouwman
parents: 281
diff changeset
189 f.write(code_bytes)
104
ed230e947dc6 Added hexviewer
windel
parents:
diff changeset
190
246
f254b87258e6 Added hexfile to zcc
Windel Bouwman
parents: 239
diff changeset
191 if args.hexfile:
255
7416c923a02a Added more logging
Windel Bouwman
parents: 253
diff changeset
192 logging.info('Creating hexfile')
292
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 290
diff changeset
193 hf = HexFile()
246
f254b87258e6 Added hexfile to zcc
Windel Bouwman
parents: 239
diff changeset
194 hf.addRegion(0x08000000, code_bytes)
f254b87258e6 Added hexfile to zcc
Windel Bouwman
parents: 239
diff changeset
195 hf.save(args.hexfile)
315
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
196
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
197 if args.report:
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
198 logging.getLogger().removeHandler(fh)
084cccaa5deb Added console and screen
Windel Bouwman
parents: 314
diff changeset
199 logging.getLogger().removeHandler(ch)
276
Windel Bouwman
parents: 272
diff changeset
200 return 0
246
f254b87258e6 Added hexfile to zcc
Windel Bouwman
parents: 239
diff changeset
201
288
a747a45dcd78 Various styling work
Windel Bouwman
parents: 287
diff changeset
202
207
8b2f20aae086 cleaning of files
Windel Bouwman
parents: 205
diff changeset
203 if __name__ == '__main__':
213
003c8a976fff Merge of semantics and parser again ..
Windel Bouwman
parents: 207
diff changeset
204 arguments = parser.parse_args()
276
Windel Bouwman
parents: 272
diff changeset
205 sys.exit(main(arguments))