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 = |
e6e82c08 SK |
7 | | Cycle_in_type_decs of |
8 | { from_id : Sym.t | |
9 | ; from_pos : Pos.t | |
10 | ; to_id : Sym.t | |
11 | ; to_pos : Pos.t | |
12 | } | |
b9b456cc SK |
13 | | Invalid_syntax of Pos.t |
14 | | Unknown_id of {id : Sym.t; pos : Pos.t} | |
15 | | Unknown_type of {ty_id : Sym.t; pos : Pos.t} | |
523e2b06 | 16 | | Id_is_a_function of {id : Sym.t; pos : Pos.t} |
b9b456cc | 17 | | Id_not_a_function of {id : Sym.t; pos : Pos.t} |
523e2b06 SK |
18 | | No_such_field_in_record of {field : Sym.t; record : Typ.t; pos : Pos.t} |
19 | | Exp_not_a_record of {ty : Typ.t; pos : Pos.t} | |
161a300d | 20 | | Exp_not_an_array of {ty : Typ.t; pos : Pos.t} |
523e2b06 SK |
21 | | Wrong_type of |
22 | { expected : Typ.t | |
23 | ; given : Typ.t | |
24 | ; pos : Pos.t | |
25 | } | |
c16dd441 | 26 | | Wrong_type_of_expression_in_var_dec of |
b9b456cc SK |
27 | { var_id : Sym.t |
28 | ; expected : Typ.t | |
29 | ; given : Typ.t | |
30 | ; pos : Pos.t | |
c16dd441 SK |
31 | } |
32 | | Wrong_type_used_as_record of | |
b9b456cc SK |
33 | { ty_id : Sym.t |
34 | ; ty : Typ.t | |
35 | ; pos : Pos.t | |
c16dd441 | 36 | } |
4c550cd5 SK |
37 | | Wrong_type_used_as_array of |
38 | { ty_id : Sym.t | |
39 | ; ty : Typ.t | |
40 | ; pos : Pos.t | |
41 | } | |
c16dd441 | 42 | | Wrong_type_of_field_value of |
b9b456cc SK |
43 | { field_id : Sym.t |
44 | ; expected : Typ.t | |
45 | ; given : Typ.t | |
46 | ; pos : Pos.t | |
c16dd441 SK |
47 | } |
48 | | Wrong_type_of_arg of | |
b9b456cc SK |
49 | { func : Sym.t |
50 | ; expected : Typ.t | |
51 | ; given : Typ.t | |
52 | ; pos : Pos.t | |
c16dd441 SK |
53 | } |
54 | | Wrong_number_of_args of | |
b9b456cc | 55 | { func : Sym.t |
c16dd441 SK |
56 | ; expected : int |
57 | ; given : int | |
b9b456cc | 58 | ; pos : Pos.t |
c16dd441 SK |
59 | } |
60 | | Invalid_operand_type of | |
b9b456cc | 61 | { oper : Abs.oper |
c16dd441 | 62 | ; valid : string list |
b9b456cc SK |
63 | ; given : Typ.t |
64 | ; pos : Pos.t | |
c16dd441 SK |
65 | } |
66 | | Different_operand_types of | |
b9b456cc SK |
67 | { oper : Abs.oper |
68 | ; left : Typ.t | |
69 | ; right : Typ.t | |
70 | ; pos : Pos.t | |
c16dd441 | 71 | } |
7c14a966 | 72 | |
c16dd441 SK |
73 | exception T of t |
74 | ||
75 | val raise : t -> 'a | |
76 | ||
77 | val to_string : t -> string | |
5da420a8 | 78 | |
155073e2 SK |
79 | val is_unknown_id : t -> bool |
80 | val is_unknown_type : t -> bool | |
81 | val is_wrong_type : t -> bool | |
54e838f4 | 82 | val is_wrong_number_of_args : t -> bool |
789ef466 | 83 | val is_invalid_syntax : t -> bool |
1d155dc1 SK |
84 | val is_not_a_record : t -> bool |
85 | val is_not_an_array : t -> bool | |
86 | val is_no_such_field_in_record : t -> bool | |
e6e82c08 | 87 | val is_cycle_in_type_dec : t -> bool |