driver_ast.ml 2.57 KB
Newer Older
1 2 3
(********************************************************************)
(*                                                                  *)
(*  The Why3 Verification Platform   /   The Why3 Development Team  *)
Guillaume Melquiond's avatar
Guillaume Melquiond committed
4
(*  Copyright 2010-2019   --   Inria - CNRS - Paris-Sud University  *)
5 6 7 8 9 10
(*                                                                  *)
(*  This software is distributed under the terms of the GNU Lesser  *)
(*  General Public License version 2.1, with the special exception  *)
(*  on linking described in file LICENSE.                           *)
(*                                                                  *)
(********************************************************************)
11 12 13

type loc = Loc.position

14
type qualid = loc * string list
15

16 17 18 19 20
type pty =
  | PTyvar of string
  | PTyapp of qualid * pty list
  | PTuple of pty list

21
type metarg =
22
  | PMAty  of pty
23 24
  | PMAfs  of qualid
  | PMAps  of qualid
25 26 27 28
  | PMApr  of qualid
  | PMAstr of string
  | PMAint of int

29
type th_rule =
30
  | Rprelude   of string
31 32 33
  | Rsyntaxts  of qualid * string * bool
  | Rsyntaxfs  of qualid * string * bool
  | Rsyntaxps  of qualid * string * bool
Clément Fumex's avatar
Clément Fumex committed
34
  | Rliteral   of qualid * string * bool
35
  | Rremovepr  of qualid
36
  | Rremoveall
37
  | Rmeta      of string * metarg list
38
  | Ruse       of qualid
39 40

type theory_rules = {
41
  thr_name  : qualid;
42
  thr_rules : (loc * th_rule) list;
43
}
44
                      
45 46
type mo_rule =
  | MRtheory    of th_rule
47
  | MRinterface of string
48
  | MRexception of qualid * string
49
  | MRval       of qualid * string * int list
50 51 52 53 54 55

type module_rules = {
  mor_name  : qualid;
  mor_rules : (loc * mo_rule) list;
}

56 57 58
type global =
  | Prelude of string
  | Printer of string
59
  | ModelParser of string
60 61
  | RegexpValid of string
  | RegexpInvalid of string
62
  | RegexpTimeout of string
63
  | RegexpOutOfMemory of string
64
  | RegexpStepLimitExceeded of string
65 66
  | RegexpUnknown of string * string
  | RegexpFailure of string * string
67
  | TimeRegexp of string
68
  | StepRegexp of string * int
69 70 71
  | ExitCodeValid of int
  | ExitCodeInvalid of int
  | ExitCodeTimeout of int
72
  | ExitCodeStepLimitExceeded of int
73 74
  | ExitCodeUnknown of int * string
  | ExitCodeFailure of int * string
75
  | Filename of string
76
  | Transform of string
77
  | Plugin of (string * string)
78
  | Blacklist of string list
79

80
type file = {
81 82
  f_global : (loc * global) list;
  f_rules  : theory_rules list;
83
}
84

85 86 87 88 89
type global_extract =
  | EPrelude   of string
  | EPrinter   of string
  | EBlacklist of string list

90
type file_extract = {
91
  fe_global   : (loc * global_extract) list;
92 93 94
  fe_th_rules : theory_rules list;
  fe_mo_rules : module_rules list;
}