⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rllparser.txt

📁 这是我们老师给我们的例子
💻 TXT
📖 第 1 页 / 共 2 页
字号:
                                  BoolOp   -><=
        <=
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->num
       num
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
         )
      then
                                    Stmt   ->AssigStmt
                               AssigStmt   ->id = ArithExpr ;
        id
         =
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->- MulExpr ArithExprPrime
         -
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
         ;
      else
                                    Stmt   ->AssigStmt
                               AssigStmt   ->id = ArithExpr ;
        id
         =
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->+ MulExpr ArithExprPrime
         +
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->/ SimpleExpr MulExprPrime
         /
                              SimpleExpr   ->num
       num
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
         ;
                                   Stmts   ->Stmt Stmts
                                    Stmt   ->IfStmt
                                  IfStmt   ->if ( BoolExpr ) then Stmt else Stmt
        if
         (
                                BoolExpr   ->ArithExpr BoolOp ArithExpr
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
                                  BoolOp   ->==
        ==
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
         )
      then
                                    Stmt   ->AssigStmt
                               AssigStmt   ->id = ArithExpr ;
        id
         =
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->- MulExpr ArithExprPrime
         -
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
         ;
      else
                                    Stmt   ->AssigStmt
                               AssigStmt   ->id = ArithExpr ;
        id
         =
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->- MulExpr ArithExprPrime
         -
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->/ SimpleExpr MulExprPrime
         /
                              SimpleExpr   ->num
       num
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
         ;
                                   Stmts   ->Stmt Stmts
                                    Stmt   ->IfStmt
                                  IfStmt   ->if ( BoolExpr ) then Stmt else Stmt
        if
         (
                                BoolExpr   ->ArithExpr BoolOp ArithExpr
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
                                  BoolOp   ->>
         >
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->num
       num
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
         )
      then
                                    Stmt   ->AssigStmt
                               AssigStmt   ->id = ArithExpr ;
        id
         =
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->- MulExpr ArithExprPrime
         -
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->num
       num
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
         ;
      else
                                    Stmt   ->AssigStmt
                               AssigStmt   ->id = ArithExpr ;
        id
         =
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->+ MulExpr ArithExprPrime
         +
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->num
       num
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
         ;
                                   Stmts   ->Stmt Stmts
                                    Stmt   ->IfStmt
                                  IfStmt   ->if ( BoolExpr ) then Stmt else Stmt
        if
         (
                                BoolExpr   ->ArithExpr BoolOp ArithExpr
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
                                  BoolOp   -><
         <
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->num
       num
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
         )
      then
                                    Stmt   ->AssigStmt
                               AssigStmt   ->id = ArithExpr ;
        id
         =
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->+ MulExpr ArithExprPrime
         +
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->num
       num
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
         ;
      else
                                    Stmt   ->AssigStmt
                               AssigStmt   ->id = ArithExpr ;
        id
         =
                               ArithExpr   ->MulExpr ArithExprPrime
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->id
        id
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->- MulExpr ArithExprPrime
         -
                                 MulExpr   ->SimpleExpr MulExprPrime
                              SimpleExpr   ->num
       num
                            MulExprPrime   ->ε
                                      ε
                          ArithExprPrime   ->ε
                                      ε
         ;
                                   Stmts   ->ε
                                      ε
         }
         $
                           Parsing ended

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -