Changeset 2678


Ignore:
Timestamp:
Apr 10, 2007, 9:48:32 PM (14 years ago)
Author:
yura
Message:
  • Grammar with inner pattern alternatives.
Location:
devel-tools/trunk/LL1GrammarAnalyzers/LLAnalyzerInSML
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/LL1GrammarAnalyzers/LLAnalyzerInSML/rfpllgr.g

    r2548 r2678  
    113113
    114114func_body
    115         :       pattern_alt
    116         |       sentence
     115        :       sentence
    117116        ;
    118117
     
    128127sentence
    129128        :       pattern o_rest
     129        |       pattern_alt source_tail sentence_tail
     130        ;
     131
     132sentence_tail
     133        :       o_rest
     134        |       LET hard_exp o_rest
     135        |       ITER source iter_tail
     136        |       COL sentence
    130137        ;
    131138
  • devel-tools/trunk/LL1GrammarAnalyzers/LLAnalyzerInSML/rfpllgr.ga

    r2548 r2678  
    22Nullable nonterminals:
    33
    4   (const_bindings | const_bindings_tail | const_exp | decls | directives |
    5   format_exp | func_body | hard_exp | implem | imports |
    6   interf | iter_tail | match_direction | module_names | o_rest |
    7   obj_names | path | path_tail | paths | pattern |
    8   pattern_exp | result_exp | sentence | sentences | source |
    9   source_tail)
     4  (const_bindings | const_bindings_tail | const_exp | decls | directives | 
     5  format_exp | func_body | hard_exp | implem | imports | 
     6  interf | iter_tail | match_direction | module_names | o_rest | 
     7  obj_names | path | path_tail | paths | pattern | 
     8  pattern_exp | result_exp | sentence | sentence_tail | sentences |
     9  source | source_tail)
    1010
    1111
     
    1717  (CONST | FUNC_DECL | OBJ_DECL)
    1818implem ->
    19   (CONST | FUNC_DECL | OBJ_DECL | TRACE_ALL | USE |
     19  (CONST | FUNC_DECL | OBJ_DECL | TRACE_ALL | USE | 
    2020  WORD)
    2121imports ->
     
    5252  (WORD)
    5353func_body ->
    54   (CHAR | COMMA | CUT | EQL | ERROR |
    55   FAIL | FENCE | LCURL | LPAR | MATCH_DIR |
    56   NOT | NUMB | REF | TRAP | VAR |
     54  (CHAR | COMMA | CUT | EQL | ERROR | 
     55  FAIL | FENCE | LCURL | LPAR | MATCH_DIR | 
     56  NOT | NUMB | REF | TRAP | VAR | 
    5757  WORD)
    5858pattern_alt ->
    5959  (LCURL)
    6060sentences ->
    61   (CHAR | COMMA | CUT | EQL | ERROR |
    62   FAIL | FENCE | LPAR | MATCH_DIR | NOT |
    63   NUMB | REF | SC | TRAP | VAR |
    64   WORD)
     61  (CHAR | COMMA | CUT | EQL | ERROR | 
     62  FAIL | FENCE | LCURL | LPAR | MATCH_DIR |
     63  NOT | NUMB | REF | SC | TRAP |
     64  VAR | WORD)
    6565sentence ->
    66   (CHAR | COMMA | CUT | EQL | ERROR |
    67   FAIL | FENCE | LPAR | MATCH_DIR | NOT |
    68   NUMB | REF | TRAP | VAR | WORD)
     66  (CHAR | COMMA | CUT | EQL | ERROR |
     67  FAIL | FENCE | LCURL | LPAR | MATCH_DIR |
     68  NOT | NUMB | REF | TRAP | VAR |
     69  WORD)
     70sentence_tail ->
     71  (COL | COMMA | CUT | EQL | ERROR |
     72  FAIL | FENCE | ITER | LET | NOT |
     73  TRAP)
    6974path ->
    70   (CHAR | COL | COL_CURL | COMMA | CUT |
    71   EQL | ERROR | FAIL | FENCE | ITER |
    72   LANGU | LCURL | LET | LPAR | NOT |
     75  (CHAR | COL | COL_CURL | COMMA | CUT | 
     76  EQL | ERROR | FAIL | FENCE | ITER | 
     77  LANGU | LCURL | LET | LPAR | NOT | 
    7378  NUMB | REF | TRAP | VAR | WORD)
    7479path_tail ->
    75   (COL | COMMA | CUT | EQL | ERROR |
    76   FAIL | FENCE | ITER | LET | NOT |
     80  (COL | COMMA | CUT | EQL | ERROR | 
     81  FAIL | FENCE | ITER | LET | NOT | 
    7782  TRAP)
    7883iter_tail ->
    79   (COMMA | CUT | EQL | ERROR | FAIL |
     84  (COMMA | CUT | EQL | ERROR | FAIL | 
    8085  FENCE | LET | NOT | TRAP)
    8186o_rest ->
    82   (COMMA | CUT | EQL | ERROR | FAIL |
     87  (COMMA | CUT | EQL | ERROR | FAIL | 
    8388  FENCE | NOT | TRAP)
    8489rest ->
    85   (COMMA | CUT | EQL | ERROR | FAIL |
     90  (COMMA | CUT | EQL | ERROR | FAIL | 
    8691  FENCE | NOT | TRAP)
    8792source ->
    88   (CHAR | COL_CURL | LANGU | LCURL | LPAR |
     93  (CHAR | COL_CURL | LANGU | LCURL | LPAR | 
    8994  NUMB | REF | VAR | WORD)
    9095source_tail ->
     
    9398  (LCURL)
    9499paths ->
    95   (CHAR | COL | COL_CURL | COMMA | CUT |
    96   EQL | ERROR | FAIL | FENCE | ITER |
    97   LANGU | LCURL | LET | LPAR | NOT |
    98   NUMB | REF | SC | TRAP | VAR |
     100  (CHAR | COL | COL_CURL | COMMA | CUT | 
     101  EQL | ERROR | FAIL | FENCE | ITER | 
     102  LANGU | LCURL | LET | LPAR | NOT | 
     103  NUMB | REF | SC | TRAP | VAR | 
    99104  WORD)
    100105pattern ->
    101   (CHAR | LPAR | MATCH_DIR | NUMB | REF |
     106  (CHAR | LPAR | MATCH_DIR | NUMB | REF | 
    102107  VAR | WORD)
    103108match_direction ->
    104109  (MATCH_DIR)
    105110pattern_exp ->
    106   (CHAR | LPAR | NUMB | REF | VAR |
     111  (CHAR | LPAR | NUMB | REF | VAR | 
    107112  WORD)
    108113pattern_exp_head ->
    109   (CHAR | LPAR | NUMB | REF | VAR |
     114  (CHAR | LPAR | NUMB | REF | VAR | 
    110115  WORD)
    111116hard_exp ->
    112   (CHAR | LPAR | NUMB | REF | VAR |
     117  (CHAR | LPAR | NUMB | REF | VAR | 
    113118  WORD)
    114119format_exp ->
    115   (CHAR | LPAR | NUMB | REF | VAR |
     120  (CHAR | LPAR | NUMB | REF | VAR | 
    116121  WORD)
    117122result_exp ->
    118   (CHAR | LANGU | LPAR | NUMB | REF |
     123  (CHAR | LANGU | LPAR | NUMB | REF | 
    119124  VAR | WORD)
    120125result_exp_head ->
    121   (CHAR | LANGU | LPAR | NUMB | REF |
     126  (CHAR | LANGU | LPAR | NUMB | REF | 
    122127  VAR | WORD)
    123128name ->
     
    138143  ($END)
    139144imports ->
    140   ($END | CONST | FUNC_DECL | OBJ_DECL | TRACE_ALL |
     145  ($END | CONST | FUNC_DECL | OBJ_DECL | TRACE_ALL | 
    141146  WORD)
    142147module_names ->
     
    158163sentence ->
    159164  (SC | WITH)
     165sentence_tail ->
     166  (SC | WITH)
    160167path ->
    161168  (SC | WITH)
     
    167174  (SC | WITH)
    168175source ->
    169   (COL | COMMA | CUT | EQL | ERROR |
    170   FAIL | FENCE | ITER | LET | NOT |
     176  (COL | COMMA | CUT | EQL | ERROR | 
     177  FAIL | FENCE | ITER | LET | NOT | 
    171178  SC | TRAP | WITH)
    172179source_tail ->
    173   (COL | COMMA | CUT | EQL | ERROR |
    174   FAIL | FENCE | ITER | LET | NOT |
     180  (COL | COMMA | CUT | EQL | ERROR | 
     181  FAIL | FENCE | ITER | LET | NOT | 
    175182  SC | TRAP | WITH)
    176183paths ->
    177184  (RCURL)
    178185pattern ->
    179   (COMMA | CUT | EQL | ERROR | FAIL |
     186  (COMMA | CUT | EQL | ERROR | FAIL | 
    180187  FENCE | NOT | SC | TRAP | WITH)
    181188match_direction ->
    182   (CHAR | COMMA | CUT | EQL | ERROR |
    183   FAIL | FENCE | LPAR | NOT | NUMB |
    184   REF | SC | TRAP | VAR | WITH |
     189  (CHAR | COMMA | CUT | EQL | ERROR | 
     190  FAIL | FENCE | LPAR | NOT | NUMB | 
     191  REF | SC | TRAP | VAR | WITH | 
    185192  WORD)
    186193pattern_exp ->
    187   (COMMA | CUT | EQL | ERROR | FAIL |
    188   FENCE | NOT | RPAR | SC | TRAP |
     194  (COMMA | CUT | EQL | ERROR | FAIL | 
     195  FENCE | NOT | RPAR | SC | TRAP | 
    189196  WITH)
    190197hard_exp ->
    191   (COMMA | CUT | EQL | ERROR | FAIL |
     198  (COMMA | CUT | EQL | ERROR | FAIL | 
    192199  FENCE | NOT | SC | TRAP | WITH)
    193200format_exp ->
    194201  (EQL | SC)
    195202result_exp ->
    196   (COL | COL_CURL | COMMA | CUT | EQL |
    197   ERROR | FAIL | FENCE | ITER | LET |
    198   NOT | RANGU | RPAR | SC | TRAP |
     203  (COL | COL_CURL | COMMA | CUT | EQL | 
     204  ERROR | FAIL | FENCE | ITER | LET | 
     205  NOT | RANGU | RPAR | SC | TRAP | 
    199206  WITH)
    200207const_exp ->
     
    217224
    218225#implem
    219 : ($END | CONST | FUNC_DECL | OBJ_DECL | TRACE_ALL |
     226: ($END | CONST | FUNC_DECL | OBJ_DECL | TRACE_ALL | 
    220227  USE | WORD)
    221228     #imports #directives
     
    223230
    224231#imports
    225 : ($END | CONST | FUNC_DECL | OBJ_DECL | TRACE_ALL |
     232: ($END | CONST | FUNC_DECL | OBJ_DECL | TRACE_ALL | 
    226233  WORD)
    227234     /* empty */
     
    326333
    327334#func_body
    328 : (LCURL)
    329      pattern_alt
    330 | (CHAR | COMMA | CUT | EQL | ERROR |
    331   FAIL | FENCE | LPAR | MATCH_DIR | NOT |
    332   NUMB | REF | SC | TRAP | VAR |
    333   WORD)
     335: (CHAR | COMMA | CUT | EQL | ERROR |
     336  FAIL | FENCE | LCURL | LPAR | MATCH_DIR |
     337  NOT | NUMB | REF | SC | TRAP |
     338  VAR | WORD)
    334339     #sentence
    335340;
     
    343348: (RCURL)
    344349     /* empty */
    345 | (CHAR | COMMA | CUT | EQL | ERROR |
    346   FAIL | FENCE | LPAR | MATCH_DIR | NOT |
    347   NUMB | REF | SC | TRAP | VAR |
    348   WORD)
     350| (CHAR | COMMA | CUT | EQL | ERROR | 
     351  FAIL | FENCE | LCURL | LPAR | MATCH_DIR |
     352  NOT | NUMB | REF | SC | TRAP |
     353  VAR | WORD)
    349354     #sentence SC #sentences
    350355;
    351356
    352357#sentence
    353 : (CHAR | COMMA | CUT | EQL | ERROR |
    354   FAIL | FENCE | LPAR | MATCH_DIR | NOT |
    355   NUMB | REF | SC | TRAP | VAR |
     358: (CHAR | COMMA | CUT | EQL | ERROR | 
     359  FAIL | FENCE | LPAR | MATCH_DIR | NOT | 
     360  NUMB | REF | SC | TRAP | VAR | 
    356361  WITH | WORD)
    357362     #pattern #o_rest
     363| (LCURL)
     364     pattern_alt #source_tail #sentence_tail
     365;
     366
     367#sentence_tail
     368: (COMMA | CUT | EQL | ERROR | FAIL |
     369  FENCE | NOT | SC | TRAP | WITH)
     370     #o_rest
     371| (LET)
     372     LET #hard_exp #o_rest
     373| (ITER)
     374     ITER #source #iter_tail
     375| (COL)
     376     COL #sentence
    358377;
    359378
    360379#path
    361 : (CHAR | COL | COL_CURL | COMMA | CUT |
    362   EQL | ERROR | FAIL | FENCE | ITER |
    363   LANGU | LCURL | LET | LPAR | NOT |
    364   NUMB | REF | SC | TRAP | VAR |
     380: (CHAR | COL | COL_CURL | COMMA | CUT | 
     381  EQL | ERROR | FAIL | FENCE | ITER | 
     382  LANGU | LCURL | LET | LPAR | NOT | 
     383  NUMB | REF | SC | TRAP | VAR | 
    365384  WITH | WORD)
    366385     #source #path_tail
     
    370389: (SC | WITH)
    371390     /* empty */
    372 | (COMMA | CUT | EQL | ERROR | FAIL |
     391| (COMMA | CUT | EQL | ERROR | FAIL | 
    373392  FENCE | NOT | TRAP)
    374393     rest
     
    384403: (LET)
    385404     LET #hard_exp #o_rest
    386 | (COMMA | CUT | EQL | ERROR | FAIL |
     405| (COMMA | CUT | EQL | ERROR | FAIL | 
    387406  FENCE | NOT | SC | TRAP | WITH)
    388407     #o_rest
     
    392411: (SC | WITH)
    393412     /* empty */
    394 | (COMMA | CUT | EQL | ERROR | FAIL |
     413| (COMMA | CUT | EQL | ERROR | FAIL | 
    395414  FENCE | NOT | TRAP)
    396415     rest
     
    419438: (LCURL)
    420439     alt #source_tail
    421 | (CHAR | COL | COL_CURL | COMMA | CUT |
    422   EQL | ERROR | FAIL | FENCE | ITER |
    423   LANGU | LET | LPAR | NOT | NUMB |
    424   REF | SC | TRAP | VAR | WITH |
     440| (CHAR | COL | COL_CURL | COMMA | CUT | 
     441  EQL | ERROR | FAIL | FENCE | ITER | 
     442  LANGU | LET | LPAR | NOT | NUMB | 
     443  REF | SC | TRAP | VAR | WITH | 
    425444  WORD)
    426445     #result_exp #source_tail
     
    428447
    429448#source_tail
    430 : (COL | COMMA | CUT | EQL | ERROR |
    431   FAIL | FENCE | ITER | LET | NOT |
     449: (COL | COMMA | CUT | EQL | ERROR | 
     450  FAIL | FENCE | ITER | LET | NOT | 
    432451  SC | TRAP | WITH)
    433452     /* empty */
     
    444463: (RCURL)
    445464     /* empty */
    446 | (CHAR | COL | COL_CURL | COMMA | CUT |
    447   EQL | ERROR | FAIL | FENCE | ITER |
    448   LANGU | LCURL | LET | LPAR | NOT |
    449   NUMB | REF | SC | TRAP | VAR |
     465| (CHAR | COL | COL_CURL | COMMA | CUT | 
     466  EQL | ERROR | FAIL | FENCE | ITER | 
     467  LANGU | LCURL | LET | LPAR | NOT | 
     468  NUMB | REF | SC | TRAP | VAR | 
    450469  WORD)
    451470     #path SC #paths
     
    453472
    454473#pattern
    455 : (CHAR | COMMA | CUT | EQL | ERROR |
    456   FAIL | FENCE | LPAR | MATCH_DIR | NOT |
    457   NUMB | REF | SC | TRAP | VAR |
     474: (CHAR | COMMA | CUT | EQL | ERROR | 
     475  FAIL | FENCE | LPAR | MATCH_DIR | NOT | 
     476  NUMB | REF | SC | TRAP | VAR | 
    458477  WITH | WORD)
    459478     #match_direction #pattern_exp
     
    461480
    462481#match_direction
    463 : (CHAR | COMMA | CUT | EQL | ERROR |
    464   FAIL | FENCE | LPAR | NOT | NUMB |
    465   REF | SC | TRAP | VAR | WITH |
     482: (CHAR | COMMA | CUT | EQL | ERROR | 
     483  FAIL | FENCE | LPAR | NOT | NUMB | 
     484  REF | SC | TRAP | VAR | WITH | 
    466485  WORD)
    467486     /* empty */
     
    471490
    472491#pattern_exp
    473 : (COMMA | CUT | EQL | ERROR | FAIL |
    474   FENCE | NOT | RPAR | SC | TRAP |
     492: (COMMA | CUT | EQL | ERROR | FAIL | 
     493  FENCE | NOT | RPAR | SC | TRAP | 
    475494  WITH)
    476495     /* empty */
    477 | (CHAR | LPAR | NUMB | REF | VAR |
     496| (CHAR | LPAR | NUMB | REF | VAR | 
    478497  WORD)
    479498     pattern_exp_head #pattern_exp
     
    492511
    493512#hard_exp
    494 : (CHAR | COMMA | CUT | EQL | ERROR |
    495   FAIL | FENCE | LPAR | NOT | NUMB |
    496   REF | SC | TRAP | VAR | WITH |
     513: (CHAR | COMMA | CUT | EQL | ERROR | 
     514  FAIL | FENCE | LPAR | NOT | NUMB | 
     515  REF | SC | TRAP | VAR | WITH | 
    497516  WORD)
    498517     #pattern_exp
     
    500519
    501520#format_exp
    502 : (CHAR | EQL | LPAR | NUMB | REF |
     521: (CHAR | EQL | LPAR | NUMB | REF | 
    503522  SC | VAR | WORD)
    504523     #pattern_exp
     
    506525
    507526#result_exp
    508 : (COL | COL_CURL | COMMA | CUT | EQL |
    509   ERROR | FAIL | FENCE | ITER | LET |
    510   NOT | RANGU | RPAR | SC | TRAP |
     527: (COL | COL_CURL | COMMA | CUT | EQL | 
     528  ERROR | FAIL | FENCE | ITER | LET | 
     529  NOT | RANGU | RPAR | SC | TRAP | 
    511530  WITH)
    512531     /* empty */
    513 | (CHAR | LANGU | LPAR | NUMB | REF |
     532| (CHAR | LANGU | LPAR | NUMB | REF | 
    514533  VAR | WORD)
    515534     result_exp_head #result_exp
Note: See TracChangeset for help on using the changeset viewer.