public void Add(VarDefNode varDef) { string varName = varDef.VarSpec.Name; if (IsDefinedHere(varName)) throw new InterpreterException("Multiple definitions within the same scope for variable: " + varName); Variables[varName] = new IntVariable(varDef); }
public void Add(string varName, IntVariable var) { if (IsDefinedHere(varName)) throw new InterpreterException("Multiple definitions within the same scope for variable: " + varName); Variables[varName] = var; }