Commit | Line | Data |
---|---|---|
b9b456cc SK |
1 | module Abs = Tiger_absyn |
2 | module Pos = Tiger_position | |
3 | module Sym = Tiger_symbol | |
4 | module Typ = Tiger_env_type | |
5 | ||
c16dd441 | 6 | type t = |
b9b456cc SK |
7 | | Invalid_syntax of Pos.t |
8 | | Unknown_id of {id : Sym.t; pos : Pos.t} | |
9 | | Unknown_type of {ty_id : Sym.t; pos : Pos.t} | |
523e2b06 | 10 | | Id_is_a_function of {id : Sym.t; pos : Pos.t} |
b9b456cc | 11 | | Id_not_a_function of {id : Sym.t; pos : Pos.t} |
523e2b06 SK |
12 | | No_such_field_in_record of {field : Sym.t; record : Typ.t; pos : Pos.t} |
13 | | Exp_not_a_record of {ty : Typ.t; pos : Pos.t} | |
161a300d | 14 | | Exp_not_an_array of {ty : Typ.t; pos : Pos.t} |
523e2b06 SK |
15 | | Wrong_type of |
16 | { expected : Typ.t | |
17 | ; given : Typ.t | |
18 | ; pos : Pos.t | |
19 | } | |
c16dd441 | 20 | | Wrong_type_of_expression_in_var_dec of |
b9b456cc SK |
21 | { var_id : Sym.t |
22 | ; expected : Typ.t | |
23 | ; given : Typ.t | |
24 | ; pos : Pos.t | |
c16dd441 SK |
25 | } |
26 | | Wrong_type_used_as_record of | |
b9b456cc SK |
27 | { ty_id : Sym.t |
28 | ; ty : Typ.t | |
29 | ; pos : Pos.t | |
c16dd441 | 30 | } |
4c550cd5 SK |
31 | | Wrong_type_used_as_array of |
32 | { ty_id : Sym.t | |
33 | ; ty : Typ.t | |
34 | ; pos : Pos.t | |
35 | } | |
c16dd441 | 36 | | Wrong_type_of_field_value of |
b9b456cc SK |
37 | { field_id : Sym.t |
38 | ; expected : Typ.t | |
39 | ; given : Typ.t | |
40 | ; pos : Pos.t | |
c16dd441 SK |
41 | } |
42 | | Wrong_type_of_arg of | |
b9b456cc SK |
43 | { func : Sym.t |
44 | ; expected : Typ.t | |
45 | ; given : Typ.t | |
46 | ; pos : Pos.t | |
c16dd441 SK |
47 | } |
48 | | Wrong_number_of_args of | |
b9b456cc | 49 | { func : Sym.t |
c16dd441 SK |
50 | ; expected : int |
51 | ; given : int | |
b9b456cc | 52 | ; pos : Pos.t |
c16dd441 SK |
53 | } |
54 | | Invalid_operand_type of | |
b9b456cc | 55 | { oper : Abs.oper |
c16dd441 | 56 | ; valid : string list |
b9b456cc SK |
57 | ; given : Typ.t |
58 | ; pos : Pos.t | |
c16dd441 SK |
59 | } |
60 | | Different_operand_types of | |
b9b456cc SK |
61 | { oper : Abs.oper |
62 | ; left : Typ.t | |
63 | ; right : Typ.t | |
64 | ; pos : Pos.t | |
c16dd441 | 65 | } |
7c14a966 | 66 | |
c16dd441 SK |
67 | exception T of t |
68 | ||
69 | val raise : t -> 'a | |
70 | ||
71 | val to_string : t -> string | |
5da420a8 | 72 | |
155073e2 SK |
73 | val is_unknown_id : t -> bool |
74 | val is_unknown_type : t -> bool | |
75 | val is_wrong_type : t -> bool |