1 (* Copyright (C) 2005, 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/
32 inherit Interpretations.g_status
33 inherit TermContentPres.g_status
34 inherit CicNotationParser.g_status
39 inherit Interpretations.status
40 inherit TermContentPres.status
41 inherit CicNotationParser.status
42 method set_notation_status
43 : 'status. #g_status as 'status -> 'self
44 = fun o -> ((self#set_interp_status o)#set_content_pres_status o)#set_notation_parser_status o
47 let process_notation status st =
49 | Notation (loc, dir, l1, associativity, precedence, l2) ->
51 CicNotationParser.check_l1_pattern
52 l1 (dir = Some `RightToLeft) precedence associativity
55 if dir <> Some `RightToLeft then
56 CicNotationParser.extend status l1
58 NotationPt.AttributedTerm
59 (`Loc loc,TermContentPres.instantiate_level2 env l2))
63 if dir <> Some `LeftToRight then
64 let status = TermContentPres.add_pretty_printer status l2 l1 in
70 | Interpretation (loc, dsc, l2, l3) ->
71 Interpretations.add_interpretation status dsc l2 l3