Exemplo n.º 1
0
 public void RemoveVariable(string name)
 {
     if (LocalVariables.ContainsKey(name.ToLower()))
     {
         LocalVars.Remove(name.ToLower());
     }
 }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
        internal void LocalPop()
        {
            LocalVars local = lvtbl.prev;

            if (lvtbl.tbl != null)
            {
                lvtbl.tbl = null;
            }
            lvtbl = local;
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 // 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);
 }
Exemplo n.º 6
0
 public void ClearVariables()
 {
     LocalVars.Clear();
 }
Exemplo n.º 7
0
        internal void LocalPush()
        {
            LocalVars local = new LocalVars(lvtbl, 0, 0);

            lvtbl = local;
        }