public void RemoveVariable(string name) { if (LocalVariables.ContainsKey(name.ToLower())) { LocalVars.Remove(name.ToLower()); } }
public void AddVariable(string name, string content) { if (!GlobalVariables.ContainsKey(name.ToLower()) && !LocalVariables.ContainsKey(name.ToLower())) { var newVar = new Variable(name, content); LocalVars.Add(newVar.Name.ToLower(), newVar); } }
internal void LocalPop() { LocalVars local = lvtbl.prev; if (lvtbl.tbl != null) { lvtbl.tbl = null; } lvtbl = local; }
public string RenameVariable(string oldName, string newName) { string currentVarName = oldName; if (!GlobalVariables.ContainsKey(newName.ToLower()) && !LocalVariables.ContainsKey(newName.ToLower())) { LocalVars.Add(newName.ToLower(), LocalVariables[oldName.ToLower()]); LocalVars[newName.ToLower()].Name = newName; RemoveVariable(oldName.ToLower()); currentVarName = newName; } return(currentVarName); }
// the splicer assumes that this is the first method in // the class public ClassMethod(Application app) { application = app; nextBlock = Blocks.Enter; handlerBlock = Blocks.None; locals = new LocalVars(this); inputs = new InputVars(this); outputs = new OutputVars(this); }
public void ClearVariables() { LocalVars.Clear(); }
internal void LocalPush() { LocalVars local = new LocalVars(lvtbl, 0, 0); lvtbl = local; }