Module Syntaxtree


module Syntaxtree: sig .. end


type ide =
| Ide of string

type aexp =
| N of int
| R of float
| Var of ide
| Vec of ide * aexp
| Mat of ide * aexp * aexp
| Sum of aexp * aexp
| Sub of aexp * aexp
| Mul of aexp * aexp
| Div of aexp * aexp
| FCall of ide * aexp list

type bexp =
| B of bool
| Equ of aexp * aexp
| LE of aexp * aexp
| LT of aexp * aexp
| Not of bexp
| And of bexp * bexp
| Or of bexp * bexp

type lexp =
| LVar of ide
| LVec of ide * aexp
| LMat of ide * aexp * aexp

type cmd =
| Ass of lexp * aexp
| Blk of cmd list
| Ite of bexp * cmd * cmd
| While of bexp * cmd
| Repeat of cmd * bexp
| For of ide * aexp * aexp * cmd
| Write of aexp
| PCall of ide * aexp list

type bType =
| Int
| Float

type gType =
| Basic of bType
| Vector of int * bType
| Matrix of int * int * bType

type dec =
| Dec of ide * gType

type param =
| Par of ide * bType

type ret =
| Ret of bType

type proc =
| Proc of ide * param list * dec list * cmd
| Func of ide * param list * ret * dec list
* cmd

type program =
| Program of dec list * proc list * cmd
| SynError