166b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman(*===----------------------------------------------------------------------===
266b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman * Abstract Syntax Tree (aka Parse Tree)
366b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman *===----------------------------------------------------------------------===*)
466b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman
566b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman(* expr - Base type for all expression nodes. *)
666b8ab22586debccb1f787d4d52b7f042d4ddeb8John Baumantype expr =
766b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman  (* variant for numeric literals like "1.0". *)
866b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman  | Number of float
966b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman
1066b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman  (* variant for referencing a variable, like "a". *)
1166b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman  | Variable of string
1266b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman
1366b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman  (* variant for a binary operator. *)
1466b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman  | Binary of char * expr * expr
1566b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman
1666b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman  (* variant for function calls. *)
1766b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman  | Call of string * expr array
1866b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman
1966b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman(* proto - This type represents the "prototype" for a function, which captures
2066b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman * its name, and its argument names (thus implicitly the number of arguments the
2166b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman * function takes). *)
2266b8ab22586debccb1f787d4d52b7f042d4ddeb8John Baumantype proto = Prototype of string * string array
2366b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman
2466b8ab22586debccb1f787d4d52b7f042d4ddeb8John Bauman(* func - This type represents a function definition itself. *)
2566b8ab22586debccb1f787d4d52b7f042d4ddeb8John Baumantype func = Function of proto * expr
26