/*************************/ /*** Private Functions ***/ /*************************/ /// <summary> /// Add() - Adds a command to the command dictionary. The command is <br/> /// added to the dictionary with its name as the key. The command is <br/> /// retrieved from the dictionary each time it is needed for parsing. /// </summary> /// <param name="command">New command to populate the dictionary</param> private void Add(ProgCmd command) { if (command != null) { cmdDict.Add(command.CommandName, command); } }
public ProgCmd GetProgCmd(string keyword) { ProgCmd command = null; if (!cmdDict.TryGetValue(keyword, out command)) { command = null; } return(command); }
public ProgNode GetCommand() { ProgNode node = null; string variable = parser.GetToken().GetString(); string keyword = variable.ToUpper(); ProgCmd command = parser.GetProgCmd(keyword); if (command != null) { node = command.Interpret(this); } else { Token assignToken = parser.GetToken(); ProgNode expression = Expression(); node = new ProgNodeAssign(variable, expression); } return(node); }