public List<Rule> GetRules(NonTerminal term) { return _productions[term].Select(p => new Rule(term, new List<Symbol>(p))).ToList(); }
public void Add(NonTerminal term, IEnumerable<Symbol> production) { if (!_productions.ContainsKey(term)) _productions.Add(term, new List<List<Symbol>>(1)); _productions[term].Add(production as List<Symbol> ?? production.ToList()); }
public Rule(NonTerminal name, List<Symbol> production) : this(name, production, 0) { }
protected Rule(NonTerminal name, List<Symbol> production, int dot) { Name = name; Production = production; Dot = dot; }
private EarleyRule(NonTerminal name, List<Symbol> production, int dot, int start) : base(name, production, dot) { Start = start; }
public EarleyRule(NonTerminal name, List<Symbol> production, int start) : this(name, production, 0, start) { }