Changeset 236

Show
Ignore:
Timestamp:
08/11/06 15:42:31 (2 years ago)
Author:
pragma
Message:

Added C comments and credits for types.d

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/enki/EnkiParser.d

    r235 r236  
    4242    /* 
    4343     
     44WS 
     45    ::=  ws| SlashSlashComment| SlashStarComment; 
     46 
     47    */ 
     48    public ResultT!(bool) parse_WS(){ 
     49        debug writefln("parse_WS()"); 
     50        uint start1 = position; 
     51        //no declarations 
     52         
     53         
     54        {//Expression 
     55            uint start2 = position; 
     56            if((parse_ws().success) || (parse_SlashSlashComment().success) || (parse_SlashStarComment().success)){ 
     57                clearErrors(); 
     58                goto match1; 
     59            }else{ 
     60                setError("Expected Whitespace, SlashSlashComment or SlashStarComment."); 
     61                position = start2; 
     62                goto mismatch2; 
     63            } 
     64        } 
     65    match1: 
     66        debug writefln("parse_WS() PASS"); 
     67        return ResultT!(bool)(true); 
     68    mismatch2: 
     69        position = start1; 
     70        return ResultT!(bool)(); 
     71    } 
     72 
     73    /* 
     74     
    4475Syntax 
    4576    = void createSyntax(SyntaxLine[] lines) 
    46     ::=  ws { ( Rule:~lines | Comment:~lines | Directive:~lines )  ws} eoi; 
     77    ::=  WS { ( Rule:~lines | Comment:~lines | Directive:~lines )  WS} eoi; 
    4778 
    4879    */ 
    4980    public ResultT!(String) parse_Syntax(){ 
    5081        debug writefln("parse_Syntax()"); 
    51         uint start1 = position; 
     82        uint start3 = position; 
    5283        SyntaxLine[] bind_lines; 
    5384         
    5485         
    5586        {//Expression 
    56             uint start2 = position; 
    57             if(!(parse_ws().success)){ 
    58                 goto mismatch4
     87            uint start4 = position; 
     88            if(!(parse_WS().success)){ 
     89                goto mismatch6
    5990            } 
    6091            {//ZeroOrMoreExpr 
    61                 uint start3 = position; 
     92                uint start5 = position; 
    6293                uint termPos; 
    63             loop5
     94            loop7
    6495                termPos = position; 
    6596                if(parse_eoi().success){ 
    66                     goto loopend6
    67                 } 
    68                 {//Expression 
    69                     uint start4 = position; 
     97                    goto loopend8
     98                } 
     99                {//Expression 
     100                    uint start6 = position; 
    70101                    {//Expression 
    71                         uint start5 = position; 
     102                        uint start7 = position; 
    72103                        if((parse_Rule().assignCat!(SyntaxLine[])(bind_lines)) || (parse_Comment().assignCat!(SyntaxLine[])(bind_lines)) || (parse_Directive().assignCat!(SyntaxLine[])(bind_lines))){ 
    73104                            clearErrors(); 
    74105                        }else{ 
    75106                            setError("Expected Rule, Comment or Directive."); 
    76                             position = start5
    77                             goto mismatch8
     107                            position = start7
     108                            goto mismatch10
    78109                        } 
    79110                    } 
    80                     if(!(parse_ws().success)){ 
    81                         goto mismatch8
    82                     } 
    83                     goto match7
    84                 mismatch8
     111                    if(!(parse_WS().success)){ 
     112                        goto mismatch10
     113                    } 
     114                    goto match9
     115                mismatch10
    85116                    {/*do nothing*/} 
    86                     position = start4
    87                     goto mismatch4
    88                 match7
     117                    position = start6
     118                    goto mismatch6
     119                match9
    89120                    clearErrors(); 
    90                     goto loop5
    91                 } 
    92             loopend6
     121                    goto loop7
     122                } 
     123            loopend8
    93124                {/*do nothing*/} 
    94125            } 
     126            goto match5; 
     127        mismatch6: 
     128            setError("Expected WS."); 
     129            position = start4; 
     130            goto mismatch4; 
     131        match5: 
     132            clearErrors(); 
    95133            goto match3; 
    96         mismatch4: 
    97             setError("Expected Whitespace."); 
    98             position = start2; 
    99             goto mismatch2; 
    100         match3: 
    101             clearErrors(); 
    102             goto match1; 
    103         } 
    104     match1: 
     134        } 
     135    match3: 
    105136        debug writefln("parse_Syntax() PASS"); 
    106137        createSyntax(bind_lines); 
    107         return ResultT!(String)(sliceData(start1,position)); 
    108     mismatch2
    109         position = start1
     138        return ResultT!(String)(sliceData(start3,position)); 
     139    mismatch4
     140        position = start3
    110141        return ResultT!(String)(); 
    111142    } 
     
    115146Rule 
    116147    = new Rule(String name,RulePredicate pred,Expression expr,RuleDecl decl) 
    117     ::=  ws Identifier:name  ws [ RuleDecl:decl  ws]  [ RulePredicate:pred ]  ws "::=" ws Expression:expr  ws ";"; 
     148    ::=  WS Identifier:name  WS [ RuleDecl:decl  WS]  [ RulePredicate:pred ]  WS "::=" WS Expression:expr  WS ";"; 
    118149 
    119150    */ 
    120151    public ResultT!(Rule) parse_Rule(){ 
    121152        debug writefln("parse_Rule()"); 
    122         uint start6 = position; 
     153        uint start8 = position; 
    123154        String bind_name; 
    124155        RulePredicate bind_pred; 
     
    128159         
    129160        {//Expression 
    130             uint start7 = position; 
    131             if(!(parse_ws().success)){ 
    132                 goto mismatch12
     161            uint start9 = position; 
     162            if(!(parse_WS().success)){ 
     163                goto mismatch14
    133164            } 
    134165            if(!(parse_Identifier().assign!(String)(bind_name))){ 
    135                 goto mismatch12
    136             } 
    137             if(!(parse_ws().success)){ 
    138                 goto mismatch12
     166                goto mismatch14
     167            } 
     168            if(!(parse_WS().success)){ 
     169                goto mismatch14
    139170            } 
    140171            {//OptionalExpr 
    141172                {//Expression 
    142                     uint start9 = position; 
    143                     if((parse_RuleDecl().assign!(RuleDecl)(bind_decl) && parse_ws().success)){ 
     173                    uint start11 = position; 
     174                    if((parse_RuleDecl().assign!(RuleDecl)(bind_decl) && parse_WS().success)){ 
    144175                        clearErrors(); 
    145176                    }else{ 
    146                         position = start9
     177                        position = start11
    147178                    } 
    148179                } 
     
    150181            {//OptionalExpr 
    151182                {//Expression 
    152                     uint start11 = position; 
     183                    uint start13 = position; 
    153184                    if((parse_RulePredicate().assign!(RulePredicate)(bind_pred))){ 
    154185                        clearErrors(); 
    155186                    }else{ 
    156                         position = start11
    157                     } 
    158                 } 
    159             } 
    160             if(!(parse_ws().success)){ 
    161                 goto mismatch12
     187                        position = start13
     188                    } 
     189                } 
     190            } 
     191            if(!(parse_WS().success)){ 
     192                goto mismatch14
    162193            } 
    163194            if(!(terminal("::=").success)){ 
    164                 goto mismatch12
    165             } 
    166             if(!(parse_ws().success)){ 
    167                 goto mismatch12
     195                goto mismatch14
     196            } 
     197            if(!(parse_WS().success)){ 
     198                goto mismatch14
    168199            } 
    169200            if(!(parse_Expression().assign!(Expression)(bind_expr))){ 
    170                 goto mismatch12
    171             } 
    172             if(!(parse_ws().success)){ 
    173                 goto mismatch12
     201                goto mismatch14
     202            } 
     203            if(!(parse_WS().success)){ 
     204                goto mismatch14
    174205            } 
    175206            if(!(terminal(";").success)){ 
    176                 goto mismatch12; 
    177             } 
     207                goto mismatch14; 
     208            } 
     209            goto match13; 
     210        mismatch14: 
     211            setError("Expected WS."); 
     212            position = start9; 
     213            goto mismatch12; 
     214        match13: 
     215            clearErrors(); 
    178216            goto match11; 
    179         mismatch12: 
    180             setError("Expected Whitespace."); 
    181             position = start7; 
    182             goto mismatch10; 
    183         match11: 
    184             clearErrors(); 
    185             goto match9; 
    186         } 
    187     match9: 
     217        } 
     218    match11: 
    188219        debug writefln("parse_Rule() PASS"); 
    189220        ResultT!(Rule) passed = ResultT!(Rule)(new Rule(bind_name,bind_pred,bind_expr,bind_decl)); 
    190221        return passed; 
    191     mismatch10
    192         position = start6
     222    mismatch12
     223        position = start8
    193224        ResultT!(Rule) failed = ResultT!(Rule)(); 
    194225        return failed; 
     
    204235    public ResultT!(RuleDecl) parse_RuleDecl(){ 
    205236        debug writefln("parse_RuleDecl()"); 
    206         uint start12 = position; 
     237        uint start14 = position; 
    207238        Param[] bind_params; 
    208239         
    209240         
    210241        {//Expression 
    211             uint start13 = position; 
     242            uint start15 = position; 
    212243            if((parse_ParamsExpr().assign!(Param[])(bind_params))){ 
    213244                clearErrors(); 
    214                 goto match13
     245                goto match15
    215246            }else{ 
    216247                setError("Expected ParamsExpr."); 
    217                 position = start13
    218                 goto mismatch14
    219             } 
    220         } 
    221     match13
     248                position = start15
     249                goto mismatch16
     250            } 
     251        } 
     252    match15
    222253        debug writefln("parse_RuleDecl() PASS"); 
    223254        ResultT!(RuleDecl) passed = ResultT!(RuleDecl)(new RuleDecl(bind_params)); 
    224255        return passed; 
    225     mismatch14
    226         position = start12
     256    mismatch16
     257        position = start14
    227258        ResultT!(RuleDecl) failed = ResultT!(RuleDecl)(); 
    228259        return failed; 
     
    233264RulePredicate 
    234265    = RulePredicate pred 
    235     ::=  "=" ws ( ClassPredicate:pred | FunctionPredicate:pred | BindingPredicate:pred ) ; 
     266    ::=  "=" WS ( ClassPredicate:pred | FunctionPredicate:pred | BindingPredicate:pred ) ; 
    236267 
    237268    */ 
    238269    public ResultT!(RulePredicate) parse_RulePredicate(){ 
    239270        debug writefln("parse_RulePredicate()"); 
    240         uint start14 = position; 
     271        uint start16 = position; 
    241272        RulePredicate bind_pred; 
    242273         
    243274         
    244275        {//Expression 
    245             uint start15 = position; 
     276            uint start17 = position; 
    246277            if(!(terminal("=").success)){ 
    247                 goto mismatch18
    248             } 
    249             if(!(parse_ws().success)){ 
    250                 goto mismatch18
     278                goto mismatch20
     279            } 
     280            if(!(parse_WS().success)){ 
     281                goto mismatch20
    251282            } 
    252283            {//Expression 
    253                 uint start16 = position; 
     284                uint start18 = position; 
    254285                if((parse_ClassPredicate().assign!(RulePredicate)(bind_pred)) || (parse_FunctionPredicate().assign!(RulePredicate)(bind_pred)) || (parse_BindingPredicate().assign!(RulePredicate)(bind_pred))){ 
    255286                    clearErrors(); 
    256287                }else{ 
    257288                    setError("Expected ClassPredicate, FunctionPredicate or BindingPredicate."); 
    258                     position = start16; 
    259                     goto mismatch18; 
    260                 } 
    261             } 
     289                    position = start18; 
     290                    goto mismatch20; 
     291                } 
     292            } 
     293            goto match19; 
     294        mismatch20: 
     295            {/*do nothing*/} 
     296            position = start17; 
     297            goto mismatch18; 
     298        match19: 
     299            clearErrors(); 
    262300            goto match17; 
    263         mismatch18: 
    264             {/*do nothing*/} 
    265             position = start15; 
    266             goto mismatch16; 
    267         match17: 
    268             clearErrors(); 
    269             goto match15; 
    270         } 
    271     match15: 
     301        } 
     302    match17: 
    272303        debug writefln("parse_RulePredicate() PASS"); 
    273304        return ResultT!(RulePredicate)(bind_pred); 
    274     mismatch16
    275         position = start14
     305    mismatch18
     306        position = start16
    276307        return ResultT!(RulePredicate)(); 
    277308    } 
     
    281312ClassPredicate 
    282313    = new ClassPredicate(String name,Param[] params) 
    283     ::=  "new" ws Identifier:name  ws ParamsExpr:params ; 
     314    ::=  "new" WS Identifier:name  WS ParamsExpr:params ; 
    284315 
    285316    */ 
    286317    public ResultT!(ClassPredicate) parse_ClassPredicate(){ 
    287318        debug writefln("parse_ClassPredicate()"); 
    288         uint start17 = position; 
     319        uint start19 = position; 
    289320        String bind_name; 
    290321        Param[] bind_params; 
     
    292323         
    293324        {//Expression 
    294             uint start18 = position; 
    295             if((terminal("new").success && parse_ws().success && parse_Identifier().assign!(String)(bind_name) && parse_ws().success && parse_ParamsExpr().assign!(Param[])(bind_params))){ 
    296                 clearErrors(); 
    297                 goto match19; 
    298             }else{ 
    299                 position = start18; 
    300                 goto mismatch20; 
    301             } 
    302         } 
    303     match19: 
    304         debug writefln("parse_ClassPredicate() PASS"); 
    305         ResultT!(ClassPredicate) passed = ResultT!(ClassPredicate)(new ClassPredicate(bind_name,bind_params)); 
    306         return passed; 
    307     mismatch20: 
    308         position = start17; 
    309         ResultT!(ClassPredicate) failed = ResultT!(ClassPredicate)(); 
    310         return failed; 
    311     } 
    312  
    313     /* 
    314      
    315 FunctionPredicate 
    316     = new FunctionPredicate(Param decl,Param[] params) 
    317     ::=  ExplicitParam:decl  ws ParamsExpr:params ; 
    318  
    319     */ 
    320     public ResultT!(FunctionPredicate) parse_FunctionPredicate(){ 
    321         debug writefln("parse_FunctionPredicate()"); 
    322         uint start19 = position; 
    323         Param bind_decl; 
    324         Param[] bind_params; 
    325          
    326          
    327         {//Expression 
    328325            uint start20 = position; 
    329             if((parse_ExplicitParam().assign!(Param)(bind_decl) && parse_ws().success && parse_ParamsExpr().assign!(Param[])(bind_params))){ 
     326            if((terminal("new").success && parse_WS().success && parse_Identifier().assign!(String)(bind_name) && parse_WS().success && parse_ParamsExpr().assign!(Param[])(bind_params))){ 
    330327                clearErrors(); 
    331328                goto match21; 
    332329            }else{ 
    333                 setError("Expected ExplicitParam."); 
    334330                position = start20; 
    335331                goto mismatch22; 
     
    337333        } 
    338334    match21: 
     335        debug writefln("parse_ClassPredicate() PASS"); 
     336        ResultT!(ClassPredicate) passed = ResultT!(ClassPredicate)(new ClassPredicate(bind_name,bind_params)); 
     337        return passed; 
     338    mismatch22: 
     339        position = start19; 
     340        ResultT!(ClassPredicate) failed = ResultT!(ClassPredicate)(); 
     341        return failed; 
     342    } 
     343 
     344    /* 
     345     
     346FunctionPredicate 
     347    = new FunctionPredicate(Param decl,Param[] params) 
     348    ::=  ExplicitParam:decl  WS ParamsExpr:params ; 
     349 
     350    */ 
     351    public ResultT!(FunctionPredicate) parse_FunctionPredicate(){ 
     352        debug writefln("parse_FunctionPredicate()"); 
     353        uint start21 = position; 
     354        Param bind_decl; 
     355        Param[] bind_params; 
     356         
     357         
     358        {//Expression 
     359            uint start22 = position; 
     360            if((parse_ExplicitParam().assign!(Param)(bind_decl) && parse_WS().success && parse_ParamsExpr().assign!(Param[])(bind_params))){ 
     361                clearErrors(); 
     362                goto match23; 
     363            }else{ 
     364                setError("Expected ExplicitParam."); 
     365                position = start22; 
     366                goto mismatch24; 
     367            } 
     368        } 
     369    match23: 
    339370        debug writefln("parse_FunctionPredicate() PASS"); 
    340371        ResultT!(FunctionPredicate) passed = ResultT!(FunctionPredicate)(new FunctionPredicate(bind_decl,bind_params)); 
    341372        return passed; 
    342     mismatch22
    343         position = start19
     373    mismatch24
     374        position = start21
    344375        ResultT!(FunctionPredicate) failed = ResultT!(FunctionPredicate)(); 
    345376        return failed; 
     
    355386    public ResultT!(BindingPredicate) parse_BindingPredicate(){ 
    356387        debug writefln("parse_BindingPredicate()"); 
    357         uint start21 = position; 
     388        uint start23 = position; 
    358389        Param bind_param; 
    359390         
    360391         
    361392        {//Expression 
    362             uint start22 = position; 
     393            uint start24 = position; 
    363394            if((parse_Param().assign!(Param)(bind_param))){ 
    364395                clearErrors(); 
    365                 goto match23
     396                goto match25
    366397            }else{ 
    367398                setError("Expected Param."); 
    368                 position = start22
    369                 goto mismatch24
    370             } 
    371         } 
    372     match23
     399                position = start24
     400                goto mismatch26
     401            } 
     402        } 
     403    match25
    373404        debug writefln("parse_BindingPredicate() PASS"); 
    374405        ResultT!(BindingPredicate) passed = ResultT!(BindingPredicate)(new BindingPredicate(bind_param)); 
    375406        return passed; 
    376     mismatch24
    377         position = start21
     407    mismatch26
     408        position = start23
    378409        ResultT!(BindingPredicate) failed = ResultT!(BindingPredicate)(); 
    379410        return failed; 
     
    384415ParamsExpr 
    385416    = Param[] params 
    386     ::=  "(" ws [ Param:~params  ws { "," ws Param:~params  ws} ]  ")"; 
     417    ::=  "(" WS [ Param:~params  WS { "," WS Param:~params  WS} ]  ")"; 
    387418 
    388419    */ 
    389420    public ResultT!(Param[]) parse_ParamsExpr(){ 
    390421        debug writefln("parse_ParamsExpr()"); 
    391         uint start23 = position; 
     422        uint start25 = position; 
    392423        Param[] bind_params; 
    393424         
    394425         
    395426        {//Expression 
    396             uint start24 = position; 
     427            uint start26 = position; 
    397428            if(!(terminal("(").success)){ 
    398                 goto mismatch28
    399             } 
    400             if(!(parse_ws().success)){ 
    401                 goto mismatch28
     429                goto mismatch30
     430            } 
     431            if(!(parse_WS().success)){ 
     432                goto mismatch30
    402433            } 
    403434            {//OptionalExpr 
    404435                {//Expression 
    405                     uint start26 = position; 
     436                    uint start28 = position; 
    406437                    if(!(parse_Param().assignCat!(Param[])(bind_params))){ 
    407                         goto mismatch30
    408                     } 
    409                     if(!(parse_ws().success)){ 
    410                         goto mismatch30
     438                        goto mismatch32
     439                    } 
     440                    if(!(parse_WS().success)){ 
     441                        goto mismatch32
    411442                    } 
    412443                    {//ZeroOrMoreExpr 
    413444                        uint termPos; 
    414                     loop31
     445                    loop33
    415446                        termPos = position; 
    416447                        {//Expression 
    417                             uint start28 = position; 
    418                             if((terminal(",").success && parse_ws().success && parse_Param().assignCat!(Param[])(bind_params) && parse_ws().success)){ 
     448                            uint start30 = position; 
     449                            if((terminal(",").success && parse_WS().success && parse_Param().assignCat!(Param[])(bind_params) && parse_WS().success)){ 
    419450                                clearErrors(); 
    420                                 goto loop31
     451                                goto loop33
    421452                            }else{ 
    422                                 position = start28
    423                                 goto loopend32
     453                                position = start30
     454                                goto loopend34
    424455                            } 
    425456                        } 
    426                     loopend32
     457                    loopend34
    427458                        {/*do nothing*/} 
    428459                    } 
    429                     goto match29
    430                 mismatch30
     460                    goto match31
     461                mismatch32
    431462                    {/*do nothing*/} 
    432                     position = start26
     463                    position = start28
    433464                    {/*do nothing*/} 
    434                 match29
     465                match31
    435466                    clearErrors(); 
    436467                    {/*do nothing*/} 
     
    438469            } 
    439470            if(!(terminal(")").success)){ 
    440                 goto mismatch28; 
    441             } 
     471                goto mismatch30; 
     472            } 
     473            goto match29; 
     474        mismatch30: 
     475            {/*do nothing*/} 
     476            position = start26; 
     477            goto mismatch28; 
     478        match29: 
     479            clearErrors(); 
    442480            goto match27; 
    443         mismatch28: 
    444             {/*do nothing*/} 
    445             position = start24; 
    446             goto mismatch26; 
    447         match27: 
    448             clearErrors(); 
    449             goto match25; 
    450         } 
    451     match25: 
     481        } 
     482    match27: 
    452483        debug writefln("parse_ParamsExpr() PASS"); 
    453484        return ResultT!(Param[])(bind_params); 
    454     mismatch26
    455         position = start23
     485    mismatch28
     486        position = start25
    456487        return ResultT!(Param[])(); 
    457488    } 
     
    466497    public ResultT!(Param) parse_Param(){ 
    467498        debug writefln("parse_Param()"); 
    468         uint start29 = position; 
     499        uint start31 = position; 
    469500        Param bind_param; 
    470501         
    471502         
    472503        {//Expression 
    473             uint start30 = position; 
     504            uint start32 = position; 
    474505            if((parse_ExplicitParam().assign!(Param)(bind_param)) || (parse_WeakParam().assign!(Param)(bind_param))){ 
    475506                clearErrors(); 
    476                 goto match33
     507                goto match35
    477508            }else{ 
    478509                setError("Expected ExplicitParam or WeakParam."); 
    479                 position = start30
    480                 goto mismatch34
    481             } 
    482         } 
    483     match33
     510                position = start32
     511                goto mismatch36
     512            } 
     513        } 
     514    match35
    484515        debug writefln("parse_Param() PASS"); 
    485516        return ResultT!(Param)(bind_param); 
    486     mismatch34
    487         position = start29
     517    mismatch36
     518        position = start31
    488519        return ResultT!(Param)(); 
    489520    } 
     
    498529    public ResultT!(Param) parse_WeakParam(){ 
    499530        debug writefln("parse_WeakParam()"); 
    500         uint start31 = position; 
     531        uint start33 = position; 
    501532        String bind_name; 
    502533         
    503534         
    504535        {//Expression 
    505             uint start32 = position; 
     536            uint start34 = position; 
    506537            if((parse_Identifier().assign!(String)(bind_name))){ 
    507538                clearErrors(); 
    508                 goto match35
     539                goto match37
    509540            }else{ 
    510541                setError("Expected Identifier."); 
    511                 position = start32
    512                 goto mismatch36
    513             } 
    514         } 
    515     match35
     542                position = start34
     543                goto mismatch38
     544            } 
     545        } 
     546    match37
    516547        debug writefln("parse_WeakParam() PASS"); 
    517548        ResultT!(Param) passed = ResultT!(Param)(new Param(bind_name)); 
    518549        return passed; 
    519     mismatch36
    520         position = start31
     550    mismatch38
     551        position = start33
    521552        ResultT!(Param) failed = ResultT!(Param)(); 
    522553        return failed; 
     
    527558ExplicitParam 
    528559    = new Param(bool isArray,String type,String name) 
    529     ::=  Identifier:type  ws [ "[]":isArray  Brackets ws]  Identifier:name ; 
     560    ::=  Identifier:type  WS [ "[]":isArray  Brackets WS]  Identifier:name ; 
    530561 
    531562    */ 
    532563    public ResultT!(Param) parse_ExplicitParam(){ 
    533564        debug writefln("parse_ExplicitParam()"); 
    534         uint start33 = position; 
     565        uint start35 = position; 
    535566        bool bind_isArray; 
    536567        String bind_type; 
     
    539570         
    540571        {//Expression 
    541             uint start34 = position; 
     572            uint start36 = position; 
    542573            if(!(parse_Identifier().assign!(String)(bind_type))){ 
    543                 goto mismatch40
    544             } 
    545             if(!(parse_ws().success)){ 
    546                 goto mismatch40
     574                goto mismatch42
     575            } 
     576            if(!(parse_WS().success)){ 
     577                goto mismatch42
    547578            } 
    548579            {//OptionalExpr 
    549580                {//Expression 
    550                     uint start36 = position; 
    551                     if((terminal("[]").assign!(bool)(bind_isArray) && parse_Brackets().success && parse_ws().success)){ 
     581                    uint start38 = position; 
     582                    if((terminal("[]").assign!(bool)(bind_isArray) && parse_Brackets().success && parse_WS().success)){ 
    552583                        clearErrors(); 
    553584                    }else{ 
    554                         position = start36
     585                        position = start38
    555586                    } 
    556587                } 
    557588            } 
    558589            if(!(parse_Identifier().assign!(String)(bind_name))){ 
    559                 goto mismatch40; 
    560             } 
     590                goto mismatch42; 
     591            } 
     592            goto match41; 
     593        mismatch42: 
     594            setError("Expected Identifier."); 
     595            position = start36; 
     596            goto mismatch40; 
     597        match41: 
     598            clearErrors(); 
    561599            goto match39; 
    562         mismatch40: 
    563             setError("Expected Identifier."); 
    564             position = start34; 
    565             goto mismatch38; 
    566         match39: 
    567             clearErrors(); 
    568             goto match37; 
    569         } 
    570     match37: 
     600        } 
     601    match39: 
    571602        debug writefln("parse_ExplicitParam() PASS"); 
    572603        ResultT!(Param) passed = ResultT!(Param)(new Param(bind_isArray,bind_type,bind_name)); 
    573604        return passed; 
    574     mismatch38
    575         position = start33
     605    mismatch40
     606        position = start35
    576607        ResultT!(Param) failed = ResultT!(Param)(); 
    577608        return failed; 
     
    586617    public ResultT!(bool) parse_Brackets(){ 
    587618        debug writefln("parse_Brackets()"); 
    588         uint start37 = position; 
     619        uint start39 = position; 
    589620        //no declarations 
    590621         
    591622         
    592623        {//Expression 
    593             uint start38 = position; 
     624            uint start40 = position; 
    594625            {//OptionalExpr 
    595626                {//Expression 
    596                     uint start40 = position; 
     627                    uint start42 = position; 
    597628                    if((terminal("[]").success && parse_Brackets().success)){ 
    598629                        clearErrors(); 
    599630                    }else{ 
    600                         position = start40; 
    601                     } 
    602                 } 
    603             } 
     631                        position = start42; 
     632                    } 
     633                } 
     634            } 
     635            goto match45; 
     636        mismatch46: 
     637            {/*do nothing*/} 
     638            position = start40; 
     639            goto mismatch44; 
     640        match45: 
     641            clearErrors(); 
    604642            goto match43; 
    605         mismatch44: 
    606             {/*do nothing*/} 
    607             position = start38; 
    608             goto mismatch42; 
    609         match43: 
    610             clearErrors(); 
    611             goto match41; 
    612         } 
    613     match41: 
     643        } 
     644    match43: 
    614645        debug writefln("parse_Brackets() PASS"); 
    615646        return ResultT!(bool)(true); 
    616     mismatch42
    617         position = start37
     647    mismatch44
     648        position = start39
    618649        return ResultT!(bool)(); 
    619650    } 
     
    623654Expression 
    624655    = new Expression(Term[] terms) 
    625     ::=  Term:~terms  ws { "|" ws Term:~terms  ws} ; 
     656    ::=  Term:~terms  WS { "|" WS Term:~terms  WS} ; 
    626657 
    627658    */ 
    628659    public ResultT!(Expression) parse_Expression(){ 
    629660        debug writefln("parse_Expression()"); 
    630         uint start41 = position; 
     661        uint start43 = position; 
    631662        Term[] bind_terms; 
    632663         
    633664         
    634665        {//Expression 
    635             uint start42 = position; 
     666            uint start44 = position; 
    636667            if(!(parse_Term().assignCat!(Term[])(bind_terms))){ 
    637                 goto mismatch48
    638             } 
    639             if(!(parse_ws().success)){ 
    640                 goto mismatch48
     668                goto mismatch50
     669            } 
     670            if(!(parse_WS().success)){ 
     671                goto mismatch50
    641672            } 
    642673            {//ZeroOrMoreExpr 
    643674                uint termPos; 
    644             loop49
     675            loop51
    645676                termPos = position; 
    646677                {//Expression 
    647                     uint start44 = position; 
    648                     if((terminal("|").success && parse_ws().success && parse_Term().assignCat!(Term[])(bind_terms) && parse_ws().success)){ 
     678                    uint start46 = position; 
     679                    if((terminal("|").success && parse_WS().success && parse_Term().assignCat!(Term[])(bind_terms) && parse_WS().success)){ 
    649680                        clearErrors(); 
    650                         goto loop49
     681                        goto loop51
    651682                    }else{ 
    652                         position = start44
    653                         goto loopend50
    654                     } 
    655                 } 
    656             loopend50
     683                        position = start46
     684                        goto loopend52
     685                    } 
     686                } 
     687            loopend52
    657688                {/*do nothing*/} 
    658689            } 
     690            goto match49; 
     691        mismatch50: 
     692            setError("Expected Term."); 
     693            position = start44; 
     694            goto mismatch48; 
     695        match49: 
     696<