Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 52 lines (41 sloc) 1.748 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 (* CF mli *)
19
20 module BSLDbGen = QmlDbGen.DbGenByPass.BSLDbGenAlphaOpa
21 module DbGen = QmlDbGen.DbGen ( BSLDbGen )
22
23 let process_code gamma annotmap schema code dbinfo alpha_opt =
24 (* previous passes should not generate code with db paths at pre_linking *)
25 if ObjectFiles.compilation_mode() = `init
26 then (gamma, annotmap, alpha_opt, code)
27 else
28 let nodb = QmlDbGen.Schema.is_empty schema in
29
30 let gamma, annotmap, code =
31 if nodb then
32 (gamma, annotmap, code)
33 else begin
34 let annotmap = annotmap in
35
36 (* 3°: expanding database accesses *)
37 let gamma, annotmap, code =
38 let annotmap_opt, code, gamma =
39 DbGen.replace_path_ast
40 schema dbinfo gamma ~annotmap:(Some annotmap) ~valinitial_env:alpha_opt
41 code in
42 let annotmap =
43 Option.default_map annotmap (fun am -> QmlAnnotMap.merge (QmlTypes.process_annotmap ~gamma:gamma am) annotmap) annotmap_opt in
44 gamma, annotmap, code
45 in
46
47 (gamma, annotmap, code)
48 end
49 in
50
51 (gamma, annotmap, alpha_opt, code)
Something went wrong with that request. Please try again.