]> ruin.nu Git - proglang.git/blob - Abssyntax.hs
initial commit of interpreter
[proglang.git] / Abssyntax.hs
1 module Abssyntax where
2
3 -- Haskell module generated by the BNF converter
4
5 newtype Ident = Ident String deriving (Eq,Ord,Show)
6
7 data Stm =
8    SDecl Type Ident Exp
9  | SExp Exp
10  | SBlock [Stm]
11  | SIf Exp Stm Stm
12  | SWhile Exp Stm
13  | SPrint Exp
14  | SNoop
15   deriving (Eq,Ord,Show)
16
17 data Exp =
18    EAss Ident Exp
19  | EVar Ident
20  | EInt Integer
21  | ENeg Exp
22  | ENot Exp
23  | EBool Bool
24  | EReadI
25  | EReadB
26  | ExpT Type Exp
27  | EDefault
28  | BiOpExp Exp Op Exp
29  | EPost Ident Op
30   deriving (Eq,Ord,Show)
31
32 data Stms =
33    Program [Stm]
34   deriving (Eq,Ord,Show)
35
36 data Op =
37    Lt
38  | ELt
39  | Gt
40  | EGt
41  | Eq
42  | NEq
43  | Plus
44  | Minus
45  | Times
46  | Div
47   deriving (Eq,Ord,Show)
48
49 data Type =
50    TInt
51  | TBool
52  | NoType
53   deriving (Eq,Ord,Show)
54