-- File generated by the BNF Converter. -- Templates for pattern matching on abstract syntax {-# LANGUAGE GADTs #-} {-# 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 transTree :: AbsCalc.Tree c -> Result transTree t = case t of AbsCalc.EAdd exp1 exp2 -> failure t AbsCalc.EDiv exp1 exp2 -> failure t AbsCalc.EInt n -> failure t AbsCalc.EMul exp1 exp2 -> failure t AbsCalc.ESub exp1 exp2 -> failure t transExp :: AbsCalc.Exp -> 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