public VariableInfo(string name, string staticName, TigerType tigerType, TigerScope containingScope, bool assignable) { Name = name; StaticName = staticName; TigerType = tigerType; Assignable = assignable; ContainingScope = containingScope; }
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; }
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); }
public TigerScope(TigerScope parent, string name) { Parent = parent; Name = name + "Class" + ClassCounter++; }
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); }