Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/18/13 21:33:56 (11 years ago)
Author:
gkronber
Message:

#2026 worked on brute force solver for GPDL problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GPDL/HeuristicLab.Grammars/3.3/Grammar.cs

    r10051 r10067  
    5454    }
    5555
    56     public void AddProductionRule(ISymbol ntSymbol, Sequence production) {
     56    public virtual void AddProductionRule(ISymbol ntSymbol, Sequence production) {
    5757      Debug.Assert(ntSymbol != EmptySymbol);
    5858
     
    9696      var g = new Grammar(startSymbol);
    9797      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>()));
    9999      }
    100100      foreach (var line in lines.Skip(1)) {
     
    102102        var ntSymbol = new Symbol(m.Groups["ntSymbol"].Value);
    103103        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>()));
    105105        }
    106106      }
Note: See TracChangeset for help on using the changeset viewer.