Coding in haskell, parser, interpreter, scanner and type checker

computer science

Description

Coding in haskell, parser, interpreter, scanner and type checker

module JavaishParser where

import JavaishScanner

data Operator = Plus | Minus | Times | Divide | OGt | OLt | OEq | ONe
  deriving ( Eq, Show )

data Type =
    TInt
  | TBool
  deriving ( Show, Eq )

data Expression =
    ExpInt Integer
  | ExpBool Bool
  | ExpBin Expression Operator Expression
  | ExpBang Expression
  deriving Show

parseC :: [ TokenPos ] -> ( Expression, [ TokenPos, Integer ] )
parseC tokens = uncurry parseC2 $ parseE tokens


Related Questions in computer science category