type program = Program of (class_decl list) and class_decl = Class of id * id (* class [class_name] extends [superclass_name] {*) * (var_decl list) * (method_decl list) and method_decl = Method of exp_type * id * ((exp_type * id) list) * (var_decl list) * (statement list) * exp and var_decl = Var of var_kind * exp_type * id and var_kind = Static | NonStatic and statement = Block of (statement list) | If of exp * statement * statement | While of exp * statement | Println of exp | Assignment of id * exp | ArrayAssignment of id * exp * exp | Break | Continue | Switch of exp * ((int * (statement list)) list) (* cases *) * (statement list) (* default *) and exp = Operation of exp * binary_operation * exp | Array of exp * exp | Length of exp | MethodCall of exp * id * (exp list) | Integer of int | True | False | Id of id | This | NewArray of exp_type * exp | NewId of id | Not of exp | Null | String of string | Float of float and binary_operation = And | Or | LessThan | Plus | Minus | Multiplication | Division and exp_type = ArrayType of exp_type | BoolType | IntType | ObjectType of id | StringType | FloatType and id = string type symbol_table = ((class_name * method_name * (variable list)) list) and variable = Field of class_name * exp_type * string | Argument of exp_type * string | MethodVar of exp_type * string and class_name = string and method_name = string