-- File generated by the BNF Converter. -- Templates for pattern matching on abstract syntax {-# OPTIONS_GHC -fno-warn-unused-matches #-} module SkelCalc where import Prelude (($), Either(..), String, (++), Show, show) import qualified AbsCalc type Err = Either String type Result = Err String failure :: Show a => a -> Result failure x = Left $ "Undefined case: " ++ show x transExp :: Show a => AbsCalc.Exp' a -> Result transExp x = case x of AbsCalc.EAdd _ exp1 exp2 -> failure x AbsCalc.EDiv _ exp1 exp2 -> failure x AbsCalc.EInt _ n -> failure x AbsCalc.EMul _ exp1 exp2 -> failure x AbsCalc.ESub _ exp1 exp2 -> failure x