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
35 ?initial_ugraph ~aliases 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
42 ?initial_ugraph ~aliases term
48 module CSCTextualDisambiguatingParser =
50 module EnvironmentP3 = OldDisambiguate.EnvironmentP3
52 module Make (C : DisambiguateTypes.Callbacks) =
55 disambiguate_term mqi_handle context metasenv term_as_string environment
57 let module Disambiguate' = OldDisambiguate.Make (C) in
65 let lexbuf = Lexing.from_string term_as_string in
66 let dom,mk_metasenv_and_expr =
67 CicTextualParserContext.main
68 ~context:name_context ~metasenv CicTextualLexer.token lexbuf
70 Disambiguate'.disambiguate_input mqi_handle
71 context metasenv dom mk_metasenv_and_expr environment
75 module CSCTexDisambiguatingParser =
77 module EnvironmentP3 = OldDisambiguate.EnvironmentP3
79 module Make (C : DisambiguateTypes.Callbacks) =
82 disambiguate_term mqi_handle context metasenv term_as_string environment
84 let module Disambiguate' = OldDisambiguate.Make (C) in
92 let lexbuf = Lexing.from_string term_as_string in
93 let dom,mk_metasenv_and_expr =
94 TexCicTextualParserContext.main
95 ~context:name_context ~metasenv TexCicTextualLexer.token lexbuf
97 Disambiguate'.disambiguate_input mqi_handle
98 context metasenv dom mk_metasenv_and_expr environment