Changeset 240
- Timestamp:
- 08/13/06 16:33:29 (2 years ago)
- Files:
-
- trunk/enki/EnkiParser.d (modified) (227 diffs)
- trunk/enki/Expression.d (modified) (1 diff)
- trunk/enki/bootstrap.d (modified) (2 diffs)
- trunk/enki/enki.bnf (modified) (5 diffs)
- trunk/enki/library/d/Operator.bnf (modified) (1 diff)
- trunk/enki/library/d/Tokenizer.bnf (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/enki/EnkiParser.d
r237 r240 43 43 44 44 WS 45 ::= ws [ ( SlashSlashComment | SlashStarComment) ws];45 ::= ws [ ( SlashSlashComment | SlashStarComment) WS]; 46 46 47 47 */ … … 70 70 } 71 71 } 72 if(!(parse_ ws().success)){72 if(!(parse_WS().success)){ 73 73 goto mismatch6; 74 74 } … … 85 85 goto match3; 86 86 mismatch4: 87 setError("Expected Whitespace.");87 setError("Expected ws."); 88 88 position = start2; 89 89 goto mismatch2; … … 104 104 Syntax 105 105 = void createSyntax(SyntaxLine[] lines) 106 ::= WS { ( Rule:~lines | Comment:~lines | Directive:~lines) WS}eoi;106 ::= WS { ( Rule:~lines | Comment:~lines | Directive:~lines) WS} eoi; 107 107 108 108 */ … … 120 120 {//ZeroOrMoreExpr 121 121 uint start8 = position; 122 uint termPos ;122 uint termPos9; 123 123 loop11: 124 termPos = position;124 termPos9 = position; 125 125 if(parse_eoi().success){ 126 126 goto loopend12; 127 127 } 128 128 {//Expression 129 uint start 9= position;129 uint start10 = position; 130 130 {//Expression 131 uint start1 0= position;131 uint start11 = position; 132 132 if((parse_Rule().assignCat!(SyntaxLine[])(bind_lines)) || (parse_Comment().assignCat!(SyntaxLine[])(bind_lines)) || (parse_Directive().assignCat!(SyntaxLine[])(bind_lines))){ 133 133 clearErrors(); 134 134 }else{ 135 135 setError("Expected Rule, Comment or Directive."); 136 position = start1 0;136 position = start11; 137 137 goto mismatch14; 138 138 } … … 144 144 mismatch14: 145 145 {/*do nothing*/} 146 position = start 9;146 position = start10; 147 147 goto mismatch10; 148 148 match13: … … 175 175 Rule 176 176 = new Rule(String name,RulePredicate pred,Expression expr,RuleDecl decl) 177 ::= WS Identifier:name WS [ RuleDecl:decl WS] [ RulePredicate:pred] WS "::=" WS Expression:expr WS";";177 ::= Identifier:name WS [ RuleDecl:decl WS] [ RulePredicate:pred] WS "::=" WS Expression:expr WS ";"; 178 178 179 179 */ 180 180 public ResultT!(Rule) parse_Rule(){ 181 181 debug writefln("parse_Rule()"); 182 uint start1 1= position;182 uint start12 = position; 183 183 String bind_name; 184 184 RulePredicate bind_pred; … … 188 188 189 189 {//Expression 190 uint start12 = position; 191 if(!(parse_WS().success)){ 192 goto mismatch18; 193 } 190 uint start13 = position; 194 191 if(!(parse_Identifier().assign!(String)(bind_name))){ 195 192 goto mismatch18; … … 200 197 {//OptionalExpr 201 198 {//Expression 202 uint start1 4= position;199 uint start15 = position; 203 200 if((parse_RuleDecl().assign!(RuleDecl)(bind_decl) && parse_WS().success)){ 204 201 clearErrors(); 205 202 }else{ 206 position = start1 4;203 position = start15; 207 204 } 208 205 } … … 210 207 {//OptionalExpr 211 208 {//Expression 212 uint start1 6= position;209 uint start17 = position; 213 210 if((parse_RulePredicate().assign!(RulePredicate)(bind_pred))){ 214 211 clearErrors(); 215 212 }else{ 216 position = start1 6;213 position = start17; 217 214 } 218 215 } … … 238 235 goto match17; 239 236 mismatch18: 240 setError("Expected WS.");241 position = start1 2;237 setError("Expected Identifier."); 238 position = start13; 242 239 goto mismatch16; 243 240 match17: … … 250 247 return passed; 251 248 mismatch16: 252 position = start1 1;249 position = start12; 253 250 ResultT!(Rule) failed = ResultT!(Rule)(); 254 251 return failed; … … 259 256 RuleDecl 260 257 = new RuleDecl(Param[] params) 261 ::= ParamsExpr:params;258 ::= ParamsExpr:params; 262 259 263 260 */ 264 261 public ResultT!(RuleDecl) parse_RuleDecl(){ 265 262 debug writefln("parse_RuleDecl()"); 266 uint start1 7= position;263 uint start18 = position; 267 264 Param[] bind_params; 268 265 269 266 270 267 {//Expression 271 uint start1 8= position;268 uint start19 = position; 272 269 if((parse_ParamsExpr().assign!(Param[])(bind_params))){ 273 270 clearErrors(); … … 275 272 }else{ 276 273 setError("Expected ParamsExpr."); 277 position = start1 8;274 position = start19; 278 275 goto mismatch20; 279 276 } … … 284 281 return passed; 285 282 mismatch20: 286 position = start1 7;283 position = start18; 287 284 ResultT!(RuleDecl) failed = ResultT!(RuleDecl)(); 288 285 return failed; … … 293 290 RulePredicate 294 291 = RulePredicate pred 295 ::= "=" WS ( ClassPredicate:pred | FunctionPredicate:pred |BindingPredicate:pred);292 ::= "=" WS ( ClassPredicate:pred | FunctionPredicate:pred | BindingPredicate:pred); 296 293 297 294 */ 298 295 public ResultT!(RulePredicate) parse_RulePredicate(){ 299 296 debug writefln("parse_RulePredicate()"); 300 uint start 19= position;297 uint start20 = position; 301 298 RulePredicate bind_pred; 302 299 303 300 304 301 {//Expression 305 uint start2 0= position;302 uint start21 = position; 306 303 if(!(terminal("=").success)){ 307 304 goto mismatch24; … … 311 308 } 312 309 {//Expression 313 uint start2 1= position;310 uint start22 = position; 314 311 if((parse_ClassPredicate().assign!(RulePredicate)(bind_pred)) || (parse_FunctionPredicate().assign!(RulePredicate)(bind_pred)) || (parse_BindingPredicate().assign!(RulePredicate)(bind_pred))){ 315 312 clearErrors(); 316 313 }else{ 317 314 setError("Expected ClassPredicate, FunctionPredicate or BindingPredicate."); 318 position = start2 1;315 position = start22; 319 316 goto mismatch24; 320 317 } … … 323 320 mismatch24: 324 321 {/*do nothing*/} 325 position = start2 0;322 position = start21; 326 323 goto mismatch22; 327 324 match23: … … 333 330 return ResultT!(RulePredicate)(bind_pred); 334 331 mismatch22: 335 position = start 19;332 position = start20; 336 333 return ResultT!(RulePredicate)(); 337 334 } … … 341 338 ClassPredicate 342 339 = new ClassPredicate(String name,Param[] params) 343 ::= "new" WS Identifier:name WSParamsExpr:params;340 ::= "new" WS Identifier:name WS ParamsExpr:params; 344 341 345 342 */ 346 343 public ResultT!(ClassPredicate) parse_ClassPredicate(){ 347 344 debug writefln("parse_ClassPredicate()"); 348 uint start2 2= position;345 uint start23 = position; 349 346 String bind_name; 350 347 Param[] bind_params; … … 352 349 353 350 {//Expression 354 uint start2 3= position;351 uint start24 = position; 355 352 if((terminal("new").success && parse_WS().success && parse_Identifier().assign!(String)(bind_name) && parse_WS().success && parse_ParamsExpr().assign!(Param[])(bind_params))){ 356 353 clearErrors(); 357 354 goto match25; 358 355 }else{ 359 position = start2 3;356 position = start24; 360 357 goto mismatch26; 361 358 } … … 366 363 return passed; 367 364 mismatch26: 368 position = start2 2;365 position = start23; 369 366 ResultT!(ClassPredicate) failed = ResultT!(ClassPredicate)(); 370 367 return failed; … … 375 372 FunctionPredicate 376 373 = new FunctionPredicate(Param decl,Param[] params) 377 ::= ExplicitParam:decl WSParamsExpr:params;374 ::= ExplicitParam:decl WS ParamsExpr:params; 378 375 379 376 */ 380 377 public ResultT!(FunctionPredicate) parse_FunctionPredicate(){ 381 378 debug writefln("parse_FunctionPredicate()"); 382 uint start2 4= position;379 uint start25 = position; 383 380 Param bind_decl; 384 381 Param[] bind_params; … … 386 383 387 384 {//Expression 388 uint start2 5= position;385 uint start26 = position; 389 386 if((parse_ExplicitParam().assign!(Param)(bind_decl) && parse_WS().success && parse_ParamsExpr().assign!(Param[])(bind_params))){ 390 387 clearErrors(); … … 392 389 }else{ 393 390 setError("Expected ExplicitParam."); 394 position = start2 5;391 position = start26; 395 392 goto mismatch28; 396 393 } … … 401 398 return passed; 402 399 mismatch28: 403 position = start2 4;400 position = start25; 404 401 ResultT!(FunctionPredicate) failed = ResultT!(FunctionPredicate)(); 405 402 return failed; … … 410 407 BindingPredicate 411 408 = new BindingPredicate(Param param) 412 ::= Param:param;409 ::= Param:param; 413 410 414 411 */ 415 412 public ResultT!(BindingPredicate) parse_BindingPredicate(){ 416 413 debug writefln("parse_BindingPredicate()"); 417 uint start2 6= position;414 uint start27 = position; 418 415 Param bind_param; 419 416 420 417 421 418 {//Expression 422 uint start2 7= position;419 uint start28 = position; 423 420 if((parse_Param().assign!(Param)(bind_param))){ 424 421 clearErrors(); … … 426 423 }else{ 427 424 setError("Expected Param."); 428 position = start2 7;425 position = start28; 429 426 goto mismatch30; 430 427 } … … 435 432 return passed; 436 433 mismatch30: 437 position = start2 6;434 position = start27; 438 435 ResultT!(BindingPredicate) failed = ResultT!(BindingPredicate)(); 439 436 return failed; … … 444 441 ParamsExpr 445 442 = Param[] params 446 ::= "(" WS [ Param:~params WS { "," WS Param:~params WS}]")";443 ::= "(" WS [ Param:~params WS { "," WS Param:~params WS}] ")"; 447 444 448 445 */ 449 446 public ResultT!(Param[]) parse_ParamsExpr(){ 450 447 debug writefln("parse_ParamsExpr()"); 451 uint start2 8= position;448 uint start29 = position; 452 449 Param[] bind_params; 453 450 454 451 455 452 {//Expression 456 uint start 29= position;453 uint start30 = position; 457 454 if(!(terminal("(").success)){ 458 455 goto mismatch34; … … 463 460 {//OptionalExpr 464 461 {//Expression 465 uint start3 1= position;462 uint start32 = position; 466 463 if(!(parse_Param().assignCat!(Param[])(bind_params))){ 467 464 goto mismatch36; … … 471 468 } 472 469 {//ZeroOrMoreExpr 473 uint termPos ;470 uint termPos34; 474 471 loop37: 475 termPos = position;472 termPos34 = position; 476 473 {//Expression 477 uint start3 3= position;474 uint start35 = position; 478 475 if((terminal(",").success && parse_WS().success && parse_Param().assignCat!(Param[])(bind_params) && parse_WS().success)){ 479 476 clearErrors(); 480 477 goto loop37; 481 478 }else{ 482 position = start3 3;479 position = start35; 483 480 goto loopend38; 484 481 } … … 490 487 mismatch36: 491 488 {/*do nothing*/} 492 position = start3 1;489 position = start32; 493 490 {/*do nothing*/} 494 491 match35: … … 503 500 mismatch34: 504 501 {/*do nothing*/} 505 position = start 29;502 position = start30; 506 503 goto mismatch32; 507 504 match33: … … 513 510 return ResultT!(Param[])(bind_params); 514 511 mismatch32: 515 position = start2 8;512 position = start29; 516 513 return ResultT!(Param[])(); 517 514 } … … 521 518 Param 522 519 = Param param 523 ::= ExplicitParam:param |WeakParam:param;520 ::= ExplicitParam:param | WeakParam:param; 524 521 525 522 */ 526 523 public ResultT!(Param) parse_Param(){ 527 524 debug writefln("parse_Param()"); 528 uint start3 4= position;525 uint start36 = position; 529 526 Param bind_param; 530 527 531 528 532 529 {//Expression 533 uint start3 5= position;530 uint start37 = position; 534 531 if((parse_ExplicitParam().assign!(Param)(bind_param)) || (parse_WeakParam().assign!(Param)(bind_param))){ 535 532 clearErrors(); … … 537 534 }else{ 538 535 setError("Expected ExplicitParam or WeakParam."); 539 position = start3 5;536 position = start37; 540 537 goto mismatch40; 541 538 } … … 545 542 return ResultT!(Param)(bind_param); 546 543 mismatch40: 547 position = start3 4;544 position = start36; 548 545 return ResultT!(Param)(); 549 546 } … … 553 550 WeakParam 554 551 = new Param(String name) 555 ::= Identifier:name;552 ::= Identifier:name; 556 553 557 554 */ 558 555 public ResultT!(Param) parse_WeakParam(){ 559 556 debug writefln("parse_WeakParam()"); 560 uint start3 6= position;557 uint start38 = position; 561 558 String bind_name; 562 559 563 560 564 561 {//Expression 565 uint start3 7= position;562 uint start39 = position; 566 563 if((parse_Identifier().assign!(String)(bind_name))){ 567 564 clearErrors(); … … 569 566 }else{ 570 567 setError("Expected Identifier."); 571 position = start3 7;568 position = start39; 572 569 goto mismatch42; 573 570 } … … 578 575 return passed; 579 576 mismatch42: 580 position = start3 6;577 position = start38; 581 578 ResultT!(Param) failed = ResultT!(Param)(); 582 579 return failed; … … 587 584 ExplicitParam 588 585 = new Param(bool isArray,String type,String name) 589 ::= Identifier:type WS [ "[]":isArray Brackets WS]Identifier:name;586 ::= Identifier:type WS [ "[]":isArray Brackets WS] Identifier:name; 590 587 591 588 */ 592 589 public ResultT!(Param) parse_ExplicitParam(){ 593 590 debug writefln("parse_ExplicitParam()"); 594 uint start 38= position;591 uint start40 = position; 595 592 bool bind_isArray; 596 593 String bind_type; … … 599 596 600 597 {//Expression 601 uint start 39= position;598 uint start41 = position; 602 599 if(!(parse_Identifier().assign!(String)(bind_type))){ 603 600 goto mismatch46; … … 608 605 {//OptionalExpr 609 606 {//Expression 610 uint start4 1= position;607 uint start43 = position; 611 608 if((terminal("[]").assign!(bool)(bind_isArray) && parse_Brackets().success && parse_WS().success)){ 612 609 clearErrors(); 613 610 }else{ 614 position = start4 1;611 position = start43; 615 612 } 616 613 } … … 622 619 mismatch46: 623 620 setError("Expected Identifier."); 624 position = start 39;621 position = start41; 625 622 goto mismatch44; 626 623 match45: … … 633 630 return passed; 634 631 mismatch44: 635 position = start 38;632 position = start40; 636 633 ResultT!(Param) failed = ResultT!(Param)(); 637 634 return failed; … … 641 638 642 639 Brackets 643 ::= [ "[]"Brackets];640 ::= [ "[]" Brackets]; 644 641 645 642 */ 646 643 public ResultT!(bool) parse_Brackets(){ 647 644 debug writefln("parse_Brackets()"); 648 uint start4 2= position;645 uint start44 = position; 649 646 //no declarations 650 647 651 648 652 649 {//Expression 653 uint start4 3= position;650 uint start45 = position; 654 651 {//OptionalExpr 655 652 {//Expression 656 uint start4 5= position;653 uint start47 = position; 657 654 if((terminal("[]").success && parse_Brackets().success)){ 658 655 clearErrors(); 659 656 }else{ 660 position = start4 5;657 position = start47; 661 658 } 662 659 } … … 665 662 mismatch50: 666 663 {/*do nothing*/} 667 position = start4 3;664 position = start45; 668 665 goto mismatch48; 669 666 match49: … … 675 672 return ResultT!(bool)(true); 676 673 mismatch48: 677 position = start4 2;674 position = start44; 678 675 return ResultT!(bool)(); 679 676 } … … 683 680 Expression 684 681 = new Expression(Term[] terms) 685 ::= Term:~terms WS { "|" WS Term:~termsWS};682 ::= Term:~terms WS { "|" WS Term:~terms WS}; 686 683 687 684 */ 688 685 public ResultT!(Expression) parse_Expression(){ 689 686 debug writefln("parse_Expression()"); 690 uint start4 6= position;687 uint start48 = position; 691 688 Term[] bind_terms; 692 689 693 690 694 691 {//Expression 695 uint start4 7= position;692 uint start49 = position; 696 693 if(!(parse_Term().assignCat!(Term[])(bind_terms))){ 697 694 goto mismatch54; … … 701 698 } 702 699 {//ZeroOrMoreExpr 703 uint termPos ;700 uint termPos51; 704 701 loop55: 705 termPos = position;706 {//Expression 707 uint start 49= position;702 termPos51 = position; 703 {//Expression 704 uint start52 = position; 708 705 if((terminal("|").success && parse_WS().success && parse_Term().assignCat!(Term[])(bind_terms) && parse_WS().success)){ 709 706 clearErrors(); 710 707 goto loop55; 711 708 }else{ 712 position = start 49;709 position = start52; 713 710 goto loopend56; 714 711 } … … 720 717 mismatch54: 721 718 setError("Expected Term."); 722 position = start4 7;719 position = start49; 723 720 goto mismatch52; 724 721 match53: … … 731 728 return passed; 732 729 mismatch52: 733 position = start4 6;730 position = start48; 734 731 ResultT!(Expression) failed = ResultT!(Expression)(); 735 732 return failed; … … 740 737 Term 741 738 = SubExpression[] factors 742 ::= SubExpression:~factors WS { SubExpression:~factorsWS};739 ::= SubExpression:~factors WS { SubExpression:~factors WS}; 743 740 744 741 */ 745 742 public ResultT!(SubExpression[]) parse_Term(){ 746 743 debug writefln("parse_Term()"); 747 uint start5 0= position;744 uint start53 = position; 748 745 SubExpression[] bind_factors; 749 746 750 747 751 748 {//Expression 752 uint start5 1= position;749 uint start54 = position; 753 750 if(!(parse_SubExpression().assignCat!(SubExpression[])(bind_factors))){ 754 751 goto mismatch60; … … 758 755 } 759 756 {//ZeroOrMoreExpr 760 uint termPos ;757 uint termPos56; 761 758 loop61: 762 termPos = position;763 {//Expression 764 uint start5 3= position;759 termPos56 = position; 760 {//Expression 761 uint start57 = position; 765 762 if((parse_SubExpression().assignCat!(SubExpression[])(bind_factors) && parse_WS().success)){ 766 763 clearErrors(); … … 768 765 }else{ 769 766 setError("Expected SubExpression."); 770 position = start5 3;767 position = start57; 771 768 goto loopend62; 772 769 } … … 778 775 mismatch60: 779 776 setError("Expected SubExpression."); 780 position = start5 1;777 position = start54; 781 778 goto mismatch58; 782 779 match59: … … 788 785 return ResultT!(SubExpression[])(bind_factors); 789 786 mismatch58: 790 position = start5 0;787 position = start53; 791 788 return ResultT!(SubExpression[])(); 792 789 } … … 796 793 SubExpression 797 794 = SubExpression expr 798 ::= Production:expr | Substitution:expr | Terminal:expr | Range:expr | Regexp:expr | GroupExpr:expr | OptionalExpr:expr | ZeroOrMoreExpr:expr | NegateExpr:expr | TestExpr:expr | LiteralExpr:expr |CustomTerminal:expr;795 ::= Production:expr | Substitution:expr | Terminal:expr | Range:expr | Regexp:expr | GroupExpr:expr | OptionalExpr:expr | ZeroOrMoreExpr:expr | NegateExpr:expr | TestExpr:expr | LiteralExpr:expr | CustomTerminal:expr; 799 796 800 797 */ 801 798 public ResultT!(SubExpression) parse_SubExpression(){ 802 799 debug writefln("parse_SubExpression()"); 803 uint start5 4= position;800 uint start58 = position; 804 801 SubExpression bind_expr; 805 802 806 803 807 804 {//Expression 808 uint start5 5= position;805 uint start59 = position; 809 806 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))){ 810 807 clearErrors(); … … 812 809 }else{ 813 810 setError("Expected Production, Substitution, Terminal, Range, Regexp, GroupExpr, OptionalExpr, ZeroOrMoreExpr, NegateExpr, TestExpr, LiteralExpr or CustomTerminal."); 814 position = start5 5;811 position = start59; 815 812 goto mismatch64; 816 813 } … … 820 817 return ResultT!(SubExpression)(bind_expr); 821 818 mismatch64: 822 position = start5 4;819 position = start58; 823 820 return ResultT!(SubExpression)(); 824 821 } … … 828 825 Production 829 826 = new Production(String name,Binding binding,ProductionArg[] args) 830 ::= Identifier:name WS [ "!(" WS ProductionArg:~args { WS "," WS ProductionArg:~args}")"] [Binding:binding];827 ::= Identifier:name WS [ "!(" WS ProductionArg:~args { WS "," WS ProductionArg:~args} ")"] [ Binding:binding]; 831 828 832 829 */ 833 830 public ResultT!(Production) parse_Production(){ 834 831 debug writefln("parse_Production()"); 835 uint start 56= position;832 uint start60 = position; 836 833 String bind_name; 837 834 Binding bind_binding; … … 840 837 841 838 {//Expression 842 uint start 57= position;839 uint start61 = position; 843 840 if(!(parse_Identifier().assign!(String)(bind_name))){ 844 841 goto mismatch68; … … 849 846 {//OptionalExpr 850 847 {//Expression 851 uint start 59= position;848 uint start63 = position; 852 849 if(!(terminal("!(").success)){ 853 850 goto mismatch70; … … 860 857 } 861 858 {//ZeroOrMoreExpr 862 uint start6 0= position;863 uint termPos ;859 uint start64 = position; 860 uint termPos65; 864 861 loop71: 865 termPos = position;862 termPos65 = position; 866 863 if(terminal(")").success){ 867 864 goto loopend72; 868 865 } 869 866 {//Expression 870 uint start6 1= position;867 uint start66 = position; 871 868 if((parse_WS().success && terminal(",").success && parse_WS().success && parse_ProductionArg().assignCat!(ProductionArg[])(bind_args))){ 872 869 clearErrors(); … … 874 871 }else{ 875 872 setError("Expected WS."); 876 position = start6 1;873 position = start66; 877 874 goto mismatch70; 878 875 } … … 884 881 mismatch70: 885 882 {/*do nothing*/} 886 position = start 59;883 position = start63; 887 884 {/*do nothing*/} 888 885 match69: … … 893 890 {//OptionalExpr 894 891 {//Expression 895 uint start6 3= position;892 uint start68 = position; 896 893 if((parse_Binding().assign!(Binding)(bind_binding))){ 897 894 clearErrors(); 898 895 }else{ 899 position = start6 3;896 position = start68; 900 897 } 901 898 } … … 904 901 mismatch68: 905 902 setError("Expected Identifier."); 906 position = start 57;903 position = start61; 907 904 goto mismatch66; 908 905 match67: … … 915 912 return passed; 916 913 mismatch66: 917 position = start 56;914 position = start60; 918 915 ResultT!(Production) failed = ResultT!(Production)(); 919 916 return failed; … … 924 921 ProductionArg 925 922 = ProductionArg arg 926 ::= StringProductionArg:arg |BindingProductionArg:arg;923 ::= StringProductionArg:arg | BindingProductionArg:arg; 927 924 928 925 */ 929 926 public ResultT!(ProductionArg) parse_ProductionArg(){ 930 927 debug writefln("parse_ProductionArg()"); 931 uint start6 4= position;928 uint start69 = position; 932 929 ProductionArg bind_arg; 933 930 934 931 935 932 {//Expression 936 uint start 65= position;933 uint start70 = position; 937 934 if((parse_StringProductionArg().assign!(ProductionArg)(bind_arg)) || (parse_BindingProductionArg().assign!(ProductionArg)(bind_arg))){ 938 935 clearErrors(); … … 940 937 }else{ 941 938 setError("Expected StringProductionArg or BindingProductionArg."); 942 position = start 65;939 position = start70; 943 940 goto mismatch74; 944 941 } … … 948 945 return ResultT!(ProductionArg)(bind_arg); 949 946 mismatch74: 950 position = start6 4;947 position = start69; 951 948 return ResultT!(ProductionArg)(); 952 949 } … … 956 953 StringProductionArg 957 954 = new StringProductionArg(String value) 958 ::= String:value;955 ::= String:value; 959 956 960 957 */ 961 958 public ResultT!(StringProductionArg) parse_StringProductionArg(){ 962 959 debug writefln("parse_StringProductionArg()"); 963 uint start 66= position;960 uint start71 = position; 964 961 String bind_value; 965 962 966 963 967 964 {//Expression 968 uint start 67= position;965 uint start72 = position; 969 966 if((parse_String().assign!(String)(bind_value))){ 970 967 clearErrors(); … … 972 969 }else{ 973 970 setError("Expected String."); 974 position = start 67;971 position = start72; 975 972 goto mismatch76; 976 973 } … … 981 978 return passed; 982 979 mismatch76: 983 position = start 66;980 position = start71; 984 981 ResultT!(StringProductionArg) failed = ResultT!(StringProductionArg)(); 985 982 return failed; … … 990 987 BindingProductionArg 991 988 = new BindingProductionArg(String value) 992 ::= Identifier:value;989 ::= Identifier:value; 993 990 994 991 */ 995 992 public ResultT!(BindingProductionArg) parse_BindingProductionArg(){ 996 993 debug writefln("parse_BindingProductionArg()"); 997 uint start 68= position;994 uint start73 = position; 998 995 String bind_value; 999 996 1000 997 1001 998 {//Expression 1002 uint start 69= position;999 uint start74 = position; 1003 1000 if((parse_Identifier().assign!(String)(bind_value))){ 1004 1001 clearErrors(); … … 1006 1003 }else{ 1007 1004 setError("Expected Identifier."); 1008 position = start 69;1005 position = start74; 1009 1006 goto mismatch78; 1010 1007 } … … 1015 1012 return passed; 1016 1013 mismatch78:
