- Timestamp:
- 10/18/13 21:33:56 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GPDL/HeuristicLab.Grammars/3.3/Grammar.cs
r10051 r10067 54 54 } 55 55 56 public v oid AddProductionRule(ISymbol ntSymbol, Sequence production) {56 public virtual void AddProductionRule(ISymbol ntSymbol, Sequence production) { 57 57 Debug.Assert(ntSymbol != EmptySymbol); 58 58 … … 96 96 var g = new Grammar(startSymbol); 97 97 foreach (var alt in m.Groups["alternative"].Captures) { 98 g.AddProductionRule(startSymbol, new Sequence(alt.ToString().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(n => new Symbol(n)) ));98 g.AddProductionRule(startSymbol, new Sequence(alt.ToString().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(n => new Symbol(n)).ToList<ISymbol>())); 99 99 } 100 100 foreach (var line in lines.Skip(1)) { … … 102 102 var ntSymbol = new Symbol(m.Groups["ntSymbol"].Value); 103 103 foreach (var alt in m.Groups["alternative"].Captures) { 104 g.AddProductionRule(ntSymbol, new Sequence(alt.ToString().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(n => new Symbol(n)) ));104 g.AddProductionRule(ntSymbol, new Sequence(alt.ToString().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(n => new Symbol(n)).ToList<ISymbol>())); 105 105 } 106 106 }
Note: See TracChangeset
for help on using the changeset viewer.