hamlet/LrParser-struct.ss
(module LrParser-struct (planet chongkai/sml)
  (#%module-begin
   (Program:
    (STRDECTopDec:
     (STRUCTUREStrDec:
      (StrBind:
       (StrId: LrParser-struct)
       (SEALStrExp:
        (STRUCTStrExp:
         (SEQStrDec:
          (DECStrDec:
           (VALDec:
            (TyVarseq:)
            (PLAINValBind:
             (ATPat: (IDAtPat: (LongVId: print)))
             (FNExp:
              (Match:
               (Mrule:
                (ATPat: (IDAtPat: (LongVId: s)))
                (ATExp:
                 (PARAtExp:
                  (APPExp:
                   (ATExp: (IDAtExp: (LongVId: output)))
                   (RECORDAtExp: (ExpRow: (Lab: |1|) (ATExp: (IDAtExp: (LongVId: stdOut))) (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: s)))))))))))))))
          (SEQStrDec:
           (DECStrDec:
            (VALDec:
             (TyVarseq:)
             (PLAINValBind:
              (ATPat: (IDAtPat: (LongVId: println)))
              (FNExp:
               (Match:
                (Mrule:
                 (ATPat: (IDAtPat: (LongVId: s)))
                 (ATExp:
                  (SEQAtExp:
                   (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: print))) (IDAtExp: (LongVId: s)))))
                   (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: print))) (SCONAtExp: (STRINGSCon: "\n"))))))))))))))
           (SEQStrDec:
            (STRUCTUREStrDec: (StrBind: (StrId: LrTable-struct) (IDStrExp: (LongStrId: LrTable-struct))))
            (SEQStrDec:
             (STRUCTUREStrDec: (StrBind: (StrId: Stream-struct) (IDStrExp: (LongStrId: Stream-struct))))
             (SEQStrDec:
              (STRUCTUREStrDec:
               (StrBind:
                (StrId: Token-struct)
                (COLONStrExp:
                 (STRUCTStrExp:
                  (SEQStrDec:
                   (STRUCTUREStrDec: (StrBind: (StrId: LrTable-struct) (IDStrExp: (LongStrId: LrTable-struct))))
                   (SEQStrDec:
                    (DECStrDec:
                     (DATATYPEDec:
                      (DatBind:
                       (TyVarseq: (TyVar: |'a|) (TyVar: |'b|))
                       (TyCon: token-type)
                       (ConBind:
                        (VId: TOKEN)
                        (RECORDTy:
                         (TyRow:
                          (Lab: |1|)
                          (CONTy: (Tyseq:) (LongTyCon: LrTable.term-type))
                          (TyRow:
                           (Lab: |2|)
                           (PARTy:
                            (RECORDTy:
                             (TyRow:
                              (Lab: |1|)
                              (VARTy: (TyVar: |'a|))
                              (TyRow: (Lab: |2|) (VARTy: (TyVar: |'b|)) (TyRow: (Lab: |3|) (VARTy: (TyVar: |'b|))))))))))))))
                    (DECStrDec:
                     (VALDec:
                      (TyVarseq:)
                      (PLAINValBind:
                       (ATPat: (IDAtPat: (LongVId: sameToken)))
                       (FNExp:
                        (Match:
                         (Mrule:
                          (ATPat:
                           (RECORDAtPat:
                            (FIELDPatRow:
                             (Lab: |1|)
                             (ATPat:
                              (PARAtPat:
                               (CONPat:
                                (LongVId: TOKEN)
                                (RECORDAtPat:
                                 (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: t))) (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:))))))))
                             (FIELDPatRow:
                              (Lab: |2|)
                              (ATPat:
                               (PARAtPat:
                                (CONPat:
                                 (LongVId: TOKEN)
                                 (RECORDAtPat:
                                  (FIELDPatRow: (Lab: |1|) (ATPat: (IDAtPat: (LongVId: |t'|))) (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:))))))))))))
                          (ATExp:
                           (PARAtExp:
                            (APPExp:
                             (ATExp: (IDAtExp: (LongVId: =)))
                             (RECORDAtExp:
                              (ExpRow: (Lab: |1|) (ATExp: (IDAtExp: (LongVId: t))) (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: |t'|))))))))))))))))))
                 (IDSigExp: (SigId: TOKEN-sig)))))
              (SEQStrDec:
               (DECStrDec: (OPENDec: (LongStrId: LrTable-struct)))
               (SEQStrDec:
                (DECStrDec: (OPENDec: (LongStrId: Token-struct)))
                (SEQStrDec:
                 (DECStrDec: (VALDec: (TyVarseq:) (PLAINValBind: (ATPat: (IDAtPat: (LongVId: DEBUG))) (ATExp: (IDAtExp: (LongVId: false))))))
                 (SEQStrDec:
                  (DECStrDec: (EXCEPTIONDec: (NEWExBind: (VId: ParseError))))
                  (SEQStrDec:
                   (DECStrDec:
                    (TYPEDec:
                     (TypBind:
                      (TyVarseq: (TyVar: |'a|) (TyVar: |'b|))
                      (TyCon: elem-type)
                      (PARTy:
                       (RECORDTy:
                        (TyRow:
                         (Lab: |1|)
                         (CONTy: (Tyseq:) (LongTyCon: state-type))
                         (TyRow:
                          (Lab: |2|)
                          (PARTy:
                           (RECORDTy:
                            (TyRow:
                             (Lab: |1|)
                             (VARTy: (TyVar: |'a|))
                             (TyRow: (Lab: |2|) (VARTy: (TyVar: |'b|)) (TyRow: (Lab: |3|) (VARTy: (TyVar: |'b|))))))))))))))
                   (SEQStrDec:
                    (DECStrDec:
                     (TYPEDec:
                      (TypBind:
                       (TyVarseq: (TyVar: |'a|) (TyVar: |'b|))
                       (TyCon: stack-type)
                       (CONTy: (Tyseq: (CONTy: (Tyseq: (VARTy: (TyVar: |'a|)) (VARTy: (TyVar: |'b|))) (LongTyCon: elem-type))) (LongTyCon: list-type)))))
                    (SEQStrDec:
                     (DECStrDec:
                      (VALDec:
                       (TyVarseq:)
                       (PLAINValBind:
                        (ATPat: (IDAtPat: (LongVId: showState)))
                        (FNExp:
                         (Match:
                          (Mrule:
                           (ATPat: (PARAtPat: (ATPat: (PARAtPat: (CONPat: (LongVId: STATE) (IDAtPat: (LongVId: s)))))))
                           (ATExp:
                            (PARAtExp:
                             (ATExp:
                              (PARAtExp:
                               (APPExp:
                                (ATExp: (IDAtExp: (LongVId: ^)))
                                (RECORDAtExp:
                                 (ExpRow:
                                  (Lab: |1|)
                                  (ATExp: (SCONAtExp: (STRINGSCon: "STATE ")))
                                  (ExpRow:
                                   (Lab: |2|)
                                   (ATExp:
                                    (PARAtExp:
                                     (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: makestring))) (IDAtExp: (LongVId: s)))))))))))))))))))))
                     (SEQStrDec:
                      (DECStrDec:
                       (VALDec:
                        (TyVarseq:)
                        (RECValBind:
                         (PLAINValBind:
                          (ATPat: (IDAtPat: (LongVId: printStack)))
                          (FNExp:
                           (Match:
                            (Mrule:
                             (ATPat:
                              (PARAtPat:
                               (ATPat:
                                (RECORDAtPat:
                                 (FIELDPatRow:
                                  (Lab: |1|)
                                  (COLONPat:
                                   (ATPat: (IDAtPat: (LongVId: stack)))
                                   (CONTy:
                                    (Tyseq: (CONTy: (Tyseq: (VARTy: (TyVar: |'a|)) (VARTy: (TyVar: |'b|))) (LongTyCon: elem-type)))
                                    (LongTyCon: list-type)))
                                  (FIELDPatRow: (Lab: |2|) (COLONPat: (ATPat: (IDAtPat: (LongVId: n))) (CONTy: (Tyseq:) (LongTyCon: int-type)))))))))
                             (APPExp:
                              (ATExp:
                               (PARAtExp:
                                (FNExp:
                                 (Match:
                                  (Mrule:
                                   (ATPat:
                                    (PARAtPat:
                                     (CONPat:
                                      (LongVId: ::)
                                      (RECORDAtPat:
                                       (FIELDPatRow:
                                        (Lab: |1|)
                                        (ATPat:
                                         (RECORDAtPat:
                                          (FIELDPatRow:
                                           (Lab: |1|)
                                           (ATPat: (IDAtPat: (LongVId: state)))
                                           (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:))))))
                                        (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: rest)))))))))
                                   (ATExp:
                                    (SEQAtExp:
                                     (ATExp:
                                      (PARAtExp:
                                       (APPExp:
                                        (ATExp: (IDAtExp: (LongVId: print)))
                                        (PARAtExp:
                                         (ATExp:
                                          (PARAtExp:
                                           (APPExp:
                                            (ATExp: (IDAtExp: (LongVId: ^)))
                                            (RECORDAtExp:
                                             (ExpRow:
                                              (Lab: |1|)
                                              (ATExp:
                                               (PARAtExp:
                                                (APPExp:
                                                 (ATExp: (IDAtExp: (LongVId: ^)))
                                                 (RECORDAtExp:
                                                  (ExpRow:
                                                   (Lab: |1|)
                                                   (ATExp: (SCONAtExp: (STRINGSCon: "          ")))
                                                   (ExpRow:
                                                    (Lab: |2|)
                                                    (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: makestring))) (IDAtExp: (LongVId: n)))))))))))
                                              (ExpRow: (Lab: |2|) (ATExp: (SCONAtExp: (STRINGSCon: ": ")))))))))))))
                                     (SEQAtExp:
                                      (ATExp:
                                       (PARAtExp:
                                        (APPExp:
                                         (ATExp: (IDAtExp: (LongVId: println)))
                                         (PARAtExp: (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: showState))) (IDAtExp: (LongVId: state)))))))))
                                      (PARAtExp:
                                       (ATExp:
                                        (PARAtExp:
                                         (APPExp:
                                          (ATExp: (IDAtExp: (LongVId: printStack)))
                                          (RECORDAtExp:
                                           (ExpRow:
                                            (Lab: |1|)
                                            (ATExp: (IDAtExp: (LongVId: rest)))
                                            (ExpRow:
                                             (Lab: |2|)
                                             (ATExp:
                                              (PARAtExp:
                                               (APPExp:
                                                (ATExp: (IDAtExp: (LongVId: +)))
                                                (RECORDAtExp:
                                                 (ExpRow:
                                                  (Lab: |1|)
                                                  (ATExp: (IDAtExp: (LongVId: n)))
                                                  (ExpRow: (Lab: |2|) (ATExp: (SCONAtExp: (INTSCon: 1))))))))))))))))))))
                                  (Match: (Mrule: (ATPat: (IDAtPat: (LongVId: nil))) (ATExp: (RECORDAtExp:))))))))
                              (PARAtExp: (ATExp: (IDAtExp: (LongVId: stack))))))))))))
                      (DECStrDec:
                       (VALDec:
                        (TyVarseq:)
                        (PLAINValBind:
                         (ATPat: (IDAtPat: (LongVId: parse)))
                         (FNExp:
                          (Match:
                           (Mrule:
                            (ATPat:
                             (RECORDAtPat:
                              (FIELDPatRow:
                               (Lab: arg)
                               (COLONPat: (ATPat: (IDAtPat: (LongVId: arg))) (VARTy: (TyVar: |'a|)))
                               (FIELDPatRow:
                                (Lab: table)
                                (COLONPat: (ATPat: (IDAtPat: (LongVId: table))) (CONTy: (Tyseq:) (LongTyCon: LrTable.table-type)))
                                (FIELDPatRow:
                                 (Lab: lexer)
                                 (COLONPat:
                                  (ATPat: (IDAtPat: (LongVId: lexer)))
                                  (CONTy:
                                   (Tyseq: (CONTy: (Tyseq: (VARTy: (TyVar: |'_b|)) (VARTy: (TyVar: |'_c|))) (LongTyCon: token-type)))
                                   (LongTyCon: Stream.stream-type)))
                                 (FIELDPatRow:
                                  (Lab: saction)
                                  (COLONPat:
                                   (ATPat: (IDAtPat: (LongVId: saction)))
                                   (ARROWTy:
                                    (RECORDTy:
                                     (TyRow:
                                      (Lab: |1|)
                                      (CONTy: (Tyseq:) (LongTyCon: int-type))
                                      (TyRow:
                                       (Lab: |2|)
                                       (VARTy: (TyVar: |'_c|))
                                       (TyRow:
                                        (Lab: |3|)
                                        (CONTy: (Tyseq: (VARTy: (TyVar: |'_b|)) (VARTy: (TyVar: |'_c|))) (LongTyCon: stack-type))
                                        (TyRow: (Lab: |4|) (VARTy: (TyVar: |'a|)))))))
                                    (RECORDTy:
                                     (TyRow:
                                      (Lab: |1|)
                                      (CONTy: (Tyseq:) (LongTyCon: nonterm-type))
                                      (TyRow:
                                       (Lab: |2|)
                                       (PARTy:
                                        (RECORDTy:
                                         (TyRow:
                                          (Lab: |1|)
                                          (VARTy: (TyVar: |'_b|))
                                          (TyRow: (Lab: |2|) (VARTy: (TyVar: |'_c|)) (TyRow: (Lab: |3|) (VARTy: (TyVar: |'_c|)))))))
                                       (TyRow: (Lab: |3|) (CONTy: (Tyseq: (VARTy: (TyVar: |'_b|)) (VARTy: (TyVar: |'_c|))) (LongTyCon: stack-type))))))))
                                  (FIELDPatRow:
                                   (Lab: void)
                                   (COLONPat: (ATPat: (IDAtPat: (LongVId: void))) (VARTy: (TyVar: |'_b|)))
                                   (FIELDPatRow:
                                    (Lab: ec)
                                    (ATPat:
                                     (RECORDAtPat:
                                      (FIELDPatRow:
                                       (Lab: is_keyword)
                                       (ATPat: (IDAtPat: (LongVId: is_keyword)))
                                       (FIELDPatRow:
                                        (Lab: preferred_change)
                                        (ATPat: (IDAtPat: (LongVId: preferred_change)))
                                        (FIELDPatRow:
                                         (Lab: errtermvalue)
                                         (ATPat: (IDAtPat: (LongVId: errtermvalue)))
                                         (FIELDPatRow:
                                          (Lab: showTerminal)
                                          (ATPat: (IDAtPat: (LongVId: showTerminal)))
                                          (FIELDPatRow:
                                           (Lab: error)
                                           (ATPat: (IDAtPat: (LongVId: error)))
                                           (FIELDPatRow:
                                            (Lab: terms)
                                            (ATPat: (IDAtPat: (LongVId: terms)))
                                            (FIELDPatRow: (Lab: noShift) (ATPat: (IDAtPat: (LongVId: noShift))))))))))))
                                    (FIELDPatRow: (Lab: lookahead) (ATPat: (IDAtPat: (LongVId: lookahead))))))))))))
                            (ATExp:
                             (LETAtExp:
                              (SEQDec:
                               (VALDec:
                                (TyVarseq:)
                                (RECValBind:
                                 (PLAINValBind:
                                  (ATPat: (IDAtPat: (LongVId: prAction)))
                                  (FNExp:
                                   (Match:
                                    (Mrule:
                                     (ATPat:
                                      (PARAtPat:
                                       (ATPat:
                                        (RECORDAtPat:
                                         (FIELDPatRow:
                                          (Lab: |1|)
                                          (ASPat:
                                           (VId: stack)
                                           (ATPat:
                                            (PARAtPat:
                                             (CONPat:
                                              (LongVId: ::)
                                              (RECORDAtPat:
                                               (FIELDPatRow:
                                                (Lab: |1|)
                                                (ATPat:
                                                 (RECORDAtPat:
                                                  (FIELDPatRow:
                                                   (Lab: |1|)
                                                   (ATPat: (IDAtPat: (LongVId: state)))
                                                   (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:))))))
                                                (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:)))))))))
                                          (FIELDPatRow:
                                           (Lab: |2|)
                                           (ASPat:
                                            (VId: next)
                                            (ATPat:
                                             (RECORDAtPat:
                                              (FIELDPatRow:
                                               (Lab: |1|)
                                               (ATPat:
                                                (PARAtPat:
                                                 (CONPat:
                                                  (LongVId: TOKEN)
                                                  (RECORDAtPat:
                                                   (FIELDPatRow:
                                                    (Lab: |1|)
                                                    (ATPat: (IDAtPat: (LongVId: term)))
                                                    (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:))))))))
                                               (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:)))))))
                                           (FIELDPatRow: (Lab: |3|) (ATPat: (IDAtPat: (LongVId: action))))))))))
                                     (ATExp:
                                      (SEQAtExp:
                                       (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: println))) (SCONAtExp: (STRINGSCon: "Parse: state stack:")))))
                                       (SEQAtExp:
                                        (ATExp:
                                         (PARAtExp:
                                          (APPExp:
                                           (ATExp: (IDAtExp: (LongVId: printStack)))
                                           (RECORDAtExp:
                                            (ExpRow:
                                             (Lab: |1|)
                                             (ATExp: (IDAtExp: (LongVId: stack)))
                                             (ExpRow: (Lab: |2|) (ATExp: (SCONAtExp: (INTSCon: 0)))))))))
                                        (SEQAtExp:
                                         (ATExp:
                                          (PARAtExp:
                                           (APPExp:
                                            (ATExp: (IDAtExp: (LongVId: print)))
                                            (PARAtExp:
                                             (ATExp:
                                              (PARAtExp:
                                               (APPExp:
                                                (ATExp: (IDAtExp: (LongVId: ^)))
                                                (RECORDAtExp:
                                                 (ExpRow:
                                                  (Lab: |1|)
                                                  (ATExp:
                                                   (PARAtExp:
                                                    (APPExp:
                                                     (ATExp: (IDAtExp: (LongVId: ^)))
                                                     (RECORDAtExp:
                                                      (ExpRow:
                                                       (Lab: |1|)
                                                       (ATExp:
                                                        (PARAtExp:
                                                         (APPExp:
                                                          (ATExp: (IDAtExp: (LongVId: ^)))
                                                          (RECORDAtExp:
                                                           (ExpRow:
                                                            (Lab: |1|)
                                                            (ATExp:
                                                             (PARAtExp:
                                                              (APPExp:
                                                               (ATExp: (IDAtExp: (LongVId: ^)))
                                                               (RECORDAtExp:
                                                                (ExpRow:
                                                                 (Lab: |1|)
                                                                 (ATExp: (SCONAtExp: (STRINGSCon: "       state=")))
                                                                 (ExpRow:
                                                                  (Lab: |2|)
                                                                  (ATExp:
                                                                   (PARAtExp:
                                                                    (APPExp: (ATExp: (IDAtExp: (LongVId: showState))) (IDAtExp: (LongVId: state)))))))))))
                                                            (ExpRow: (Lab: |2|) (ATExp: (SCONAtExp: (STRINGSCon: " next=")))))))))
                                                       (ExpRow:
                                                        (Lab: |2|)
                                                        (ATExp:
                                                         (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: showTerminal))) (IDAtExp: (LongVId: term)))))))))))
                                                  (ExpRow: (Lab: |2|) (ATExp: (SCONAtExp: (STRINGSCon: " action=")))))))))))))
                                         (SEQAtExp:
                                          (APPExp:
                                           (ATExp:
                                            (PARAtExp:
                                             (FNExp:
                                              (Match:
                                               (Mrule:
                                                (ATPat: (PARAtPat: (CONPat: (LongVId: SHIFT) (IDAtPat: (LongVId: s)))))
                                                (ATExp:
                                                 (PARAtExp:
                                                  (APPExp:
                                                   (ATExp: (IDAtExp: (LongVId: println)))
                                                   (PARAtExp:
                                                    (ATExp:
                                                     (PARAtExp:
                                                      (APPExp:
                                                       (ATExp: (IDAtExp: (LongVId: ^)))
                                                       (RECORDAtExp:
                                                        (ExpRow:
                                                         (Lab: |1|)
                                                         (ATExp: (SCONAtExp: (STRINGSCon: "SHIFT ")))
                                                         (ExpRow:
                                                          (Lab: |2|)
                                                          (ATExp:
                                                           (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: showState))) (IDAtExp: (LongVId: s))))))))))))))))
                                               (Match:
                                                (Mrule:
                                                 (ATPat: (PARAtPat: (CONPat: (LongVId: REDUCE) (IDAtPat: (LongVId: i)))))
                                                 (ATExp:
                                                  (PARAtExp:
                                                   (APPExp:
                                                    (ATExp: (IDAtExp: (LongVId: println)))
                                                    (PARAtExp:
                                                     (ATExp:
                                                      (PARAtExp:
                                                       (APPExp:
                                                        (ATExp: (IDAtExp: (LongVId: ^)))
                                                        (RECORDAtExp:
                                                         (ExpRow:
                                                          (Lab: |1|)
                                                          (ATExp: (SCONAtExp: (STRINGSCon: "REDUCE ")))
                                                          (ExpRow:
                                                           (Lab: |2|)
                                                           (ATExp:
                                                            (PARAtExp:
                                                             (ATExp:
                                                              (PARAtExp:
                                                               (APPExp: (ATExp: (IDAtExp: (LongVId: makestring))) (IDAtExp: (LongVId: i))))))))))))))))))
                                                (Match:
                                                 (Mrule:
                                                  (ATPat: (IDAtPat: (LongVId: ERROR)))
                                                  (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: println))) (SCONAtExp: (STRINGSCon: "ERROR"))))))
                                                 (Match:
                                                  (Mrule:
                                                   (ATPat: (IDAtPat: (LongVId: ACCEPT)))
                                                   (ATExp:
                                                    (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: println))) (SCONAtExp: (STRINGSCon: "ACCEPT")))))))))))))
                                           (PARAtExp: (ATExp: (IDAtExp: (LongVId: action)))))
                                          (PARAtExp: (ATExp: (IDAtExp: (LongVId: action))))))))))
                                    (Match:
                                     (Mrule:
                                      (ATPat:
                                       (PARAtPat:
                                        (ATPat:
                                         (RECORDAtPat:
                                          (FIELDPatRow:
                                           (Lab: |1|)
                                           (ATPat: (WILDCARDAtPat:))
                                           (FIELDPatRow:
                                            (Lab: |2|)
                                            (ATPat: (WILDCARDAtPat:))
                                            (FIELDPatRow: (Lab: |3|) (ATPat: (IDAtPat: (LongVId: action))))))))))
                                      (ATExp: (IDAtExp: (LongVId: action))))))))))
                               (SEQDec:
                                (VALDec:
                                 (TyVarseq:)
                                 (PLAINValBind:
                                  (ATPat: (IDAtPat: (LongVId: action)))
                                  (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: LrTable.action))) (IDAtExp: (LongVId: table)))))))
                                (SEQDec:
                                 (VALDec:
                                  (TyVarseq:)
                                  (PLAINValBind:
                                   (ATPat: (IDAtPat: (LongVId: goto)))
                                   (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: LrTable.goto))) (IDAtExp: (LongVId: table)))))))
                                 (SEQDec:
                                  (VALDec:
                                   (TyVarseq:)
                                   (RECValBind:
                                    (PLAINValBind:
                                     (ATPat: (IDAtPat: (LongVId: parseStep)))
                                     (FNExp:
                                      (Match:
                                       (Mrule:
                                        (ATPat:
                                         (PARAtPat:
                                          (ATPat:
                                           (RECORDAtPat:
                                            (FIELDPatRow:
                                             (Lab: |1|)
                                             (ASPat:
                                              (VId: next)
                                              (COLONPat:
                                               (ATPat:
                                                (RECORDAtPat:
                                                 (FIELDPatRow:
                                                  (Lab: |1|)
                                                  (ATPat:
                                                   (PARAtPat:
                                                    (CONPat:
                                                     (LongVId: TOKEN)
                                                     (RECORDAtPat:
                                                      (FIELDPatRow:
                                                       (Lab: |1|)
                                                       (ATPat: (IDAtPat: (LongVId: terminal)))
                                                       (FIELDPatRow:
                                                        (Lab: |2|)
                                                        (ASPat:
                                                         (VId: value)
                                                         (ATPat:
                                                          (RECORDAtPat:
                                                           (FIELDPatRow:
                                                            (Lab: |1|)
                                                            (ATPat: (WILDCARDAtPat:))
                                                            (FIELDPatRow:
                                                             (Lab: |2|)
                                                             (ATPat: (IDAtPat: (LongVId: leftPos)))
                                                             (FIELDPatRow: (Lab: |3|) (ATPat: (WILDCARDAtPat:))))))))))))))
                                                  (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: lexer)))))))
                                               (RECORDTy:
                                                (TyRow:
                                                 (Lab: |1|)
                                                 (CONTy: (Tyseq: (VARTy: (TyVar: |'_b|)) (VARTy: (TyVar: |'_c|))) (LongTyCon: token-type))
                                                 (TyRow:
                                                  (Lab: |2|)
                                                  (CONTy:
                                                   (Tyseq: (CONTy: (Tyseq: (VARTy: (TyVar: |'_b|)) (VARTy: (TyVar: |'_c|))) (LongTyCon: token-type)))
                                                   (LongTyCon: Stream.stream-type)))))))
                                             (FIELDPatRow:
                                              (Lab: |2|)
                                              (ASPat:
                                               (VId: stack)
                                               (COLONPat:
                                                (ATPat:
                                                 (PARAtPat:
                                                  (CONPat:
                                                   (LongVId: ::)
                                                   (RECORDAtPat:
                                                    (FIELDPatRow:
                                                     (Lab: |1|)
                                                     (ATPat:
                                                      (RECORDAtPat:
                                                       (FIELDPatRow:
                                                        (Lab: |1|)
                                                        (ATPat: (IDAtPat: (LongVId: state)))
                                                        (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:))))))
                                                     (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:))))))))
                                                (CONTy: (Tyseq: (VARTy: (TyVar: |'_b|)) (VARTy: (TyVar: |'_c|))) (LongTyCon: stack-type))))))))))
                                        (APPExp:
                                         (ATExp:
                                          (PARAtExp:
                                           (FNExp:
                                            (Match:
                                             (Mrule:
                                              (ATPat: (PARAtPat: (CONPat: (LongVId: SHIFT) (IDAtPat: (LongVId: s)))))
                                              (ATExp:
                                               (PARAtExp:
                                                (APPExp:
                                                 (ATExp: (IDAtExp: (LongVId: parseStep)))
                                                 (RECORDAtExp:
                                                  (ExpRow:
                                                   (Lab: |1|)
                                                   (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: Stream.get))) (IDAtExp: (LongVId: lexer)))))
                                                   (ExpRow:
                                                    (Lab: |2|)
                                                    (ATExp:
                                                     (PARAtExp:
                                                      (APPExp:
                                                       (ATExp: (IDAtExp: (LongVId: ::)))
                                                       (RECORDAtExp:
                                                        (ExpRow:
                                                         (Lab: |1|)
                                                         (ATExp:
                                                          (RECORDAtExp:
                                                           (ExpRow:
                                                            (Lab: |1|)
                                                            (ATExp: (IDAtExp: (LongVId: s)))
                                                            (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: value)))))))
                                                         (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: stack))))))))))))))))
                                             (Match:
                                              (Mrule:
                                               (ATPat: (PARAtPat: (CONPat: (LongVId: REDUCE) (IDAtPat: (LongVId: i)))))
                                               (ATExp:
                                                (LETAtExp:
                                                 (VALDec:
                                                  (TyVarseq:)
                                                  (PLAINValBind:
                                                   (ATPat:
                                                    (RECORDAtPat:
                                                     (FIELDPatRow:
                                                      (Lab: |1|)
                                                      (ATPat: (IDAtPat: (LongVId: nonterm)))
                                                      (FIELDPatRow:
                                                       (Lab: |2|)
                                                       (ATPat: (IDAtPat: (LongVId: value)))
                                                       (FIELDPatRow:
                                                        (Lab: |3|)
                                                        (ASPat:
                                                         (VId: stack)
                                                         (ATPat:
                                                          (PARAtPat:
                                                           (CONPat:
                                                            (LongVId: ::)
                                                            (RECORDAtPat:
                                                             (FIELDPatRow:
                                                              (Lab: |1|)
                                                              (ATPat:
                                                               (RECORDAtPat:
                                                                (FIELDPatRow:
                                                                 (Lab: |1|)
                                                                 (ATPat: (IDAtPat: (LongVId: state)))
                                                                 (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:))))))
                                                              (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:))))))))))))))
                                                   (ATExp:
                                                    (PARAtExp:
                                                     (APPExp:
                                                      (ATExp: (IDAtExp: (LongVId: saction)))
                                                      (RECORDAtExp:
                                                       (ExpRow:
                                                        (Lab: |1|)
                                                        (ATExp: (IDAtExp: (LongVId: i)))
                                                        (ExpRow:
                                                         (Lab: |2|)
                                                         (ATExp: (IDAtExp: (LongVId: leftPos)))
                                                         (ExpRow:
                                                          (Lab: |3|)
                                                          (ATExp: (IDAtExp: (LongVId: stack)))
                                                          (ExpRow: (Lab: |4|) (ATExp: (IDAtExp: (LongVId: arg)))))))))))))
                                                 (ATExp:
                                                  (PARAtExp:
                                                   (APPExp:
                                                    (ATExp: (IDAtExp: (LongVId: parseStep)))
                                                    (RECORDAtExp:
                                                     (ExpRow:
                                                      (Lab: |1|)
                                                      (ATExp: (IDAtExp: (LongVId: next)))
                                                      (ExpRow:
                                                       (Lab: |2|)
                                                       (ATExp:
                                                        (PARAtExp:
                                                         (APPExp:
                                                          (ATExp: (IDAtExp: (LongVId: ::)))
                                                          (RECORDAtExp:
                                                           (ExpRow:
                                                            (Lab: |1|)
                                                            (ATExp:
                                                             (RECORDAtExp:
                                                              (ExpRow:
                                                               (Lab: |1|)
                                                               (ATExp:
                                                                (PARAtExp:
                                                                 (APPExp:
                                                                  (ATExp: (IDAtExp: (LongVId: goto)))
                                                                  (RECORDAtExp:
                                                                   (ExpRow:
                                                                    (Lab: |1|)
                                                                    (ATExp: (IDAtExp: (LongVId: state)))
                                                                    (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: nonterm)))))))))
                                                               (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: value)))))))
                                                            (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: stack))))))))))))))))))
                                              (Match:
                                               (Mrule:
                                                (ATPat: (IDAtPat: (LongVId: ERROR)))
                                                (ATExp:
                                                 (LETAtExp:
                                                  (VALDec:
                                                   (TyVarseq:)
                                                   (PLAINValBind:
                                                    (ATPat:
                                                     (RECORDAtPat:
                                                      (FIELDPatRow:
                                                       (Lab: |1|)
                                                       (ATPat: (WILDCARDAtPat:))
                                                       (FIELDPatRow:
                                                        (Lab: |2|)
                                                        (ATPat: (IDAtPat: (LongVId: leftPos)))
                                                        (FIELDPatRow: (Lab: |3|) (ATPat: (IDAtPat: (LongVId: rightPos))))))))
                                                    (ATExp: (IDAtExp: (LongVId: value)))))
                                                  (ATExp:
                                                   (SEQAtExp:
                                                    (ATExp:
                                                     (PARAtExp:
                                                      (APPExp:
                                                       (ATExp: (IDAtExp: (LongVId: error)))
                                                       (RECORDAtExp:
                                                        (ExpRow:
                                                         (Lab: |1|)
                                                         (ATExp: (SCONAtExp: (STRINGSCon: "syntax error\n")))
                                                         (ExpRow:
                                                          (Lab: |2|)
                                                          (ATExp: (IDAtExp: (LongVId: leftPos)))
                                                          (ExpRow: (Lab: |3|) (ATExp: (IDAtExp: (LongVId: rightPos))))))))))
                                                    (PARAtExp: (RAISEExp: (ATExp: (IDAtExp: (LongVId: ParseError))))))))))
                                               (Match:
                                                (Mrule:
                                                 (ATPat: (IDAtPat: (LongVId: ACCEPT)))
                                                 (ATExp:
                                                  (LETAtExp:
                                                   (SEQDec:
                                                    (VALDec:
                                                     (TyVarseq:)
                                                     (PLAINValBind:
                                                      (ATPat:
                                                       (PARAtPat:
                                                        (CONPat:
                                                         (LongVId: ::)
                                                         (RECORDAtPat:
                                                          (FIELDPatRow:
                                                           (Lab: |1|)
                                                           (ATPat:
                                                            (RECORDAtPat:
                                                             (FIELDPatRow:
                                                              (Lab: |1|)
                                                              (ATPat: (WILDCARDAtPat:))
                                                              (FIELDPatRow:
                                                               (Lab: |2|)
                                                               (ATPat:
                                                                (RECORDAtPat:
                                                                 (FIELDPatRow:
                                                                  (Lab: |1|)
                                                                  (ATPat: (IDAtPat: (LongVId: topvalue)))
                                                                  (FIELDPatRow:
                                                                   (Lab: |2|)
                                                                   (ATPat: (WILDCARDAtPat:))
                                                                   (FIELDPatRow: (Lab: |3|) (ATPat: (WILDCARDAtPat:)))))))))))
                                                           (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:))))))))
                                                      (ATExp: (IDAtExp: (LongVId: stack)))))
                                                    (VALDec:
                                                     (TyVarseq:)
                                                     (PLAINValBind:
                                                      (ATPat:
                                                       (RECORDAtPat:
                                                        (FIELDPatRow:
                                                         (Lab: |1|)
                                                         (ATPat: (IDAtPat: (LongVId: token)))
                                                         (FIELDPatRow: (Lab: |2|) (ATPat: (IDAtPat: (LongVId: restLexer)))))))
                                                      (ATExp: (IDAtExp: (LongVId: next))))))
                                                   (ATExp:
                                                    (RECORDAtExp:
                                                     (ExpRow:
                                                      (Lab: |1|)
                                                      (ATExp: (IDAtExp: (LongVId: topvalue)))
                                                      (ExpRow:
                                                       (Lab: |2|)
                                                       (ATExp:
                                                        (PARAtExp:
                                                         (APPExp:
                                                          (ATExp: (IDAtExp: (LongVId: Stream.cons)))
                                                          (RECORDAtExp:
                                                           (ExpRow:
                                                            (Lab: |1|)
                                                            (ATExp: (IDAtExp: (LongVId: token)))
                                                            (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: lexer)))))))))))))))))))))))
                                         (PARAtExp:
                                          (ATExp:
                                           (PARAtExp:
                                            (IFExp:
                                             (ATExp: (IDAtExp: (LongVId: DEBUG)))
                                             (ATExp:
                                              (PARAtExp:
                                               (APPExp:
                                                (ATExp: (IDAtExp: (LongVId: prAction)))
                                                (RECORDAtExp:
                                                 (ExpRow:
                                                  (Lab: |1|)
                                                  (ATExp: (IDAtExp: (LongVId: stack)))
                                                  (ExpRow:
                                                   (Lab: |2|)
                                                   (ATExp: (IDAtExp: (LongVId: next)))
                                                   (ExpRow:
                                                    (Lab: |3|)
                                                    (ATExp:
                                                     (PARAtExp:
                                                      (APPExp:
                                                       (ATExp: (IDAtExp: (LongVId: action)))
                                                       (RECORDAtExp:
                                                        (ExpRow:
                                                         (Lab: |1|)
                                                         (ATExp: (IDAtExp: (LongVId: state)))
                                                         (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: terminal))))))))))))))))
                                             (ATExp:
                                              (PARAtExp:
                                               (APPExp:
                                                (ATExp: (IDAtExp: (LongVId: action)))
                                                (RECORDAtExp:
                                                 (ExpRow:
                                                  (Lab: |1|)
                                                  (ATExp: (IDAtExp: (LongVId: state)))
                                                  (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: terminal))))))))))))))))))))
                                  (VALDec:
                                   (TyVarseq:)
                                   (PLAINValBind:
                                    (ASPat:
                                     (VId: next)
                                     (ATPat:
                                      (RECORDAtPat:
                                       (FIELDPatRow:
                                        (Lab: |1|)
                                        (ATPat:
                                         (PARAtPat:
                                          (CONPat:
                                           (LongVId: TOKEN)
                                           (RECORDAtPat:
                                            (FIELDPatRow:
                                             (Lab: |1|)
                                             (ATPat: (IDAtPat: (LongVId: terminal)))
                                             (FIELDPatRow:
                                              (Lab: |2|)
                                              (ATPat:
                                               (RECORDAtPat:
                                                (FIELDPatRow:
                                                 (Lab: |1|)
                                                 (ATPat: (WILDCARDAtPat:))
                                                 (FIELDPatRow:
                                                  (Lab: |2|)
                                                  (ATPat: (IDAtPat: (LongVId: leftPos)))
                                                  (FIELDPatRow: (Lab: |3|) (ATPat: (WILDCARDAtPat:)))))))))))))
                                        (FIELDPatRow: (Lab: |2|) (ATPat: (WILDCARDAtPat:)))))))
                                    (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: Stream.get))) (IDAtExp: (LongVId: lexer)))))))))))
                              (ATExp:
                               (PARAtExp:
                                (APPExp:
                                 (ATExp: (IDAtExp: (LongVId: parseStep)))
                                 (RECORDAtExp:
                                  (ExpRow:
                                   (Lab: |1|)
                                   (ATExp: (IDAtExp: (LongVId: next)))
                                   (ExpRow:
                                    (Lab: |2|)
                                    (ATExp:
                                     (PARAtExp:
                                      (APPExp:
                                       (ATExp: (IDAtExp: (LongVId: ::)))
                                       (RECORDAtExp:
                                        (ExpRow:
                                         (Lab: |1|)
                                         (ATExp:
                                          (RECORDAtExp:
                                           (ExpRow:
                                            (Lab: |1|)
                                            (ATExp: (PARAtExp: (APPExp: (ATExp: (IDAtExp: (LongVId: initialState))) (IDAtExp: (LongVId: table)))))
                                            (ExpRow:
                                             (Lab: |2|)
                                             (ATExp:
                                              (RECORDAtExp:
                                               (ExpRow:
                                                (Lab: |1|)
                                                (ATExp: (IDAtExp: (LongVId: void)))
                                                (ExpRow:
                                                 (Lab: |2|)
                                                 (ATExp: (IDAtExp: (LongVId: leftPos)))
                                                 (ExpRow: (Lab: |3|) (ATExp: (IDAtExp: (LongVId: leftPos))))))))))))
                                         (ExpRow: (Lab: |2|) (ATExp: (IDAtExp: (LongVId: nil)))))))))))))))))))))))))))))))))))))
        (IDSigExp: (SigId: LR_PARSER-sig)))))))))