Ejemplo n.º 1
0
 public VariableInfo(string name, string staticName, TigerType tigerType, TigerScope containingScope, bool assignable)
 {
     Name            = name;
     StaticName      = staticName;
     TigerType       = tigerType;
     Assignable      = assignable;
     ContainingScope = containingScope;
 }
Ejemplo n.º 2
0
 public FunctionInfo(string name, string staticName, TigerType returnType, TigerType[] tigerTypes, TigerScope containingScope, MethodBuilder methodBuilder)
 {
     Name            = name;
     StaticName      = staticName;
     ReturnType      = returnType;
     Parameters      = tigerTypes;
     ContainingScope = containingScope;
     MethodBuilder   = methodBuilder;
 }
Ejemplo n.º 3
0
        public VariableInfo DefineVariable(string name, TigerType tigerType, TigerScope containingScope, bool assignable = true)
        {
            if (FunctionVariableDictionary.ContainsKey(name))
            {
                throw new Exception("A variable or function with this name already exists");
            }
            VariableInfo variableInfo = new VariableInfo(name, Name + "_" + name, tigerType, containingScope, assignable);

            FunctionVariableDictionary.Add(name, variableInfo);
            return(variableInfo);
        }
Ejemplo n.º 4
0
 public TigerScope(TigerScope parent, string name)
 {
     Parent = parent;
     Name   = name + "Class" + ClassCounter++;
 }
Ejemplo n.º 5
0
        public FunctionInfo DefineFunction(string name, TigerType returnType, TigerType[] parameters, TigerScope containingScope, MethodBuilder methodBuilder = null)
        {
            if (!FunctionNameAvailable(name))
            {
                throw new Exception("A variable or function with this name already exists");
            }
            FunctionInfo functionInfo = new FunctionInfo(name, Name + "_" + name, returnType, parameters, containingScope, methodBuilder);

            FunctionVariableDictionary.Add(name, functionInfo);
            return(functionInfo);
        }