view python/ir/function.py @ 148:e5263f74b287

Added c3 language frontend initial parser
author Windel Bouwman
date Fri, 01 Mar 2013 10:24:01 +0100
parents 4e79484a9d47
children
line wrap: on
line source


class Argument:
   def __init__(self, argtype, name, function):
      self.t = argtype
      self.name = name
      self.function = function

class Function(GlobalValue):
   def __init__(self, functiontype, name, module):
      super().__init__()
      self.functiontype = functiontype
      self.name = name
      self.module = module

      self.module.Functions.append(self)
      self.basicblocks = []
      self.arguments = []
      # Construct formal arguments depending on function type

   BasicBlocks = property(lambda self: self.basicblocks)
   Arguments = property(lambda self: self.arguments)
   ReturnType = property(lambda self: self.functiontype.returnType)
   FunctionType = property(lambda self: self.functiontype)