Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/24/14 20:07:33 (10 years ago)
Author:
gkronber
Message:

#2026 fixed a bug in generation of terminal nodes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GPDL/CodeGenerator/ProblemCodeGen.cs

    r10393 r10394  
    7676      else return 1 + subtrees.Max(t=>t.GetDepth());
    7777    }
    78     public void PrintTree(int curState) {
     78    public virtual void PrintTree(int curState) {
    7979      Console.Write(""{0} "", Grammar.symb[curState]);
    8080      if(subtrees != null) {
     
    254254      }
    255255      sb.AppendFormat(" public {0}Tree() : base() {{ }}", terminal.Ident).AppendLine();
     256      sb.AppendLine(@"
     257          public override void PrintTree(int curState) {
     258            Console.Write(""{0} "", Grammar.symb[curState]);");
     259      foreach (var att in terminal.FieldDefinitions) {
     260        sb.AppendFormat("Console.Write(\"{{0}} \", {0});", att.Identifier).AppendLine();
     261      }
     262
     263      sb.AppendLine("}");
     264
    256265      sb.AppendLine("}");
    257266    }
Note: See TracChangeset for help on using the changeset viewer.