Mercurial > lcfOS
diff python/c3/codegenerator.py @ 156:1b4a85bdd99c
change types
author | Windel Bouwman |
---|---|
date | Sun, 03 Mar 2013 15:50:34 +0100 |
parents | b28a11c01dbe |
children | 8f3924b6076e |
line wrap: on
line diff
--- a/python/c3/codegenerator.py Sun Mar 03 13:20:03 2013 +0100 +++ b/python/c3/codegenerator.py Sun Mar 03 15:50:34 2013 +0100 @@ -4,9 +4,12 @@ def genModule(pkg): m = ir.Module(pkg.name) for s in pkg.scope: - print(s) if type(s) is astnodes.Variable: genGlobal(m, s) + elif type(s) is astnodes.Function: + genFunction(m, s) + else: + print(s) return m def genGlobal(m, var): @@ -14,6 +17,10 @@ v.name = var.name m.Globals.append(v) +def genFunction(m, fnc): + f = ir.Function() + m.Globals.append(f) + class CodeGenerator: """ Generates intermediate code """ def gencode(self, ast):