1 /* Copyright (C) 2000, 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://cs.unibo.it/helm/.
26 /* AUTOR: Ferruccio Guidi <fguidi@cs.unibo.it>
35 module G = MQueryGenerator
38 %token <UriManager.uri> CONURI
39 %token <UriManager.uri> VARURI
40 %token <UriManager.uri * int> INDTYURI
41 %token <UriManager.uri * int * int> INDCONURI
45 %type <CicTextualParser0.interpretation_domain_item -> CicTextualParser0.interpretation_codomain_item option> interp
48 %token DL DQ LC RC CM NOT
49 %token MOBJ MSORT MREL SOBJ SSORT OREL WOBJ WSORT
55 | CONURI { CicTextualParser0.ConUri $1 }
56 | VARURI { CicTextualParser0.VarUri $1 }
57 | INDTYURI { CicTextualParser0.IndTyUri ((fst $1), (snd $1)) }
58 | INDCONURI { CicTextualParser0.IndConUri ((f $1), (s $1), (t $1)) }
61 | ALIAS ID uri { ($2, CicTextualParser0.Uri $3) }
64 | alias aliases { $1 :: $2 }
68 | aliases { function CicTextualParser0.Id s -> (try Some (List.assoc s $1)
69 with Not_found -> None)
75 | STR qstr { $1 ^ $2 }
79 | DL ID { try G.builtin $2 with _ -> "" }
82 | str CM strs { $1 :: $3 }
94 | MOBJ not list list list { G.MustObj ($2, $3, $4, $5) }
95 | MSORT not list list list { G.MustSort ($2, $3, $4, $5) }
96 | MREL not list list { G.MustRel ($2, $3, $4) }
97 | SOBJ not list list list { G.SOnlyObj ($2, $3, $4, $5) }
98 | SSORT not list list list { G.SOnlySort ($2, $3, $4, $5) }
99 | OREL not list list { G.OnlyRel ($2, $3, $4) }
100 | WOBJ not list list list { G.WOnlyObj ($2, $3, $4, $5) }
101 | WSORT not list list list { G.WOnlySort ($2, $3, $4, $5) }
104 | spec specs { $1 :: $2 }