Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/19/13 08:48:19 (11 years ago)
Author:
gkronber
Message:

#2026 attributes for NT- and T-symbols are optional (incorrectly translated from Coco-2 yesterday)

Location:
branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/GPDef.atg

    r9724 r9727  
    66
    77COMPILER GPDef
    8   static StringBuilder srcText;
    98  public static HeuristicLab.Optimization.IProblem problem;
    10   static string lastSrc;
    119 
    1210CHARACTERS
     
    3230
    3331  GPDef =                                                                         (.
    34                                                                                     string identStr = "";
    3532                                                                                    RuleNode ruleNode = null;
    3633                                                                                    GPDefNode gpDef = new GPDefNode();
     
    8178  NonterminalDecl<out NonTerminalNode ntNode> =                                   (. string identStr = ""; ntNode = null; string src = ""; .)
    8279    ident                                                                         (. identStr = t.val; .)
    83     SourceCode<out src>                                                           (.
     80    [ SourceCode<out src> ]                                                       (.
    8481                                                                                    var myNtNode = new NonTerminalNode();
    8582                                                                                    ntNode = myNtNode;
     
    9996                                                                                  .)
    10097  ident                                                                           (. identStr = t.val; .)
    101   SourceCode<out src>                                                             (.
     98  [ SourceCode<out src> ]                                                         (.
    10299                                                                                         myTNode = new TerminalNode();
    103100                                                                                         tNode = myTNode;
     
    125122  /******************************************************/
    126123  ConstraintRule<out ConstraintNode constraint> =                                 (.
    127                                                                                     string identStr = null;
    128124                                                                                    constraint = null;
    129125                                                                                  .)
     
    153149                                                                                  .)
    154150  ident                                                                           (. identStr = t.val; .)
    155   SourceCode<out src> '='                                                         (.
     151  [ SourceCode<out src> ] '='                                                     (.
    156152                                                                                      myRule = new RuleNode();
    157153                                                                                      rule = myRule;
     
    199195                                                                                   string src = "";
    200196                                                                                 .)
    201     (ident                                                                        (. identStr = t.val; .)
    202      SourceCode<out src>                                                          (.
     197    (ident                                                                       (. identStr = t.val; .)
     198     [ SourceCode<out src> ]                                                     (.
    203199                                                                                    var callNode = new CallSymbolNode{Ident = identStr};
    204200                                                                                    callNode.ActualParameter = src;
  • branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Parser.cs

    r9724 r9727  
    2727  int errDist = minErrDist;
    2828
    29 static StringBuilder srcText;
    30   public static HeuristicLab.Optimization.IProblem problem;
    31   static string lastSrc;
     29public static HeuristicLab.Optimization.IProblem problem;
    3230 
    3331
     
    103101
    104102  void GPDef() {
    105     string identStr = "";
    106103    RuleNode ruleNode = null;
    107104    GPDefNode gpDef = new GPDefNode();
     
    164161    Expect(1);
    165162    identStr = t.val;
    166     SourceCode(out src);
     163    if (la.kind == 2) {
     164      SourceCode(out src);
     165    }
    167166    var myNtNode = new NonTerminalNode();
    168167    ntNode = myNtNode;
     
    182181    Expect(1);
    183182    identStr = t.val;
    184     SourceCode(out src);
     183    if (la.kind == 2) {
     184      SourceCode(out src);
     185    }
    185186    myTNode = new TerminalNode();
    186187    tNode = myTNode;
     
    206207    Expect(1);
    207208    identStr = t.val;
    208     SourceCode(out src);
     209    if (la.kind == 2) {
     210      SourceCode(out src);
     211    }
    209212    Expect(20);
    210213    myRule = new RuleNode();
     
    247250
    248251  void ConstraintRule(out ConstraintNode constraint) {
    249     string identStr = null;
    250252    constraint = null;
    251253   
     
    310312      Get();
    311313      identStr = t.val;
    312       SourceCode(out src);
     314      if (la.kind == 2) {
     315        SourceCode(out src);
     316      }
    313317      var callNode = new CallSymbolNode{Ident = identStr};
    314318      callNode.ActualParameter = src;
Note: See TracChangeset for help on using the changeset viewer.