summaryrefslogtreecommitdiffstats
path: root/Tools/compiler
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2000-03-06 19:13:21 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2000-03-06 19:13:21 (GMT)
commit0c3208aa628f090ce5a3278e6e53fe89c952f1b0 (patch)
treee2eed61ed214f5750744ba51eb74d73bcec7bf2e /Tools/compiler
parentf728f9a13e01e7d9fdd791f0a6e9a8ab1b6249a5 (diff)
downloadcpython-0c3208aa628f090ce5a3278e6e53fe89c952f1b0.zip
cpython-0c3208aa628f090ce5a3278e6e53fe89c952f1b0.tar.gz
cpython-0c3208aa628f090ce5a3278e6e53fe89c952f1b0.tar.bz2
compiler command-line interface moved here from compiler.pycodegen
Diffstat (limited to 'Tools/compiler')
-rw-r--r--Tools/compiler/compile.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/Tools/compiler/compile.py b/Tools/compiler/compile.py
new file mode 100644
index 0000000..7d6facf
--- /dev/null
+++ b/Tools/compiler/compile.py
@@ -0,0 +1,25 @@
+import sys
+import getopt
+
+from compiler import compile, visitor
+
+def main():
+ VERBOSE = 0
+ opts, args = getopt.getopt(sys.argv[1:], 'vq')
+ for k, v in opts:
+ if k == '-v':
+ VERBOSE = 1
+ visitor.ASTVisitor.VERBOSE = visitor.ASTVisitor.VERBOSE + 1
+ if k == '-q':
+ f = open('/dev/null', 'wb')
+ sys.stdout = f
+ if not args:
+ print "no files to compile"
+ else:
+ for filename in args:
+ if VERBOSE:
+ print filename
+ compile(filename)
+
+if __name__ == "__main__":
+ main()