/// <summary> /// Método para fazer a verificação e inserção do terminal /// </summary> /// <param name="terminal"></param> /// <returns></returns> private bool AddTerminalToFirst(Terminal terminal, string rule) { string value = terminal.Value; if (!FirstList.ContainsKey(value)) { FirstList.Add(value, true); First element = new First(terminal, rule); Firsts.Add(element); return(true); } return(false); }
public bool AddFirst(string frs) { bool anyThingAdded = false; if (!Firsts.Contains(frs)) { Firsts.Add(frs); anyThingAdded = true; } if (frs == "epsilon") { isEpsilon = true; } return(anyThingAdded); }