73505b87da415f7c0a0618eb7fe9e4c782341ce8
[tiger.ml.git] / compiler / src / lib / tiger / tiger_error.mli
1 module Abs = Tiger_absyn
2 module Pos = Tiger_position
3 module Sym = Tiger_symbol
4 module Typ = Tiger_env_type
5
6 type t =
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 }
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}
16 | Id_is_a_function of {id : Sym.t; pos : Pos.t}
17 | Id_not_a_function of {id : Sym.t; pos : Pos.t}
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}
20 | Exp_not_an_array of {ty : Typ.t; pos : Pos.t}
21 | Wrong_type of
22 { expected : Typ.t
23 ; given : Typ.t
24 ; pos : Pos.t
25 }
26 | Wrong_type_of_expression_in_var_dec of
27 { var_id : Sym.t
28 ; expected : Typ.t
29 ; given : Typ.t
30 ; pos : Pos.t
31 }
32 | Wrong_type_used_as_record of
33 { ty_id : Sym.t
34 ; ty : Typ.t
35 ; pos : Pos.t
36 }
37 | Wrong_type_used_as_array of
38 { ty_id : Sym.t
39 ; ty : Typ.t
40 ; pos : Pos.t
41 }
42 | Wrong_type_of_field_value of
43 { field_id : Sym.t
44 ; expected : Typ.t
45 ; given : Typ.t
46 ; pos : Pos.t
47 }
48 | Wrong_type_of_arg of
49 { func : Sym.t
50 ; expected : Typ.t
51 ; given : Typ.t
52 ; pos : Pos.t
53 }
54 | Wrong_number_of_args of
55 { func : Sym.t
56 ; expected : int
57 ; given : int
58 ; pos : Pos.t
59 }
60 | Invalid_operand_type of
61 { oper : Abs.oper
62 ; valid : string list
63 ; given : Typ.t
64 ; pos : Pos.t
65 }
66 | Different_operand_types of
67 { oper : Abs.oper
68 ; left : Typ.t
69 ; right : Typ.t
70 ; pos : Pos.t
71 }
72
73 exception T of t
74
75 val raise : t -> 'a
76
77 val to_string : t -> string
78
79 val is_unknown_id : t -> bool
80 val is_unknown_type : t -> bool
81 val is_wrong_type : t -> bool
82 val is_wrong_number_of_args : t -> bool
83 val is_invalid_syntax : t -> bool
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
87 val is_cycle_in_type_dec : t -> bool
This page took 0.066407 seconds and 3 git commands to generate.