driver_ast.ml 2.34 KB
Newer Older
1 2 3
(********************************************************************)
(*                                                                  *)
(*  The Why3 Verification Platform   /   The Why3 Development Team  *)
4
(*  Copyright 2010-2013   --   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 30
type th_rule =
  | Rprelude  of string
31 32 33 34 35
  | Rsyntaxts of qualid * string
  | Rsyntaxfs of qualid * string
  | Rsyntaxps of qualid * string
  | Rremovepr of qualid
  | Rmeta     of string * metarg list
36 37

type theory_rules = {
38
  thr_name  : qualid;
39
  thr_rules : (loc * th_rule) list;
40 41
}

42 43
type mo_rule =
  | MRtheory    of th_rule
44 45
  | MRexception of qualid * string
  | MRval       of qualid * string
46
  | MRconverter of qualid * string
47 48 49 50 51 52

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

53 54 55 56 57
type global =
  | Prelude of string
  | Printer of string
  | RegexpValid of string
  | RegexpInvalid of string
58
  | RegexpTimeout of string
59
  | RegexpOutOfMemory of string
60 61
  | RegexpUnknown of string * string
  | RegexpFailure of string * string
62
  | TimeRegexp of string
63 64 65
  | ExitCodeValid of int
  | ExitCodeInvalid of int
  | ExitCodeTimeout of int
66
  | ExitCodeOutOfMemory of int
67 68
  | ExitCodeUnknown of int * string
  | ExitCodeFailure of int * string
69
  | Filename of string
70
  | Transform of string
71
  | Plugin of (string * string)
72
  | Blacklist of string list
73

74
type file = {
75 76
  f_global : (loc * global) list;
  f_rules  : theory_rules list;
77
}
78

79 80 81 82 83
type global_extract =
  | EPrelude   of string
  | EPrinter   of string
  | EBlacklist of string list

84
type file_extract = {
85
  fe_global   : (loc * global_extract) list;
86 87 88
  fe_th_rules : theory_rules list;
  fe_mo_rules : module_rules list;
}