Example #1
0
 public List<Rule> GetRules(NonTerminal term)
 {
     return _productions[term].Select(p => new Rule(term, new List<Symbol>(p))).ToList();
 }
Example #2
0
 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());
 }
Example #3
0
File: Rule.cs Project: surenkov/UCP
 public Rule(NonTerminal name, List<Symbol> production)
     : this(name, production, 0)
 { }
Example #4
0
File: Rule.cs Project: surenkov/UCP
 protected Rule(NonTerminal name, List<Symbol> production, int dot)
 {
     Name = name;
     Production = production;
     Dot = dot;
 }
Example #5
0
 private EarleyRule(NonTerminal name, List<Symbol> production, int dot, int start)
     : base(name, production, dot)
 {
     Start = start;
 }
Example #6
0
 public EarleyRule(NonTerminal name, List<Symbol> production, int start)
     : this(name, production, 0, start)
 {
 }