Exemplo n.º 1
0
        //-----------------------------------------------------------
        public SemanticAnalyzer()
        {
            GlobalVarsTable = new SymbolTable();
            FunctionTable   = new FuncTable();
            //For second run, the dictionary of particular Funcs
            FunMethods = new FuncMethods();
            //Fill in the non-user defined functions

            FunctionTable["printi"]  = new GFuncStruct("p", 1, new FunContainer());
            FunctionTable["printc"]  = new GFuncStruct("p", 1, new FunContainer());
            FunctionTable["prints"]  = new GFuncStruct("p", 1, new FunContainer());
            FunctionTable["println"] = new GFuncStruct("p", 0, new FunContainer());
            FunctionTable["readi"]   = new GFuncStruct("p", 0, new FunContainer());
            FunctionTable["reads"]   = new GFuncStruct("p", 0, new FunContainer());
            FunctionTable["new"]     = new GFuncStruct("p", 1, new FunContainer());
            FunctionTable["size"]    = new GFuncStruct("p", 1, new FunContainer());
            FunctionTable["add"]     = new GFuncStruct("p", 2, new FunContainer());
            FunctionTable["get"]     = new GFuncStruct("p", 2, new FunContainer());
            FunctionTable["set"]     = new GFuncStruct("p", 3, new FunContainer());
        }
Exemplo n.º 2
0
 public CILGenerator(SymbolTable table, FuncTable functionsT)
 {
     this.table      = table;
     this.functionsT = functionsT;
 }