-- File generated by the BNF Converter. -- Templates for pattern matching on abstract syntax {-# LANGUAGE GADTs #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} module SkelLBNF where import Prelude (($), Either(..), String, (++), Show, show) import qualified AbsLBNF type Err = Either String type Result = Err String failure :: Show a => a -> Result failure x = Left $ "Undefined case: " ++ show x transTree :: AbsLBNF.Tree c -> Result transTree t = case t of AbsLBNF.MkGrammar defs -> failure t AbsLBNF.Coercions x n -> failure t AbsLBNF.Comment str -> failure t AbsLBNF.Comments str1 str2 -> failure t AbsLBNF.Entryp idents -> failure t AbsLBNF.Internal label cat items -> failure t AbsLBNF.Layout strings -> failure t AbsLBNF.LayoutStop strings -> failure t AbsLBNF.LayoutTop -> failure t AbsLBNF.PosToken x reg -> failure t AbsLBNF.Rule label cat items -> failure t AbsLBNF.Rules x rHSs -> failure t AbsLBNF.Separator minimumSize cat str -> failure t AbsLBNF.Terminator minimumSize cat str -> failure t AbsLBNF.Token x reg -> failure t AbsLBNF.NTerminal cat -> failure t AbsLBNF.Terminal str -> failure t AbsLBNF.IdCat x -> failure t AbsLBNF.ListCat cat -> failure t AbsLBNF.LabF labelId1 labelId2 -> failure t AbsLBNF.LabNoP labelId -> failure t AbsLBNF.LabP labelId profItems -> failure t AbsLBNF.LabPF labelId1 labelId2 profItems -> failure t AbsLBNF.Id x -> failure t AbsLBNF.ListCons -> failure t AbsLBNF.ListE -> failure t AbsLBNF.ListOne -> failure t AbsLBNF.Wild -> failure t AbsLBNF.ProfIt intLists integers -> failure t AbsLBNF.Ints integers -> failure t AbsLBNF.MkRHS items -> failure t AbsLBNF.MEmpty -> failure t AbsLBNF.MNonempty -> failure t AbsLBNF.RAlt reg1 reg2 -> failure t AbsLBNF.RAlts str -> failure t AbsLBNF.RAny -> failure t AbsLBNF.RChar c -> failure t AbsLBNF.RDigit -> failure t AbsLBNF.REps -> failure t AbsLBNF.RLetter -> failure t AbsLBNF.RLower -> failure t AbsLBNF.RMinus reg1 reg2 -> failure t AbsLBNF.ROpt reg -> failure t AbsLBNF.RPlus reg -> failure t AbsLBNF.RSeq reg1 reg2 -> failure t AbsLBNF.RSeqs str -> failure t AbsLBNF.RStar reg -> failure t AbsLBNF.RUpper -> failure t transIdent :: AbsLBNF.Ident -> Result transIdent x = case x of AbsLBNF.Ident string -> failure x transGrammar :: AbsLBNF.Grammar -> Result transGrammar x = case x of AbsLBNF.MkGrammar defs -> failure x transDef :: AbsLBNF.Def -> Result transDef x = case x of AbsLBNF.Coercions x n -> failure x AbsLBNF.Comment str -> failure x AbsLBNF.Comments str1 str2 -> failure x AbsLBNF.Entryp idents -> failure x AbsLBNF.Internal label cat items -> failure x AbsLBNF.Layout strings -> failure x AbsLBNF.LayoutStop strings -> failure x AbsLBNF.LayoutTop -> failure x AbsLBNF.PosToken x reg -> failure x AbsLBNF.Rule label cat items -> failure x AbsLBNF.Rules x rHSs -> failure x AbsLBNF.Separator minimumSize cat str -> failure x AbsLBNF.Terminator minimumSize cat str -> failure x AbsLBNF.Token x reg -> failure x transItem :: AbsLBNF.Item -> Result transItem x = case x of AbsLBNF.NTerminal cat -> failure x AbsLBNF.Terminal str -> failure x transCat :: AbsLBNF.Cat -> Result transCat x = case x of AbsLBNF.IdCat x -> failure x AbsLBNF.ListCat cat -> failure x transLabel :: AbsLBNF.Label -> Result transLabel x = case x of AbsLBNF.LabF labelId1 labelId2 -> failure x AbsLBNF.LabNoP labelId -> failure x AbsLBNF.LabP labelId profItems -> failure x AbsLBNF.LabPF labelId1 labelId2 profItems -> failure x transLabelId :: AbsLBNF.LabelId -> Result transLabelId x = case x of AbsLBNF.Id x -> failure x AbsLBNF.ListCons -> failure x AbsLBNF.ListE -> failure x AbsLBNF.ListOne -> failure x AbsLBNF.Wild -> failure x transProfItem :: AbsLBNF.ProfItem -> Result transProfItem x = case x of AbsLBNF.ProfIt intLists integers -> failure x transIntList :: AbsLBNF.IntList -> Result transIntList x = case x of AbsLBNF.Ints integers -> failure x transRHS :: AbsLBNF.RHS -> Result transRHS x = case x of AbsLBNF.MkRHS items -> failure x transMinimumSize :: AbsLBNF.MinimumSize -> Result transMinimumSize x = case x of AbsLBNF.MEmpty -> failure x AbsLBNF.MNonempty -> failure x transReg :: AbsLBNF.Reg -> Result transReg x = case x of AbsLBNF.RAlt reg1 reg2 -> failure x AbsLBNF.RAlts str -> failure x AbsLBNF.RAny -> failure x AbsLBNF.RChar c -> failure x AbsLBNF.RDigit -> failure x AbsLBNF.REps -> failure x AbsLBNF.RLetter -> failure x AbsLBNF.RLower -> failure x AbsLBNF.RMinus reg1 reg2 -> failure x AbsLBNF.ROpt reg -> failure x AbsLBNF.RPlus reg -> failure x AbsLBNF.RSeq reg1 reg2 -> failure x AbsLBNF.RSeqs str -> failure x AbsLBNF.RStar reg -> failure x AbsLBNF.RUpper -> failure x