- Timestamp:
- 07/19/13 08:48:19 (11 years ago)
- 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 6 6 7 7 COMPILER GPDef 8 static StringBuilder srcText;9 8 public static HeuristicLab.Optimization.IProblem problem; 10 static string lastSrc;11 9 12 10 CHARACTERS … … 32 30 33 31 GPDef = (. 34 string identStr = "";35 32 RuleNode ruleNode = null; 36 33 GPDefNode gpDef = new GPDefNode(); … … 81 78 NonterminalDecl<out NonTerminalNode ntNode> = (. string identStr = ""; ntNode = null; string src = ""; .) 82 79 ident (. identStr = t.val; .) 83 SourceCode<out src>(.80 [ SourceCode<out src> ] (. 84 81 var myNtNode = new NonTerminalNode(); 85 82 ntNode = myNtNode; … … 99 96 .) 100 97 ident (. identStr = t.val; .) 101 SourceCode<out src>(.98 [ SourceCode<out src> ] (. 102 99 myTNode = new TerminalNode(); 103 100 tNode = myTNode; … … 125 122 /******************************************************/ 126 123 ConstraintRule<out ConstraintNode constraint> = (. 127 string identStr = null;128 124 constraint = null; 129 125 .) … … 153 149 .) 154 150 ident (. identStr = t.val; .) 155 SourceCode<out src> '='(.151 [ SourceCode<out src> ] '=' (. 156 152 myRule = new RuleNode(); 157 153 rule = myRule; … … 199 195 string src = ""; 200 196 .) 201 (ident 202 SourceCode<out src>(.197 (ident (. identStr = t.val; .) 198 [ SourceCode<out src> ] (. 203 199 var callNode = new CallSymbolNode{Ident = identStr}; 204 200 callNode.ActualParameter = src; -
branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL/3.4/Parser.cs
r9724 r9727 27 27 int errDist = minErrDist; 28 28 29 static StringBuilder srcText; 30 public static HeuristicLab.Optimization.IProblem problem; 31 static string lastSrc; 29 public static HeuristicLab.Optimization.IProblem problem; 32 30 33 31 … … 103 101 104 102 void GPDef() { 105 string identStr = "";106 103 RuleNode ruleNode = null; 107 104 GPDefNode gpDef = new GPDefNode(); … … 164 161 Expect(1); 165 162 identStr = t.val; 166 SourceCode(out src); 163 if (la.kind == 2) { 164 SourceCode(out src); 165 } 167 166 var myNtNode = new NonTerminalNode(); 168 167 ntNode = myNtNode; … … 182 181 Expect(1); 183 182 identStr = t.val; 184 SourceCode(out src); 183 if (la.kind == 2) { 184 SourceCode(out src); 185 } 185 186 myTNode = new TerminalNode(); 186 187 tNode = myTNode; … … 206 207 Expect(1); 207 208 identStr = t.val; 208 SourceCode(out src); 209 if (la.kind == 2) { 210 SourceCode(out src); 211 } 209 212 Expect(20); 210 213 myRule = new RuleNode(); … … 247 250 248 251 void ConstraintRule(out ConstraintNode constraint) { 249 string identStr = null;250 252 constraint = null; 251 253 … … 310 312 Get(); 311 313 identStr = t.val; 312 SourceCode(out src); 314 if (la.kind == 2) { 315 SourceCode(out src); 316 } 313 317 var callNode = new CallSymbolNode{Ident = identStr}; 314 318 callNode.ActualParameter = src;
Note: See TracChangeset
for help on using the changeset viewer.