Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 73 lines (54 sloc) 2.718 kb
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18 (**
19 Some utils related to Pass Tracking for OPA.
20 *)
21
22 (** This module defines some utils for branching compilers working on
23 OpaAst (SurfaceAst) with the pass tracking system developed in
24 passlib, in [PassHandler] and [PassTracker]
25
26 In particular, it defines, given a [SurfaceAst.code] extractor some :
27 + [printers]
28 + [trackers]
29
30 Any language should implement a module named [LangTracker],
31 [LangCheck], etc...
32
33 @see "passlib/passdesign.ml" for a global overview of the Pass
34 System
35 *)
36 (** {6 Printers} *)
37
38 (** Regroup some of common printer of the module [Printer] in one list .
39 The ignored argument is for an optimal branching with PassHandler.
40
41 + code
42
43 TODO: some more flexibility in passhandler options so that we can
44 export in this list douzen of specific printers without risking
45 that they will all be printed with a --print-all.
46 *)
47 val printers_uids : ('env -> (SurfaceAst.uids, [< SurfaceAst.all_directives ]) SurfaceAst.code) -> 'opt -> (PassHandler.printer_id * 'env PassHandler.printer) list
48
49 val printers_nonuid : ('env -> (SurfaceAst.nonuid, [< SurfaceAst.all_directives ]) SurfaceAst.code) -> 'opt -> (PassHandler.printer_id * 'env PassHandler.printer) list
50
51 module Printer :
52 sig
53 (**
54 Regular ast printer:
55 print the full code using the Pretty Printer of the language
56 and insering multiple new lines so that meld can better do
57 the correspondancy between values.
58 *)
59 val code_uids : (SurfaceAst.uids, [< SurfaceAst.all_directives ]) SurfaceAst.code PassHandler.printer
60
61 val code_nonuid : (SurfaceAst.nonuid, [< SurfaceAst.all_directives ]) SurfaceAst.code PassHandler.printer
62
63 val size : ('ident, [< SurfaceAst.all_directives ]) SurfaceAst.code PassHandler.printer
64 end
65
66 (** {6 Trackers} *)
67
68 (** Regroup all the trackers of the module [Tracker] in one list .
69 The ignored argument is for an optimal branching with PassHandler.*)
70 val trackers : ('env -> ('a, 'b) SurfaceAst.code) -> 'opt -> (PassHandler.tracker_id * 'env PassHandler.tracker) list
71
72 module Tracker : sig end
Something went wrong with that request. Please try again.