Changeset 231
- Timestamp:
- 08/04/06 10:28:21 (2 years ago)
- Files:
-
- trunk/enki/BaseParser.d (modified) (9 diffs)
- trunk/enki/CodeGenerator.d (modified) (2 diffs)
- trunk/enki/Directive.d (modified) (2 diffs)
- trunk/enki/EnkiParser.d (modified) (85 diffs)
- trunk/enki/Expression.d (modified) (9 diffs)
- trunk/enki/IParser.d (modified) (1 diff)
- trunk/enki/Rule.d (modified) (12 diffs)
- trunk/enki/bootstrap.d (modified) (2 diffs)
- trunk/enki/enki.bnf (modified) (2 diffs)
- trunk/enki/enki_bn.d (modified) (1 diff)
- trunk/enki/library/xml/XMLParser.bnf (modified) (1 diff)
- trunk/enki/library/xpath/xpath10.bnf (modified) (1 diff)
- trunk/enki/types.d (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/enki/BaseParser.d
r203 r231 36 36 private import std.stdio; 37 37 private import std.regexp; 38 private import std.utf; 38 39 39 40 alias ResultT!(bool) ResultBool; … … 71 72 72 73 /** error handling **/ 73 protected void setError( char[]text){74 protected void setError(String text){ 74 75 debug writefln("[%d] Error: %s",pos,text); 75 76 ErrorData data; … … 79 80 } 80 81 81 protected void setError( char[]text,int pos){82 protected void setError(String text,int pos){ 82 83 ErrorData data; 83 84 data.pos = pos; … … 101 102 } 102 103 } 103 result ~= std.string.format("(%d,%d) %s\n",line,err.pos-startOfLine+1,err.text);104 result ~= transcodeToString(std.string.format("(%d,%d) %s\n",line,err.pos-startOfLine+1,err.text)); 104 105 } 105 106 return result; … … 123 124 } 124 125 125 public ResultString terminal(u byte start){126 if(pos >= data.length || data[pos] != cast( char)start){126 public ResultString terminal(uint ch){ 127 if(pos >= data.length || data[pos] != cast(dchar)ch){ 127 128 //TODO: find an error message for this 128 129 //setError("Expected char"); … … 134 135 135 136 public ResultString regexp(String str){ 137 assert(false,"Regular Expressions are not supported."); 138 /* 136 139 if (auto m = std.regexp.search(data[pos..$],str)) 137 140 { … … 142 145 } 143 146 } 144 return ResultString(); 147 return ResultString();*/ 145 148 } 146 149 147 150 public ResultString range(uint start,uint end){ 148 assert(false,"32bit/dchar ranges not supported"); 149 } 150 151 public ResultString range(short start,short end){ 152 assert(false,"16bit/wchar ranges not supported"); 153 } 154 155 public ResultString range(ubyte start,ubyte end){ 156 if(pos >= data.length || !(data[pos] >= cast(char)start && data[pos] <= cast(char)end)){ 151 if(pos >= data.length || !(data[pos] >= cast(dchar)start && data[pos] <= cast(dchar)end)){ 157 152 //TODO: find an error message for this 158 153 //setError("Expected range"); … … 160 155 } 161 156 pos++; 162 return ResultString(data[pos-1..pos]); 157 return ResultString(data[pos-1..pos]); 163 158 } 164 159 … … 291 286 292 287 public ResultBool parse_err(){ 293 throw new Exception( getErrorReport());288 throw new Exception(toUTF8(getErrorReport())); 294 289 return ResultBool(false); 295 290 } trunk/enki/CodeGenerator.d
r203 r231 53 53 54 54 public void render(CodeGenerator generator,Statement passterm,Statement failterm){ 55 generator.emit("{/*do nothing*/}"); // statisfy presence of statment for labels 55 56 } 56 57 … … 70 71 71 72 public void render(CodeGenerator generator,Statement passterm,Statement failterm){ 72 generator.emit(name ~ ": ;");73 generator.emit(name ~ ":"); 73 74 } 74 75 } trunk/enki/Directive.d
r203 r231 1 1 /+ 2 Copyright (c) 2006 Eric Anderton 2 Copyright (c) 2006 Eric Anderton, BCS 3 3 4 4 Permission is hereby granted, free of charge, to any person … … 38 38 public String toBNF(){ 39 39 // do nothing 40 return ""; 40 41 } 41 42 42 43 public String toString(){ 43 44 // do nothing 45 return ""; 44 46 } 45 47 trunk/enki/EnkiParser.d
r203 r231 11 11 12 12 /+ 13 Copyright (c) 2006 Eric Anderton 13 Copyright (c) 2006 Eric Anderton, BCS 14 14 15 15 Permission is hereby granted, free of charge, to any person … … 43 43 public ResultT!(String) parse_Syntax(){ 44 44 debug writefln("parse_Syntax()"); 45 uint start = position;45 uint start1 = position; 46 46 SyntaxLine[] bind_lines; 47 47 48 48 49 49 {//Expression 50 uint start = position;50 uint start2 = position; 51 51 if(!(parse_ws().success)){ 52 52 goto mismatch4; 53 53 } 54 54 {//ZeroOrMoreExpr 55 uint start = position;55 uint start3 = position; 56 56 uint termPos; 57 loop5: ;57 loop5: 58 58 termPos = position; 59 59 if(parse_eoi().success){ … … 61 61 } 62 62 {//Expression 63 uint start = position;63 uint start4 = position; 64 64 {//Expression 65 uint start = position;65 uint start5 = position; 66 66 if((parse_Rule().assignCat!(SyntaxLine[])(bind_lines)) || (parse_Comment().assignCat!(SyntaxLine[])(bind_lines)) || (parse_Directive().assignCat!(SyntaxLine[])(bind_lines))){ 67 67 clearErrors(); 68 68 }else{ 69 69 setError("Expected Rule, Comment or Directive."); 70 position = start ;70 position = start5; 71 71 goto mismatch8; 72 72 } … … 76 76 } 77 77 goto match7; 78 mismatch8: ; 79 position = start; 78 mismatch8: 79 {/*do nothing*/} 80 position = start4; 80 81 goto mismatch4; 81 match7: ;82 match7: 82 83 clearErrors(); 83 84 goto loop5; 84 85 } 85 loopend6: ; 86 loopend6: 87 {/*do nothing*/} 86 88 } 87 89 goto match3; 88 mismatch4: ;90 mismatch4: 89 91 setError("Expected Whitespace."); 90 position = start ;92 position = start2; 91 93 goto mismatch2; 92 match3: ;94 match3: 93 95 clearErrors(); 94 96 goto match1; 95 97 } 96 match1: ;98 match1: 97 99 debug writefln("parse_Syntax() PASS"); 98 100 createSyntax(bind_lines); 99 return ResultT!(String)(sliceData(start ,position));100 mismatch2: ;101 position = start ;101 return ResultT!(String)(sliceData(start1,position)); 102 mismatch2: 103 position = start1; 102 104 return ResultT!(String)(); 103 105 } … … 112 114 public ResultT!(Rule) parse_Rule(){ 113 115 debug writefln("parse_Rule()"); 114 uint start = position;116 uint start6 = position; 115 117 String bind_name; 116 118 RulePredicate bind_pred; … … 120 122 121 123 {//Expression 122 uint start = position;124 uint start7 = position; 123 125 if(!(parse_ws().success)){ 124 126 goto mismatch12; … … 132 134 {//OptionalExpr 133 135 {//Expression 134 uint start = position;136 uint start9 = position; 135 137 if((parse_RuleDecl().assign!(RuleDecl)(bind_decl) && parse_ws().success)){ 136 138 clearErrors(); 137 139 }else{ 138 position = start ;140 position = start9; 139 141 } 140 142 } … … 142 144 {//OptionalExpr 143 145 {//Expression 144 uint start = position;146 uint start11 = position; 145 147 if((parse_RulePredicate().assign!(RulePredicate)(bind_pred))){ 146 148 clearErrors(); 147 149 }else{ 148 position = start ;150 position = start11; 149 151 } 150 152 } … … 169 171 } 170 172 goto match11; 171 mismatch12: ;173 mismatch12: 172 174 setError("Expected Whitespace."); 173 position = start ;175 position = start7; 174 176 goto mismatch10; 175 match11: ;177 match11: 176 178 clearErrors(); 177 179 goto match9; 178 180 } 179 match9: ;181 match9: 180 182 debug writefln("parse_Rule() PASS"); 181 183 ResultT!(Rule) passed = ResultT!(Rule)(new Rule(bind_name,bind_pred,bind_expr,bind_decl)); 182 184 return passed; 183 mismatch10: ;184 position = start ;185 mismatch10: 186 position = start6; 185 187 ResultT!(Rule) failed = ResultT!(Rule)(); 186 188 return failed; … … 196 198 public ResultT!(RuleDecl) parse_RuleDecl(){ 197 199 debug writefln("parse_RuleDecl()"); 198 uint start = position;200 uint start12 = position; 199 201 Param[] bind_params; 200 202 201 203 202 204 {//Expression 203 uint start = position;205 uint start13 = position; 204 206 if((parse_ParamsExpr().assign!(Param[])(bind_params))){ 205 207 clearErrors(); … … 207 209 }else{ 208 210 setError("Expected ParamsExpr."); 209 position = start ;211 position = start13; 210 212 goto mismatch14; 211 213 } 212 214 } 213 match13: ;215 match13: 214 216 debug writefln("parse_RuleDecl() PASS"); 215 217 ResultT!(RuleDecl) passed = ResultT!(RuleDecl)(new RuleDecl(bind_params)); 216 218 return passed; 217 mismatch14: ;218 position = start ;219 mismatch14: 220 position = start12; 219 221 ResultT!(RuleDecl) failed = ResultT!(RuleDecl)(); 220 222 return failed; … … 230 232 public ResultT!(RulePredicate) parse_RulePredicate(){ 231 233 debug writefln("parse_RulePredicate()"); 232 uint start = position;234 uint start14 = position; 233 235 RulePredicate bind_pred; 234 236 235 237 236 238 {//Expression 237 uint start = position;239 uint start15 = position; 238 240 if(!(terminal("=").success)){ 239 241 goto mismatch18; … … 243 245 } 244 246 {//Expression 245 uint start = position;247 uint start16 = position; 246 248 if((parse_ClassPredicate().assign!(RulePredicate)(bind_pred)) || (parse_FunctionPredicate().assign!(RulePredicate)(bind_pred)) || (parse_BindingPredicate().assign!(RulePredicate)(bind_pred))){ 247 249 clearErrors(); 248 250 }else{ 249 251 setError("Expected ClassPredicate, FunctionPredicate or BindingPredicate."); 250 position = start ;252 position = start16; 251 253 goto mismatch18; 252 254 } 253 255 } 254 256 goto match17; 255 mismatch18: ; 256 position = start; 257 mismatch18: 258 {/*do nothing*/} 259 position = start15; 257 260 goto mismatch16; 258 match17: ;261 match17: 259 262 clearErrors(); 260 263 goto match15; 261 264 } 262 match15: ;265 match15: 263 266 debug writefln("parse_RulePredicate() PASS"); 264 267 return ResultT!(RulePredicate)(bind_pred); 265 mismatch16: ;266 position = start ;268 mismatch16: 269 position = start14; 267 270 return ResultT!(RulePredicate)(); 268 271 } … … 277 280 public ResultT!(ClassPredicate) parse_ClassPredicate(){ 278 281 debug writefln("parse_ClassPredicate()"); 279 uint start = position;282 uint start17 = position; 280 283 String bind_name; 281 284 Param[] bind_params; … … 283 286 284 287 {//Expression 285 uint start = position;288 uint start18 = position; 286 289 if((terminal("new").success && parse_ws().success && parse_Identifier().assign!(String)(bind_name) && parse_ws().success && parse_ParamsExpr().assign!(Param[])(bind_params))){ 287 290 clearErrors(); 288 291 goto match19; 289 292 }else{ 290 position = start ;293 position = start18; 291 294 goto mismatch20; 292 295 } 293 296 } 294 match19: ;297 match19: 295 298 debug writefln("parse_ClassPredicate() PASS"); 296 299 ResultT!(ClassPredicate) passed = ResultT!(ClassPredicate)(new ClassPredicate(bind_name,bind_params)); 297 300 return passed; 298 mismatch20: ;299 position = start ;301 mismatch20: 302 position = start17; 300 303 ResultT!(ClassPredicate) failed = ResultT!(ClassPredicate)(); 301 304 return failed; … … 311 314 public ResultT!(FunctionPredicate) parse_FunctionPredicate(){ 312 315 debug writefln("parse_FunctionPredicate()"); 313 uint start = position;316 uint start19 = position; 314 317 Param bind_decl; 315 318 Param[] bind_params; … … 317 320 318 321 {//Expression 319 uint start = position;322 uint start20 = position; 320 323 if((parse_ExplicitParam().assign!(Param)(bind_decl) && parse_ws().success && parse_ParamsExpr().assign!(Param[])(bind_params))){ 321 324 clearErrors(); … … 323 326 }else{ 324 327 setError("Expected ExplicitParam."); 325 position = start ;328 position = start20; 326 329 goto mismatch22; 327 330 } 328 331 } 329 match21: ;332 match21: 330 333 debug writefln("parse_FunctionPredicate() PASS"); 331 334 ResultT!(FunctionPredicate) passed = ResultT!(FunctionPredicate)(new FunctionPredicate(bind_decl,bind_params)); 332 335 return passed; 333 mismatch22: ;334 position = start ;336 mismatch22: 337 position = start19; 335 338 ResultT!(FunctionPredicate) failed = ResultT!(FunctionPredicate)(); 336 339 return failed; … … 346 349 public ResultT!(BindingPredicate) parse_BindingPredicate(){ 347 350 debug writefln("parse_BindingPredicate()"); 348 uint start = position;351 uint start21 = position; 349 352 Param bind_param; 350 353 351 354 352 355 {//Expression 353 uint start = position;356 uint start22 = position; 354 357 if((parse_Param().assign!(Param)(bind_param))){ 355 358 clearErrors(); … … 357 360 }else{ 358 361 setError("Expected Param."); 359 position = start ;362 position = start22; 360 363 goto mismatch24; 361 364 } 362 365 } 363 match23: ;366 match23: 364 367 debug writefln("parse_BindingPredicate() PASS"); 365 368 ResultT!(BindingPredicate) passed = ResultT!(BindingPredicate)(new BindingPredicate(bind_param)); 366 369 return passed; 367 mismatch24: ;368 position = start ;370 mismatch24: 371 position = start21; 369 372 ResultT!(BindingPredicate) failed = ResultT!(BindingPredicate)(); 370 373 return failed; … … 380 383 public ResultT!(Param[]) parse_ParamsExpr(){ 381 384 debug writefln("parse_ParamsExpr()"); 382 uint start = position;385 uint start23 = position; 383 386 Param[] bind_params; 384 387 385 388 386 389 {//Expression 387 uint start = position;390 uint start24 = position; 388 391 if(!(terminal("(").success)){ 389 392 goto mismatch28; … … 394 397 {//OptionalExpr 395 398 {//Expression 396 uint start = position;399 uint start26 = position; 397 400 if(!(parse_Param().assignCat!(Param[])(bind_params))){ 398 401 goto mismatch30; … … 403 406 {//ZeroOrMoreExpr 404 407 uint termPos; 405 loop31: ;408 loop31: 406 409 termPos = position; 407 410 {//Expression 408 uint start = position;411 uint start28 = position; 409 412 if((terminal(",").success && parse_ws().success && parse_Param().assignCat!(Param[])(bind_params) && parse_ws().success)){ 410 413 clearErrors(); 411 414 goto loop31; 412 415 }else{ 413 position = start ;416 position = start28; 414 417 goto loopend32; 415 418 } 416 419 } 417 loopend32: ; 420 loopend32: 421 {/*do nothing*/} 418 422 } 419 423 goto match29; 420 mismatch30: ; 421 position = start; 422 match29: ; 424 mismatch30: 425 {/*do nothing*/} 426 position = start26; 427 {/*do nothing*/} 428 match29: 423 429 clearErrors(); 430 {/*do nothing*/} 424 431 } 425 432 } … … 428 435 } 429 436 goto match27; 430 mismatch28: ; 431 position = start; 437 mismatch28: 438 {/*do nothing*/} 439 position = start24; 432 440 goto mismatch26; 433 match27: ;441 match27: 434 442 clearErrors(); 435 443 goto match25; 436 444 } 437 match25: ;445 match25: 438 446 debug writefln("parse_ParamsExpr() PASS"); 439 447 return ResultT!(Param[])(bind_params); 440 mismatch26: ;441 position = start ;448 mismatch26: 449 position = start23; 442 450 return ResultT!(Param[])(); 443 451 } … … 452 460 public ResultT!(Param) parse_Param(){ 453 461 debug writefln("parse_Param()"); 454 uint start = position;462 uint start29 = position; 455 463 Param bind_param; 456 464 457 465 458 466 {//Expression 459 uint start = position;467 uint start30 = position; 460 468 if((parse_ExplicitParam().assign!(Param)(bind_param)) || (parse_WeakParam().assign!(Param)(bind_param))){ 461 469 clearErrors(); … … 463 471 }else{ 464 472 setError("Expected ExplicitParam or WeakParam."); 465 position = start ;473 position = start30; 466 474 goto mismatch34; 467 475 } 468 476 } 469 match33: ;477 match33: 470 478 debug writefln("parse_Param() PASS"); 471 479 return ResultT!(Param)(bind_param); 472 mismatch34: ;473 position = start ;480 mismatch34: 481 position = start29; 474 482 return ResultT!(Param)(); 475 483 } … … 484 492 public ResultT!(Param) parse_WeakParam(){ 485 493 debug writefln("parse_WeakParam()"); 486 uint start = position;494 uint start31 = position; 487 495 String bind_name; 488 496 489 497 490 498 {//Expression 491 uint start = position;499 uint start32 = position; 492 500 if((parse_Identifier().assign!(String)(bind_name))){ 493 501 clearErrors(); … … 495 503 }else{ 496 504 setError("Expected Identifier."); 497 position = start ;505 position = start32; 498 506 goto mismatch36; 499 507 } 500 508 } 501 match35: ;509 match35: 502 510 debug writefln("parse_WeakParam() PASS"); 503 511 ResultT!(Param) passed = ResultT!(Param)(new Param(bind_name)); 504 512 return passed; 505 mismatch36: ;506 position = start ;513 mismatch36: 514 position = start31; 507 515 ResultT!(Param) failed = ResultT!(Param)(); 508 516 return failed; … … 513 521 ExplicitParam 514 522 = new Param(bool isArray,String type,String name) 515 ::= Identifier:type ws [ "[]":isArray ws] Identifier:name ;523 ::= Identifier:type ws [ "[]":isArray Brackets ws] Identifier:name ; 516 524 517 525 */ 518 526 public ResultT!(Param) parse_ExplicitParam(){ 519 527 debug writefln("parse_ExplicitParam()"); 520 uint start = position;528 uint start33 = position; 521 529 bool bind_isArray; 522 530 String bind_type; … … 525 533 526 534 {//Expression 527 uint start = position;535 uint start34 = position; 528 536 if(!(parse_Identifier().assign!(String)(bind_type))){ 529 537 goto mismatch40; … … 534 542 {//OptionalExpr 535 543 {//Expression 536 uint start = position;537 if((terminal("[]").assign!(bool)(bind_isArray) && parse_ ws().success)){544 uint start36 = position; 545 if((terminal("[]").assign!(bool)(bind_isArray) && parse_Brackets().success && parse_ws().success)){ 538 546 clearErrors(); 539 547 }else{ 540 position = start ;548 position = start36; 541 549 } 542 550 } … … 546 554 } 547 555 goto match39; 548 mismatch40: ;556 mismatch40: 549 557 setError("Expected Identifier."); 550 position = start ;558 position = start34; 551 559 goto mismatch38; 552 match39: ;560 match39: 553 561 clearErrors(); 554 562 goto match37; 555 563 } 556 match37: ;564 match37: 557 565 debug writefln("parse_ExplicitParam() PASS"); 558 566 ResultT!(Param) passed = ResultT!(Param)(new Param(bind_isArray,bind_type,bind_name)); 559 567 return passed; 560 mismatch38: ;561 position = start ;568 mismatch38: 569 position = start33; 562 570 ResultT!(Param) failed = ResultT!(Param)(); 563 571 return failed; 572 } 573 574 /* 575 576 Brackets 577 ::= [ "[]" Brackets] ; 578 579 */ 580 public ResultT!(bool) parse_Brackets(){ 581 debug writefln("parse_Brackets()"); 582 uint start37 = position; 583 //no declarations 584 585 586 {//Expression 587 uint start38 = position; 588 {//OptionalExpr 589 {//Expression 590 uint start40 = position; 591 if((terminal("[]").success && parse_Brackets().success)){ 592 clearErrors(); 593 }else{ 594 position = start40; 595 } 596 } 597 } 598 goto match43; 599 mismatch44: 600 {/*do nothing*/} 601 position = start38; 602 goto mismatch42; 603 match43: 604 clearErrors(); 605 goto match41; 606 } 607 match41: 608 debug writefln("parse_Brackets() PASS"); 609 return ResultT!(bool)(true); 610 mismatch42: 611 position = start37; 612 return ResultT!(bool)(); 564 613 } 565 614 … … 573 622 public ResultT!(Expression) parse_Expression(){ 574 623 debug writefln("parse_Expression()"); 575 uint start = position;624 uint start41 = position; 576 625 Term[] bind_terms; 577 626 578 627 579 628 {//Expression 580 uint start = position;629 uint start42 = position; 581 630 if(!(parse_Term().assignCat!(Term[])(bind_terms))){ 582 goto mismatch4 4;583 } 584 if(!(parse_ws().success)){ 585 goto mismatch4 4;631 goto mismatch48; 632 } 633 if(!(parse_ws().success)){ 634 goto mismatch48; 586 635 } 587 636 {//ZeroOrMoreExpr 588 637 uint termPos; 589 loop4 5: ;638 loop49: 590 639 termPos = position; 591 640 {//Expression 592 uint start = position;641 uint start44 = position; 593 642 if((terminal("|").success && parse_ws().success && parse_Term().assignCat!(Term[])(bind_terms) && parse_ws().success)){ 594 643 clearErrors(); 595 goto loop4 5;644 goto loop49; 596 645 }else{ 597 position = start; 598 goto loopend46; 599 } 600 } 601 loopend46: ; 602 } 603 goto match43; 604 mismatch44: ; 646 position = start44; 647 goto loopend50; 648 } 649 } 650 loopend50: 651 {/*do nothing*/} 652 } 653 goto match47; 654 mismatch48: 605 655 setError("Expected Term."); 606 position = start ;607 goto mismatch4 2;608 match4 3: ;609 clearErrors(); 610 goto match4 1;611 } 612 match4 1: ;656 position = start42; 657 goto mismatch46; 658 match47: 659 clearErrors(); 660 goto match45; 661 } 662 match45: 613 663 debug writefln("parse_Expression() PASS"); 614 664 ResultT!(Expression) passed = ResultT!(Expression)(new Expression(bind_terms)); 615 665 return passed; 616 mismatch4 2: ;617 position = start ;666 mismatch46: 667 position = start41; 618 668 ResultT!(Expression) failed = ResultT!(Expression)(); 619 669 return failed; … … 629 679 public ResultT!(SubExpression[]) parse_Term(){ 630 680 debug writefln("parse_Term()"); 631 uint start = position;681 uint start45 = position; 632 682 SubExpression[] bind_factors; 633 683 634 684 635 685 {//Expression 636 uint start = position;686 uint start46 = position; 637 687 if(!(parse_SubExpression().assignCat!(SubExpression[])(bind_factors))){ 638 goto mismatch5 0;639 } 640 if(!(parse_ws().success)){ 641 goto mismatch5 0;688 goto mismatch54; 689 } 690 if(!(parse_ws().success)){ 691 goto mismatch54; 642 692 } 643 693 {//ZeroOrMoreExpr 644 694 uint termPos; 645 loop5 1: ;695 loop55: 646 696 termPos = position; 647 697 {//Expression 648 uint start = position;698 uint start48 = position; 649 699 if((parse_SubExpression().assignCat!(SubExpression[])(bind_factors) && parse_ws().success)){ 650 700 clearErrors(); 651 goto loop5 1;701 goto loop55; 652 702 }else{ 653 703 setError("Expected SubExpression."); 654 position = start; 655 goto loopend52; 656 } 657 } 658 loopend52: ; 659 } 660 goto match49; 661 mismatch50: ; 704 position = start48; 705 goto loopend56; 706 } 707 } 708 loopend56: 709 {/*do nothing*/} 710 } 711 goto match53; 712 mismatch54: 662 713 setError("Expected SubExpression."); 663 position = start ;664 goto mismatch 48;665 match 49: ;666 clearErrors(); 667 goto match 47;668 } 669 match 47: ;714 position = start46; 715 goto mismatch52; 716 match53: 717 clearErrors(); 718 goto match51; 719 } 720 match51: 670 721 debug writefln("parse_Term() PASS"); 671 722 return ResultT!(SubExpression[])(bind_factors); 672 mismatch 48: ;673 position = start ;723 mismatch52: 724 position = start45; 674 725 return ResultT!(SubExpression[])(); 675 726 } … … 684 735 public ResultT!(SubExpression) parse_SubExpression(){ 685 736 debug writefln("parse_SubExpression()"); 686 uint start = position;737 uint start49 = position; 687 738 SubExpression bind_expr; 688 739 689 740 690 741 {//Expression 691 uint start = position;742 uint start50 = position; 692 743 if((parse_Production().assign!(SubExpression)(bind_expr)) || (parse_Substitution().assign!(SubExpression)(bind_expr)) || (parse_Terminal().assign!(SubExpression)(bind_expr)) || (parse_Range().assign!(SubExpression)(bind_expr)) || (parse_Regexp().assign!(SubExpression)(bind_expr)) || (parse_GroupExpr().assign!(SubExpression)(bind_expr)) || (parse_OptionalExpr().assign!(SubExpression)(bind_expr)) || (parse_ZeroOrMoreExpr().assign!(SubExpression)(bind_expr)) || (parse_NegateExpr().assign!(SubExpression)(bind_expr)) || (parse_TestExpr().assign!(SubExpression)(bind_expr)) || (parse_LiteralExpr().assign!(SubExpression)(bind_expr)) || (parse_CustomTerminal().assign!(SubExpression)(bind_expr))){ 693 744 clearErrors(); 694 goto match5 3;745 goto match57; 695 746 }else{ 696 747
