1 (* Copyright (C) 2004, HELM Team.
3 * This file is part of HELM, an Hypertextual, Electronic
4 * Library of Mathematics, developed at the Computer Science
5 * Department, University of Bologna, Italy.
7 * HELM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * HELM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with HELM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 * For details, see the HELM World-Wide-Web page,
23 * http://helm.cs.unibo.it/
26 exception NoWellTypedInterpretation
28 module AndreaAndZackDisambiguatingParser =
30 module EnvironmentP3 = CicTextualParser2.EnvironmentP3
32 module Make (C : DisambiguateTypes.Callbacks) =
34 let disambiguate_term ~(dbd:Mysql.dbd) context metasenv term_as_string
37 let module Disambiguate' = Disambiguate.Make (C) in
39 CicTextualParser2.parse_term (Stream.of_string term_as_string)
41 Disambiguate'.disambiguate_term ~dbd context metasenv term ~aliases
47 module CSCTextualDisambiguatingParser =
49 module EnvironmentP3 = OldDisambiguate.EnvironmentP3
51 module Make (C : DisambiguateTypes.Callbacks) =
54 disambiguate_term mqi_handle context metasenv term_as_string environment
56 let module Disambiguate' = OldDisambiguate.Make (C) in
64 let lexbuf = Lexing.from_string term_as_string in
65 let dom,mk_metasenv_and_expr =
66 CicTextualParserContext.main
67 ~context:name_context ~metasenv CicTextualLexer.token lexbuf
69 Disambiguate'.disambiguate_input mqi_handle
70 context metasenv dom mk_metasenv_and_expr environment
74 module CSCTexDisambiguatingParser =
76 module EnvironmentP3 = OldDisambiguate.EnvironmentP3
78 module Make (C : DisambiguateTypes.Callbacks) =
81 disambiguate_term mqi_handle context metasenv term_as_string environment
83 let module Disambiguate' = OldDisambiguate.Make (C) in
91 let lexbuf = Lexing.from_string term_as_string in
92 let dom,mk_metasenv_and_expr =
93 TexCicTextualParserContext.main
94 ~context:name_context ~metasenv TexCicTextualLexer.token lexbuf
96 Disambiguate'.disambiguate_input mqi_handle
97 context metasenv dom mk_metasenv_and_expr environment