traverse AST and dump CExpr nodes
This commit is contained in:
1 parent
854b82e088
commit
13fbaea4d1
2 files changed
+24
-1
No files matched your search
@@ -7,6 +7,9 @@ import tempfile
|
||||
from subprocess import *
|
||||
import re
|
||||
|
||||
import parser
|
||||
from Compiler import Compiler
|
||||
|
||||
def main(argv):
|
||||
parser = argparse.ArgumentParser(prog = 'jtlc',
|
||||
description = "Josh's Toy Language Compiler")
|
||||
@@ -45,9 +48,15 @@ def main(argv):
|
||||
return 0
|
||||
|
||||
def build(args, source, dest):
|
||||
dest.write('hi\n')
|
||||
f = open(source, 'r')
|
||||
contents = f.read()
|
||||
f.close()
|
||||
result = parser.parse(contents)
|
||||
c = Compiler()
|
||||
c.compile(result, dest)
|
||||
|
||||
def do_compile(args, source_fname, ofname):
|
||||
Popen(['grep', '-n', '.', source_fname]).wait()
|
||||
Popen(['gcc', '-o', ofname, '-c', source_fname]).wait()
|
||||
|
||||
def do_link(args, ofiles):
|
||||
|
||||
Reference in new issue
Block a user