Changeset 202

Show
Ignore:
Timestamp:
06/13/06 22:26:37 (2 years ago)
Author:
pragma
Message:

Last Enki update for a while.

This update includes codegen improvments, bugfixes, the '&' operator
and parameter extensions to the '@' operator.

Files:

Legend:

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

    r196 r202  
    7272    /** conversion helpers **/ 
    7373     
    74     protected String hexToChar(String input){ 
    75         uint value = 0; 
    76         foreach(char ch; input){ 
    77             value *= 16; 
    78             if(ch >= 'a') value += (ch-'a') + 10; 
    79             else if(ch >= 'A') value += (ch-'A') + 10; 
    80             else if(ch >= '0') value += (ch-'0'); 
    81         } 
    82         String output; 
    83         output ~= cast(char)value; 
    84          
    85         debug writefln("hexToChar: %s to %s",input,output); 
    86          
    87         return output; 
     74    protected String hexToChar(String hexValue){ 
     75        return "\\x" ~ hexValue; 
    8876    } 
    8977         
  • trunk/enki/Directive.d

    r196 r202  
    267267     
    268268    public String toBNF(){ 
    269         return ".code(\"" ~ code ~ "\");\n"; 
     269        return ".code{{{" ~ code ~ "}}}\n"; 
    270270    } 
    271271     
  • trunk/enki/EnkiParser.d

    r196 r202  
    1010class EnkiParser : BaseEnkiParser{ 
    1111 
     12/+ 
     13    Copyright (c) 2006 Eric Anderton 
     14 
     15    Permission is hereby granted, free of charge, to any person 
     16    obtaining a copy of this software and associated documentation 
     17    files (the "Software"), to deal in the Software without 
     18    restriction, including without limitation the rights to use, 
     19    copy, modify, merge, publish, distribute, sublicense, and/or 
     20    sell copies of the Software, and to permit persons to whom the 
     21    Software is furnished to do so, subject to the following 
     22    conditions: 
     23 
     24    The above copyright notice and this permission notice shall be 
     25    included in all copies or substantial portions of the Software. 
     26 
     27    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
     28    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
     29    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
     30    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
     31    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
     32    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
     33    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 
     34    OTHER DEALINGS IN THE SOFTWARE. 
     35+/ 
    1236    /* 
    1337     
     
    665689SubExpression 
    666690    = SubExpression expr 
    667     ::=  Production:expr | Substitution:expr | Terminal:expr | Regexp:expr | GroupExpr:expr | OptionalExpr:expr | ZeroOrMoreExpr:expr | NegateExpr:expr | TestExpr:expr | Literal:expr ; 
     691    ::=  Production:expr | Substitution:expr | Terminal:expr | Regexp:expr | GroupExpr:expr | OptionalExpr:expr | ZeroOrMoreExpr:expr | NegateExpr:expr | TestExpr:expr | LiteralExpr:expr | CustomTerminal:expr ; 
    668692 
    669693    */ 
     
    676700        {//Expression 
    677701            uint start = position; 
    678             if((parse_Production().assign!(SubExpression)(bind_expr)) || (parse_Substitution().assign!(SubExpression)(bind_expr)) || (parse_Terminal().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_Literal().assign!(SubExpression)(bind_expr))){ 
     702            if((parse_Production().assign!(SubExpression)(bind_expr)) || (parse_Substitution().assign!(SubExpression)(bind_expr)) || (parse_Terminal().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))){ 
    679703                clearErrors(); 
    680704                goto match53; 
    681705            }else{ 
    682                 setError("Expected Production, Substitution, Terminal, Regexp, GroupExpr, OptionalExpr, ZeroOrMoreExpr, NegateExpr, TestExpr or Literal."); 
     706                setError("Expected Production, Substitution, Terminal, Regexp, GroupExpr, OptionalExpr, ZeroOrMoreExpr, NegateExpr, TestExpr, LiteralExpr or CustomTerminal."); 
    683707                position = start; 
    684708                goto mismatch54; 
     
    13581382    /* 
    13591383     
    1360 Literal 
    1361     = new LiteralExpr(String name,Binding binding
    1362     ::=  "@" Identifier:name  ws [ Binding:binding ] ; 
    1363  
    1364     */ 
    1365     public ResultT!(LiteralExpr) parse_Literal(){ 
    1366         debug writefln("parse_Literal()"); 
     1384LiteralExpr 
     1385    = new LiteralExpr(String name,Binding binding,ProductionArg[] args
     1386    ::=  "@" Identifier:name  ws [ "!(" ws ProductionArg:~args  { ws "," ws ProductionArg:~args }  ")"]  [ Binding:binding ] ; 
     1387 
     1388    */ 
     1389    public ResultT!(LiteralExpr) parse_LiteralExpr(){ 
     1390        debug writefln("parse_LiteralExpr()"); 
    13671391        uint start = position; 
    13681392        String bind_name; 
    13691393        Binding bind_binding; 
     1394        ProductionArg[] bind_args; 
    13701395         
    13711396         
     
    13841409                {//Expression 
    13851410                    uint start = position; 
     1411                    if(!(terminal("!(").success)){ 
     1412                        goto mismatch106; 
     1413                    } 
     1414                    if(!(parse_ws().success)){ 
     1415                        goto mismatch106; 
     1416                    } 
     1417                    if(!(parse_ProductionArg().assignCat!(ProductionArg[])(bind_args))){ 
     1418                        goto mismatch106; 
     1419                    } 
     1420                    {//ZeroOrMoreExpr 
     1421                        uint start = position; 
     1422                        uint termPos; 
     1423                    loop107: 
     1424                        termPos = position; 
     1425                        {//Expression 
     1426                            uint start = position; 
     1427                            if((terminal(")").success)){ 
     1428                                clearErrors(); 
     1429                                goto loopend108; 
     1430                            }else{ 
     1431                                position = start; 
     1432                            } 
     1433                        } 
     1434                        {//Expression 
     1435                            uint start = position; 
     1436                            if((parse_ws().success && terminal(",").success && parse_ws().success && parse_ProductionArg().assignCat!(ProductionArg[])(bind_args))){ 
     1437                                clearErrors(); 
     1438                                goto loop107; 
     1439                            }else{ 
     1440                                setError("Expected Whitespace."); 
     1441                                position = start; 
     1442                                goto mismatch106; 
     1443                            } 
     1444                        } 
     1445                    loopend108: 
     1446                        {} 
     1447                    } 
     1448                    goto match105; 
     1449                mismatch106: 
     1450                    position = start; 
     1451                match105: 
     1452                    clearErrors(); 
     1453                } 
     1454            } 
     1455            {//OptionalExpr 
     1456                {//Expression 
     1457                    uint start = position; 
    13861458                    if((parse_Binding().assign!(Binding)(bind_binding))){ 
    13871459                        clearErrors(); 
     
    14001472        } 
    14011473    match101: 
    1402         debug writefln("parse_Literal() PASS"); 
    1403         ResultT!(LiteralExpr) passed = ResultT!(LiteralExpr)(new LiteralExpr(bind_name,bind_binding)); 
     1474        debug writefln("parse_LiteralExpr() PASS"); 
     1475        ResultT!(LiteralExpr) passed = ResultT!(LiteralExpr)(new LiteralExpr(bind_name,bind_binding,bind_args)); 
    14041476        return passed; 
    14051477    mismatch102: 
    14061478        position = start; 
    14071479        ResultT!(LiteralExpr) failed = ResultT!(LiteralExpr)(); 
     1480        return failed; 
     1481    } 
     1482 
     1483    /* 
     1484     
     1485CustomTerminal 
     1486    = new CustomTerminal(String name,Binding binding) 
     1487    ::=  "&" Identifier:name  ws [ Binding:binding ] ; 
     1488 
     1489    */ 
     1490    public ResultT!(CustomTerminal) parse_CustomTerminal(){ 
     1491        debug writefln("parse_CustomTerminal()"); 
     1492        uint start = position; 
     1493        String bind_name; 
     1494        Binding bind_binding; 
     1495         
     1496         
     1497        {//Expression 
     1498            uint start = position; 
     1499            if(!(terminal("&").success)){ 
     1500                goto mismatch112; 
     1501            } 
     1502            if(!(parse_Identifier().assign!(String)(bind_name))){ 
     1503                goto mismatch112; 
     1504            } 
     1505            if(!(parse_ws().success)){ 
     1506                goto mismatch112; 
     1507            } 
     1508            {//OptionalExpr 
     1509                {//Expression 
     1510                    uint start = position; 
     1511                    if((parse_Binding().assign!(Binding)(bind_binding))){ 
     1512                        clearErrors(); 
     1513                    }else{ 
     1514                        position = start; 
     1515                    } 
     1516                } 
     1517            } 
     1518            goto match111; 
     1519        mismatch112: 
     1520            position = start; 
     1521            goto mismatch110; 
     1522        match111: 
     1523            clearErrors(); 
     1524            goto match109; 
     1525        } 
     1526    match109: 
     1527        debug writefln("parse_CustomTerminal() PASS"); 
     1528        ResultT!(CustomTerminal) passed = ResultT!(CustomTerminal)(new CustomTerminal(bind_name,bind_binding)); 
     1529        return passed; 
     1530    mismatch110: 
     1531        position = start; 
     1532        ResultT!(CustomTerminal) failed = ResultT!(CustomTerminal)(); 
    14081533        return failed; 
    14091534    } 
     
    14261551            uint start = position; 
    14271552            if(!(terminal(":").success)){ 
    1428                 goto mismatch108
    1429             } 
    1430             if(!(parse_ws().success)){ 
    1431                 goto mismatch108
     1553                goto mismatch116
     1554            } 
     1555            if(!(parse_ws().success)){ 
     1556                goto mismatch116
    14321557            } 
    14331558            {//OptionalExpr 
     
    14441569            } 
    14451570            if(!(parse_ws().success)){ 
    1446                 goto mismatch108
     1571                goto mismatch116
    14471572            } 
    14481573            if(!(parse_Identifier().assign!(String)(bind_name))){ 
    1449                 goto mismatch108
    1450             } 
    1451             goto match107
    1452         mismatch108
    1453             position = start; 
    1454             goto mismatch106
    1455         match107
    1456             clearErrors(); 
    1457             goto match105
    1458         } 
    1459     match105
     1574                goto mismatch116
     1575            } 
     1576            goto match115
     1577        mismatch116
     1578            position = start; 
     1579            goto mismatch114
     1580        match115
     1581            clearErrors(); 
     1582            goto match113
     1583        } 
     1584    match113
    14601585        debug writefln("parse_Binding() PASS"); 
    14611586        ResultT!(Binding) passed = ResultT!(Binding)(new Binding(bind_isConcat,bind_name)); 
    14621587        return passed; 
    1463     mismatch106
     1588    mismatch114
    14641589        position = start; 
    14651590        ResultT!(Binding) failed = ResultT!(Binding)(); 
     
    14871612                    uint start = position; 
    14881613                    if(!(parse_IdentifierStartChar().success)){ 
    1489                         goto mismatch114
     1614                        goto mismatch122
    14901615                    } 
    14911616                    {//ZeroOrMoreExpr 
    14921617                        uint termPos; 
    1493                     loop115
     1618                    loop123
    14941619                        termPos = position; 
    14951620                        {//Expression 
     
    14971622                            if((parse_IdentifierChar().success)){ 
    14981623                                clearErrors(); 
    1499                                 goto loop115
     1624                                goto loop123
    15001625                            }else{ 
    15011626                                setError("Expected IdentifierChar."); 
    15021627                                position = start; 
    1503                                 goto loopend116
     1628                                goto loopend124
    15041629                            } 
    15051630                        } 
    1506                     loopend116
     1631                    loopend124
    15071632                        {} 
    15081633                    } 
    1509                     goto match113
    1510                 mismatch114
     1634                    goto match121
     1635                mismatch122
    15111636                    setError("Expected IdentifierStartChar."); 
    15121637                    position = start; 
    1513                     goto mismatch112
    1514                 match113
     1638                    goto mismatch120
     1639                match121
    15151640                    clearErrors(); 
    15161641                } 
    15171642                smartAssign!(String,String)(bind_value,sliceData(start,position)); 
    15181643            } 
    1519             goto match111
    1520         mismatch112
    1521             position = start; 
    1522             goto mismatch110
    1523         match111
    1524             clearErrors(); 
    1525             goto match109
    1526         } 
    1527     match109
     1644            goto match119
     1645        mismatch120
     1646            position = start; 
     1647            goto mismatch118
     1648        match119
     1649            clearErrors(); 
     1650            goto match117
     1651        } 
     1652    match117
    15281653        debug writefln("parse_Identifier() PASS"); 
    15291654        return ResultT!(String)(bind_value); 
    1530     mismatch110
     1655    mismatch118
    15311656        position = start; 
    15321657        return ResultT!(String)(); 
     
    15571682                        setError("Expected Letter."); 
    15581683                        position = start; 
    1559                         goto mismatch120
     1684                        goto mismatch128
    15601685                    } 
    15611686                } 
    15621687                smartAssign!(String,String)(bind_text,sliceData(start,position)); 
    15631688            } 
    1564             goto match119
    1565         mismatch120
    1566             position = start; 
    1567             goto mismatch118
    1568         match119
    1569             clearErrors(); 
    1570             goto match117
    1571         } 
    1572     match117
     1689            goto match127
     1690        mismatch128
     1691            position = start; 
     1692            goto mismatch126
     1693        match127
     1694            clearErrors(); 
     1695            goto match125
     1696        } 
     1697    match125
    15731698        debug writefln("parse_IdentifierStartChar() PASS"); 
    15741699        return ResultT!(String)(bind_text); 
    1575     mismatch118
     1700    mismatch126
    15761701        position = start; 
    15771702        return ResultT!(String)(); 
     
    16021727                        setError("Expected Letter or Digit."); 
    16031728                        position = start; 
    1604                         goto mismatch124
     1729                        goto mismatch132
    16051730                    } 
    16061731                } 
    16071732                smartAssign!(String,String)(bind_text,sliceData(start,position)); 
    16081733            } 
    1609             goto match123
    1610         mismatch124
    1611             position = start; 
    1612             goto mismatch122
    1613         match123
    1614             clearErrors(); 
    1615             goto match121
    1616         } 
    1617     match121
     1734            goto match131
     1735        mismatch132
     1736            position = start; 
     1737            goto mismatch130
     1738        match131
     1739            clearErrors(); 
     1740            goto match129
     1741        } 
     1742    match129
    16181743        debug writefln("parse_IdentifierChar() PASS"); 
    16191744        return ResultT!(String)(bind_text); 
    1620     mismatch122
     1745    mismatch130
    16211746        position = start; 
    16221747        return ResultT!(String)(); 
     
    16391764            uint start = position; 
    16401765            if(!(terminal("\"").success)){ 
    1641                 goto mismatch128
     1766                goto mismatch136
    16421767            } 
    16431768            {//ZeroOrMoreExpr 
    16441769                uint start = position; 
    16451770                uint termPos; 
    1646             loop129
     1771            loop137
    16471772                termPos = position; 
    16481773                {//Expression 
     
    16501775                    if((terminal("\"").success)){ 
    16511776                        clearErrors(); 
    1652                         goto loopend130
     1777                        goto loopend138
    16531778                    }else{ 
    16541779                        position = start; 
     
    16591784                    if((parse_AnyChar().success)){ 
    16601785                        clearErrors(); 
    1661                         goto loop129
     1786                        goto loop137
    16621787                    }else{ 
    16631788                        setError("Expected AnyChar."); 
    16641789                        position = start; 
    1665                         goto mismatch128
    1666                     } 
    1667                 } 
    1668             loopend130
     1790                        goto mismatch136
     1791                    } 
     1792                } 
     1793            loopend138
    16691794                smartAssign!(String,String)(bind_text,sliceData(start,termPos)); 
    16701795                {} 
    16711796            } 
    1672             goto match127
    1673         mismatch128
    1674             position = start; 
    1675             goto mismatch126
    1676         match127
    1677             clearErrors(); 
    1678             goto match125
    1679         } 
    1680     match125
     1797            goto match135
     1798        mismatch136
     1799            position = start; 
     1800            goto mismatch134
     1801        match135
     1802            clearErrors(); 
     1803            goto match133
     1804        } 
     1805    match133
    16811806        debug writefln("parse_String() PASS"); 
    16821807        return ResultT!(String)(bind_text); 
    1683     mismatch126
     1808    mismatch134
    16841809        position = start; 
    16851810        return ResultT!(String)(); 
     
    17021827            uint start = position; 
    17031828            if(!(terminal("#").success)){ 
    1704                 goto mismatch134
     1829                goto mismatch142
    17051830            } 
    17061831            {//GroupExpr 
     
    17131838                        setError("Expected Hexdigit."); 
    17141839                        position = start; 
    1715                         goto mismatch134
     1840                        goto mismatch142
    17161841                    } 
    17171842                } 
    17181843                smartAssign!(String,String)(bind_text,sliceData(start,position)); 
    17191844            } 
    1720             goto match133
    1721         mismatch134
    1722             position = start; 
    1723             goto mismatch132
    1724         match133
    1725             clearErrors(); 
    1726             goto match131
    1727         } 
    1728     match131
     1845            goto match141
     1846        mismatch142
     1847            position = start; 
     1848            goto mismatch140
     1849        match141
     1850            clearErrors(); 
     1851            goto match139
     1852        } 
     1853    match139
    17291854        debug writefln("parse_HexChar() PASS"); 
    17301855        auto value = hexToChar(bind_text); 
    17311856        return ResultT!(String)(value); 
    1732     mismatch132
     1857    mismatch140
    17331858        position = start; 
    17341859        return ResultT!(String)(); 
     
    17611886            } 
    17621887            if(!(parse_any().assignCat!(String)(bind_value))){ 
    1763                 goto mismatch138
    1764             } 
    1765             goto match137
    1766         mismatch138
    1767             position = start; 
    1768             goto mismatch136
    1769         match137
    1770             clearErrors(); 
    1771             goto match135
    1772         } 
    1773     match135
     1888                goto mismatch146
     1889            } 
     1890            goto match145
     1891        mismatch146
     1892            position = start; 
     1893            goto mismatch144
     1894        match145
     1895            clearErrors(); 
     1896            goto match143
     1897        } 
     1898    match143
    17741899        debug writefln("parse_AnyChar() PASS"); 
    17751900        return ResultT!(String)(bind_value); 
    1776     mismatch136
     1901    mismatch144
    17771902        position = start; 
    17781903        return ResultT!(String)(); 
     
    17951920            uint start = position; 
    17961921            if(!(terminal("#").success)){ 
    1797                 goto mismatch142
     1922                goto mismatch150
    17981923            } 
    17991924            {//ZeroOrMoreExpr 
    18001925                uint start = position; 
    18011926                uint termPos; 
    1802             loop143
     1927            loop151
    18031928                termPos = position; 
    18041929                {//Expression 
     
    18061931                    if((parse_eol().success)){ 
    18071932                        clearErrors(); 
    1808                         goto loopend144
     1933                        goto loopend152
    18091934                    }else{ 
    18101935                        position = start; 
     
    18151940                    if((parse_any().success)){ 
    18161941                        clearErrors(); 
    1817                         goto loop143
     1942                        goto loop151
    18181943                    }else{ 
    18191944                        setError("Expected any."); 
    18201945                        position = start; 
    1821                         goto mismatch142
    1822                     } 
    1823                 } 
    1824             loopend144
     1946                        goto mismatch150
     1947                    } 
     1948                } 
     1949            loopend152
    18251950                smartAssign!(String,String)(bind_text,sliceData(start,termPos)); 
    18261951                {} 
    18271952            } 
    1828             goto match141
    1829         mismatch142
    1830             position = start; 
    1831             goto mismatch140
    1832         match141
    1833             clearErrors(); 
    1834             goto match139
    1835         } 
    1836     match139
     1953            goto match149
     1954        mismatch150
     1955            position = start; 
     1956            goto mismatch148
     1957        match149
     1958            clearErrors(); 
     1959            goto match147
     1960        } 
     1961    match147
    18371962        debug writefln("parse_Comment() PASS"); 
    18381963        ResultT!(Comment) passed = ResultT!(Comment)(new Comment(bind_text)); 
    18391964        return passed; 
    1840     mismatch140
     1965    mismatch148
    18411966        position = start; 
    18421967        ResultT!(Comment) failed = ResultT!(Comment)(); 
     
    18601985            uint start = position; 
    18611986            if(!(terminal(".").success)){ 
    1862                 goto mismatch148
     1987                goto mismatch156
    18631988            } 
    18641989            {//Expression 
     
    18691994                    setError("Expected ImportDirective, BaseClassDirective, ClassnameDirective, DefineDirective, StartDirective, IncludeDirective, AliasDirective, ModuleDirective or CodeDirective."); 
    18701995                    position = start; 
    1871                     goto mismatch148
    1872                 } 
    1873             } 
    1874             goto match147
    1875         mismatch148
    1876             position = start; 
    1877             goto mismatch146
    1878         match147
    1879             clearErrors(); 
    1880             goto match145
    1881         } 
    1882     match145
     1996                    goto mismatch156
     1997                } 
     1998            } 
     1999            goto match155
     2000        mismatch156
     2001            position = start; 
     2002            goto mismatch154
     2003        match155
     2004            clearErrors(); 
     2005            goto match153
     2006        } 
     2007    match153
    18832008        debug writefln("parse_Directive() PASS"); 
    18842009        return ResultT!(Directive)(bind_dir); 
    1885     mismatch146
     2010    mismatch154
    18862011        position = start; 
    18872012        return ResultT!(Directive)(); 
     
    19052030            if((terminal("import").success && parse_ws().success && terminal("(").success && parse_ws().success && parse_DirectiveArg().assign!(String)(bind_imp) && parse_ws().success && terminal(")").success && parse_ws().success && terminal(";").success)){ 
    19062031                clearErrors(); 
    1907                 goto match149
     2032                goto match157
    19082033            }else{ 
    19092034                position = start; 
    1910                 goto mismatch150
    1911             } 
    1912         } 
    1913     match149
     2035                goto mismatch158
     2036            } 
     2037        } 
     2038    match157
    19142039        debug writefln("parse_ImportDirective() PASS"); 
    19152040        ResultT!(ImportDirective) passed = ResultT!(ImportDirective)(new ImportDirective(bind_imp)); 
    19162041        return passed; 
    1917     mismatch150
     2042    mismatch158
    19182043        position = start; 
    19192044        ResultT!(ImportDirective) failed = ResultT!(ImportDirective)(); 
     
    19372062            uint start = position; 
    19382063            if((terminal("baseclass").success && parse_ws().success && terminal("(").success && parse_ws().success && parse_DirectiveArg().assign!(String)(bind_name) && parse_ws().success && terminal(")").success && parse_ws().success && terminal(";").success)){ 
    1939                 clearErrors(); 
    1940                 goto match151; 
    1941             }else{ 
    1942                 position = start; 
    1943                 goto mismatch152; 
    1944             } 
    1945         } 
    1946     match151: 
    1947         debug writefln("parse_BaseClassDirective() PASS"); 
    1948         ResultT!(BaseClassDirective) passed = ResultT!(BaseClassDirective)(new BaseClassDirective(bind_name)); 
    1949         return passed; 
    1950     mismatch152: 
    1951         position = start; 
    1952         ResultT!(BaseClassDirective) failed = ResultT!(BaseClassDirective)(); 
    1953         return failed; 
    1954     } 
    1955  
    1956     /* 
    1957      
    1958 ClassnameDirective 
    1959     = new ClassnameDirective(String name) 
    1960     ::=  "classname" ws "(" ws DirectiveArg:name  ws ")" ws ";"; 
    1961  
    1962     */ 
    1963     public ResultT!(ClassnameDirective) parse_ClassnameDirective(){ 
    1964         debug writefln("parse_ClassnameDirective()"); 
    1965         uint start = position; 
    1966         String bind_name; 
    1967          
    1968          
    1969         {//Expression 
    1970             uint start = position; 
    1971             if((terminal("classname").success && parse_ws().success && terminal("(").success && parse_ws().success && parse_DirectiveArg().assign!(String)(bind_name) && parse_ws().success && terminal(")").success && parse_ws().success && terminal(";").success)){ 
    1972                 clearErrors(); 
    1973                 goto match153; 
    1974             }else{ 
    1975                 position = start; 
    1976                 goto mismatch154; 
    1977             } 
    1978         } 
    1979     match153: 
    1980         debug writefln("parse_ClassnameDirective() PASS"); 
    1981         ResultT!(ClassnameDirective) passed = ResultT!(ClassnameDirective)(new ClassnameDirective(bind_name)); 
    1982         return passed; 
    1983     mismatch154: 
    1984         position = start; 
    1985         ResultT!(ClassnameDirective) failed = ResultT!(ClassnameDirective)(); 
    1986         return failed; 
    1987     } 
    1988  
    1989     /* 
    1990      
    1991 DefineDirective 
    1992     = new DefineDirective(String returnType,String name,bool isTerminal,String description) 
    1993     ::=  "define" ws "(" ws DirectiveArg:returnType  ws "," ws DirectiveArg:name  ws "," ws DirectiveArg:isTerminal  ws [ "," ws DirectiveArg:description  ws]  ")" ws ";"; 
    1994  
    1995     */ 
    1996     public ResultT!(DefineDirective) parse_DefineDirective(){ 
    1997         debug writefln("parse_DefineDirective()"); 
    1998         uint start = position; 
    1999         String bind_returnType; 
    2000         String bind_name; 
    2001         bool bind_isTerminal; 
    2002         String bind_description; 
    2003          
    2004          
    2005         {//Expression 
    2006             uint start = position; 
    2007             if(!(terminal("define").success)){ 
    2008                 goto mismatch158; 
    2009             } 
    2010             if(!(parse_ws().success)){ 
    2011                 goto mismatch158; 
    2012             } 
    2013             if(!(terminal("(").success)){ 
    2014                 goto mismatch158; 
    2015             } 
    2016             if(!(parse_ws().success)){ 
    2017                 goto mismatch158; 
    2018             } 
    2019             if(!(parse_DirectiveArg().assign!(String)(bind_returnType))){ 
    2020                 goto mismatch158; 
    2021             } 
    2022             if(!(parse_ws().success)){ 
    2023                 goto mismatch158; 
    2024             } 
    2025             if(!(terminal(",").success)){ 
    2026                 goto mismatch158; 
    2027             } 
    2028             if(!(parse_ws().success)){ 
    2029                 goto mismatch158; 
    2030             } 
    2031             if(!(parse_DirectiveArg().assign!(String)(bind_name))){ 
    2032                 goto mismatch158; 
    2033             } 
    2034             if(!(parse_ws().success)){ 
    2035                 goto mismatch158; 
    2036             } 
    2037             if(!(terminal(",").success)){ 
    2038                 goto mismatch158; 
    2039             } 
    2040             if(!(parse_ws().success)){ 
    2041                 goto mismatch158; 
    2042             } 
    2043             if(!(parse_DirectiveArg().assign!(bool)(bind_isTerminal))){ 
    2044                 goto mismatch158; 
    2045             } 
    2046             if(!(parse_ws().success)){ 
    2047                 goto mismatch158; 
    2048             } 
    2049             {//OptionalExpr 
    2050                 {//Expression 
    2051                     uint start = position; 
    2052                     if((terminal(",").success && parse_ws().success && parse_DirectiveArg().assign!(String)(bind_description) && parse_ws().success)){ 
    2053                         clearErrors(); 
    2054                     }else{ 
    2055                         position = start; 
    2056                     } 
    2057                 } 
    2058             } 
    2059             if(!(terminal(")").success)){ 
    2060                 goto mismatch158; 
    2061             } 
    2062             if(!(parse_ws().success)){ 
    2063                 goto mismatch158; 
    2064             } 
    2065             if(!(terminal(";").success)){ 
    2066                 goto mismatch158; 
    2067             } 
    2068             goto match157; 
    2069         mismatch158: 
    2070             position = start; 
    2071             goto mismatch156; 
    2072         match157: 
    2073             clearErrors(); 
    2074             goto match155; 
    2075         } 
    2076     match155: 
    2077         debug writefln("parse_DefineDirective() PASS"); 
    2078         ResultT!(DefineDirective) passed = ResultT!(DefineDirective)(new DefineDirective(bind_returnType,bind_name,bind_isTerminal,bind_description)); 
    2079         return passed; 
    2080     mismatch156: 
    2081         position = start; 
    2082         ResultT!(DefineDirective) failed = ResultT!(DefineDirective)(); 
    2083         return failed; 
    2084     } 
    2085  
    2086     /* 
    2087      
    2088 StartDirective 
    2089     = new StartDirective(String production) 
    2090     ::=  "start" ws "(" ws DirectiveArg:production  ws ")" ws ";"; 
    2091  
    2092     */ 
    2093     public ResultT!(StartDirective) parse_StartDirective(){ 
    2094         debug writefln("parse_StartDirective()"); 
    2095         uint start = position; 
    2096         String bind_production; 
    2097          
    2098          
    2099         {//Expression 
    2100             uint start = position; 
    2101             if((terminal("start").success && parse_ws().success && terminal("(").success && parse_ws().success && parse_DirectiveArg().assign!(String)(bind_production) && parse_ws().success && terminal(")").success && parse_ws().success && terminal(";").success)){ 
    21022064                clearErrors(); 
    21032065                goto match159; 
     
    21082070        } 
    21092071    match159: 
    2110         debug writefln("parse_StartDirective() PASS"); 
    2111         ResultT!(StartDirective) passed = ResultT!(StartDirective)(new StartDirective(bind_production)); 
     2072        debug writefln("parse_BaseClassDirective() PASS"); 
     2073        ResultT!(BaseClassDirective) passed = ResultT!(BaseClassDirective)(new BaseClassDirective(bind_name)); 
    21122074        return passed; 
    21132075    mismatch160: 
    21142076        position = start; 
    2115         ResultT!(StartDirective) failed = ResultT!(StartDirective)(); 
    2116         return failed; 
    2117     } 
    2118  
    2119     /* 
    2120      
    2121 IncludeDirective 
    2122     = new IncludeDirective(String filename) 
    2123     ::=  "include" ws "(" ws String:filename  ws ")" ws ";"; 
    2124  
    2125     */ 
    2126     public ResultT!(IncludeDirective) parse_IncludeDirective(){ 
    2127         debug writefln("parse_IncludeDirective()"); 
    2128         uint start = position; 
    2129         String bind_filename; 
    2130