Ejemplo n.º 1
0
 // SetCurrFunc
 // ===========
 // set the current function
 public Scope SetCurrentFunction(TFunction type)
 {
     return new Scope(
         locals,
         esp_pos,
         globals,
         type,
         typedefs,
         enums
     );
 }
Ejemplo n.º 2
0
 // private constructor
 // ===================
 //
 private Scope(List<Utils.StoreEntry> stack_entries,
               Int32 stack_offset,
               List<Utils.StoreEntry> global_entries,
               TFunction curr_func,
               List<Utils.StoreEntry> typedef_entries,
               List<Utils.StoreEntry> enum_entries)
 {
     locals = stack_entries;
     esp_pos = stack_offset;
     globals = global_entries;
     func = curr_func;
     typedefs = typedef_entries;
     enums = enum_entries;
 }
 public FuncDef(String name, Decln.SCS scs, TFunction type, Stmt stmt) {
     this.name = name;
     this.scs  = scs;
     this.type = type;
     this.stmt = stmt;
 }
Ejemplo n.º 4
0
 // SetCurrentFunction
 // ==================
 // input: type
 // ouput: Environment
 // return a new environment which sets the current function
 //
 public Env SetCurrentFunction(TFunction type)
 {
     Stack<Scope> scopes = new Stack<Scope>(new Stack<Scope>(env_scopes));
     Scope top = scopes.Pop().SetCurrentFunction(type);
     scopes.Push(top);
     return new Env(scopes);
 }
Ejemplo n.º 5
0
 public FuncCall(Expr func, TFunction func_type, List<Expr> args)
     : base(func_type.ret_t)
 {
     this.func = func;
     this.func_type = func_type;
     this.args = args;
 }