000001| (** Basic AST for Lua *)
000002|
000003| type unop =
000004| | Not
000005| | Length
000006| | Uminus
000007|
000008| type binop =
000009| | Eq | Lt | Gt | Ne | Le | Ge
000010| | Plus | Minus | Times | Div | Mod | Pow
000011| | Concat
000012|
000013| type str =
000014| | Normal of string
000015| | Char of string
000016| | Long of string
000017|
000018| type number =
000019| | Int of int
000020| | Hex of int
000021| | Float of float
000022|
000023| type lit =
000024| | Nil
000025| | Bool of bool
000026| | String of str
000027| | Number of number
000028| | Table of exp list * (string * exp) list
000029| | Fun of string list * block (*fixme: pos*)
000030|
000031| and lvalue =
000032| | Name of string
000033| | Index of exp * string
000034| | DynIndex of exp * exp
000035|
000036| and exp =
000037| | Lit of lit
000038| | Lvalue of lvalue
000039| | Unop of unop * exp
000040| | Binop of exp * binop * exp
000041| | And of exp * exp
000042| | Or of exp * exp
000043| | Call of exp * exp list
000044| | Methcall of exp * string * exp list
000045| | Paren of exp
000046|
000047| and stmt = { stmt_pos : Lexing.position;
000048| stmt : stmt_desc }
000049| and stmt_desc =
000050| | Break
000051| | If of exp * block * block
000052| | WhileDo of exp * block
000053| (*| For of string * exp * exp * block*)
000054| | Doend of block
000055| | Assign of lvalue list * exp list
000056| | Local of string list * exp list
000057| | Callstmt of exp * exp list
000058| | Methcallstmt of exp * string * exp list
000059| | Return of exp list
000060|
000061| and block = stmt list