• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆-91  評(píng)論-137  文章-0  trackbacks-0
              1 %token "function" "as" "end";
              2 %token "integer" "string" "bool" "pointer";
              3 %token "if" "then" "else";
              4 %token "do" "while";
              5 %token "for" "to" "step" "next";
              6 %token "switch" "case" "default";
              7 %token "call" "return";
              8 %token "dll" "com" "name" "lib" "class" "alias";
              9 %token "true" "false";
             10 %token ";" "," "+" "-" "*" "/" "=" "[" "]" ":";
             11 %token ">" "<" ">=" "<=" "==";
             12 %token "not" "and" "or";
             13 
             14 %start program;
             15 
             16 var_type    ->    "integer"
             17         |    "string"
             18         |    "bool"
             19         |    "pointer"
             20         ;
             21 
             22 value_type    ->    array
             23         |    "{String}"
             24         |    "{Symbol}"
             25         |    "{digit}"
             26         |    "true"
             27         |    "false"
             28         |    function_closure
             29         ;
             30 
             31 array        ->    "{Symbol}" "[" value_list "]"
             32         ;
             33 
             34 paramter_list    ->    paramter_list "," function_closure
             35         |    paramter_list "," var_type value_type
             36         |    function_closure
             37         |    var_type value_type
             38         ;
             39 
             40 value_list    ->    value_list "," exp
             41         |    exp
             42         ;
             43 
             44 program        ->    item_list
             45         ;
             46 
             47 item_list    ->    item_list item
             48         |    item
             49         ;
             50 
             51 item        ->    function_desc
             52         |    define_desc
             53         |    array_desc
             54         ;
             55 
             56 stmt_list    ->    stmt_list stmt
             57         |    stmt
             58         ;
             59 
             60 stmt        ->    define_desc
             61         |    array_desc
             62         |    if_desc
             63         |    do_desc
             64         |    while_desc
             65         |    for_desc
             66         |    assign_desc
             67         |    call_desc
             68         |    switch_desc
             69         |    return_desc
             70         |    dll_desc
             71         |    com_desc
             72         |    ";"
             73         ;
             74 
             75 function_desc    ->    "function" "{Symbol}" "{LQ}" "{RQ}" "as" var_type stmt_list "end" "function"
             76         |    "function" "{Symbol}" "{LQ}" "{RQ}" stmt_list "end" "function"
             77         |    "function" "{Symbol}" "{LQ}" "{RQ}" "as" var_type "end" "function"
             78         |    "function" "{Symbol}" "{LQ}" "{RQ}" "end" "function"
             79         |    "function" "{Symbol}" "{LQ}" paramter_list "{RQ}" "as" var_type stmt_list "end" "function"
             80         |    "function" "{Symbol}" "{LQ}" paramter_list "{RQ}" stmt_list "end" "function"
             81         |    "function" "{Symbol}" "{LQ}" paramter_list "{RQ}" "as" var_type "end" "function"
             82         |    "function" "{Symbol}" "{LQ}" paramter_list "{RQ}" "end" "function"
             83         ;
             84 
             85 function_closure    ->    "function" "{LQ}" "{RQ}" "as" var_type stmt_list "end" "function"
             86             |    "function" "{LQ}" "{RQ}" stmt_list "end" "function"
             87             |    "function" "{LQ}" "{RQ}" "as" var_type "end" "function"
             88             |    "function" "{LQ}" "{RQ}" "end" "function"
             89             |    "function" "{LQ}" paramter_list "{RQ}" "as" var_type stmt_list "end" "function"
             90             |    "function" "{LQ}" paramter_list "{RQ}" stmt_list "end" "function"
             91             |    "function" "{LQ}" paramter_list "{RQ}" "as" var_type "end" "function"
             92             |    "function" "{LQ}" paramter_list "{RQ}" "end" "function"
             93             ;
             94 
             95 define_desc    ->    define_desc "," "{Symbol}" "[" value_list "]"
             96         |    define_desc "," "{Symbol}" "[" "]"
             97         |    define_desc "," "{Symbol}" "=" value_type
             98         |    define_desc "," "{Symbol}"
             99         |    var_type "{Symbol}" "=" value_type
            100         |    var_type "{Symbol}"
            101         ;
            102 
            103 array_desc    ->    array_desc "," "{Symbol}" "[" value_list "]"
            104         |    array_desc "," "{Symbol}" "[" "]"
            105         |    array_desc "," "{Symbol}" "=" value_type
            106         |    array_desc "," "{Symbol}"
            107         |    var_type "{Symbol}" "[" value_list "]"
            108         |    var_type "{Symbol}" "[" "]"
            109         ;
            110 
            111 if_desc        ->    "if" exp "then" "else" "end" "if"
            112         |    "if" exp "then" "else" stmt_list "end" "if"
            113         |    "if" exp "then" stmt_list "else" "end" "if"
            114         |    "if" exp "then" stmt_list "else" stmt_list "end" "if"
            115         |    "if" exp "then" "end" "if"
            116         |    "if" exp "then" stmt_list "end" "if"
            117         ;
            118 
            119 do_desc        ->    "do" stmt_list "while" exp
            120         |    "do" "while" exp
            121         ;
            122 
            123 while_desc    ->    "while" exp "do" stmt_list "end" "while"
            124         |    "while" exp "do" "end" "while"
            125         ;
            126 
            127 for_desc    ->    "for" "{Symbol}" "=" exp "to" exp "do" stmt_list "next"
            128         |    "for" "{Symbol}" "=" exp "to" exp "do" "next"
            129         |    "for" "{Symbol}" "=" exp "to" exp "step" exp "do" stmt_list "next"
            130         |    "for" "{Symbol}" "=" exp "to" exp "step" exp "do" "next"
            131         ;
            132 
            133 assign_desc    ->    array "=" exp
            134         |    "{Symbol}" "=" exp
            135         ;
            136 
            137 call_desc    ->    "{Symbol}" "{LQ}" "{RQ}"
            138         |    "{Symbol}" "{LQ}" value_list "{RQ}"
            139         |    "call" "{Symbol}" "{LQ}" "{RQ}"
            140         |    "call" "{Symbol}" "{LQ}" value_list "{RQ}"
            141         ;
            142 
            143 switch_desc    ->    "switch" exp "do" case_list "end" "switch"
            144         |    "switch" exp "do" "end" "switch"
            145         ;
            146 
            147 case_list    ->    case_list "case" exp ":"
            148         |    case_list "default" ":"
            149         |    "case" exp ":"
            150         |    "default" ":"
            151         ;
            152 
            153 return_desc    ->    "return" function_closure
            154         |    "return" exp
            155         |    "return"
            156         ;
            157 
            158 dll_desc    ->    "dll" "lib" "{Symbol}" "function" "{Symbol}" "{LQ}" "{RQ}"
            159         |    "dll" "lib" "{Symbol}" "function" "{Symbol}" "alias" "{Symbol}" "{LQ}" "{RQ}"
            160         |    "dll" "lib" "{Symbol}" "function" "{Symbol}" "{LQ}" paramter_list "{RQ}"
            161         |    "dll" "lib" "{Symbol}" "function" "{Symbol}" "alias" "{Symbol}" "{LQ}" paramter_list "{RQ}"
            162         ;
            163 
            164 com_desc    ->    "com" "lib" "{Symbol}" "class" "{Symbol}" "function" "{Symbol}" "{LQ}" "{RQ}"
            165         |    "com" "lib" "{Symbol}" "class" "{Symbol}" "function" "{Symbol}" "alias" "{Symbol}" "{LQ}" "{RQ}"
            166         |    "com" "lib" "{Symbol}" "class" "{Symbol}" "function" "{Symbol}" "{LQ}" paramter_list "{RQ}"
            167         |    "com" "lib" "{Symbol}" "class" "{Symbol}" "function" "{Symbol}" "alias" "{Symbol}" "{LQ}" paramter_list "{RQ}"
            168         ;
            169 
            170 exp        ->    exp ">" exp1
            171         |    exp "<" exp1
            172         |    exp ">=" exp1
            173         |    exp "<=" exp1
            174         |    exp "==" exp1
            175         |    exp "and" exp1
            176         |    exp "or" exp1
            177         |    "not" exp1
            178         |    exp1
            179         ;
            180 
            181 exp1        ->    exp1 "+" exp2
            182         |    exp1 "-" exp2
            183         |    exp2
            184         ;
            185 
            186 exp2        ->    exp2 "*" exp3
            187         |    exp2 "/" exp3
            188         |    exp3
            189         ;
            190 
            191 exp3        ->    "{LQ}" exp "{RQ}"
            192         |    value_type
            193         ;
            尚未包含實(shí)數(shù)部分
            posted on 2010-09-17 22:04 lwch 閱讀(1073) 評(píng)論(0)  編輯 收藏 引用 所屬分類: QLanguage
            久久一区二区三区99| 蜜臀久久99精品久久久久久| 99久久精品日本一区二区免费| 久久综合视频网| 少妇精品久久久一区二区三区 | 亚洲国产一成久久精品国产成人综合| 久久久受www免费人成| 漂亮人妻被黑人久久精品| 久久综合丁香激情久久| 国产精品99久久久久久宅男小说| 久久久精品国产sm调教网站 | 国产精品久久新婚兰兰| 国产成人精品久久免费动漫| 久久精品18| 国产精品久久久久久福利漫画| 欧美成a人片免费看久久| 国产麻豆精品久久一二三| 蜜桃麻豆www久久国产精品| 青青草国产成人久久91网| 中文字幕热久久久久久久| 久久www免费人成精品香蕉| 97久久精品人妻人人搡人人玩| 午夜精品久久久久久久无码| 丁香久久婷婷国产午夜视频| 久久久久人妻一区二区三区vr| 青青热久久国产久精品 | 久久婷婷国产剧情内射白浆| 国产亚洲美女精品久久久| 好久久免费视频高清| 久久精品一区二区三区AV| 亚洲?V乱码久久精品蜜桃 | 久久噜噜久久久精品66| 国产成人精品久久| 久久99精品国产99久久6男男| 久久一日本道色综合久久| 久久人人爽人人爽人人片AV高清 | 久久久久亚洲av无码专区导航| 久久久久亚洲精品日久生情| 亚洲国产高清精品线久久| 久久综合九色综合久99| 久久久中文字幕日本|