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 /******************************************************************************/
30 /* Ferruccio Guidi <fguidi@cs.unibo.it> */
34 /******************************************************************************/
38 %token <string> ID STR
39 %token LC RC CM SC LP RP AT PC DL FS DQ EOF
40 %token AND ATTR ATTRIB DIFF EQ FALSE FUN IN INTER NOT OR PAT REF REFOF
41 %token REL SELECT SUB SUPER TRUE UNION WHERE
48 %type <MathQL.resource_set> query
52 | STR qstr { $1 @ $2 }
64 | MCONCL { MQMConclusion }
65 | CONCL { MQConclusion }
67 | rvar { MQStringRVar $1 }
68 | svar { MQStringSVar $1 }
69 | func rvar { MQFunc ($1, $2) }
74 | str IS str { MQIs ($1, $3) }
75 | NOT boole { MQNot $2 }
76 | boole AND boole { MQAnd ($1, $3) }
77 | boole OR boole { MQOr ($1, $3) }
78 | LPR boole RPR { $2 }
81 | PATT REF { MQPattern $2 }
82 | rlist UNION rlist { MQUnion ($1, $3) }
83 | rlist INTER rlist { MQIntersect ($1, $3) }
84 | USE rlist POS svar { MQUse ($2, $4) }
85 | USEDBY rlist POS svar { MQUsedBy ($2, $4) }
86 | SELECT rvar IN rlist WHERE boole { MQSelect ($2, $4, $6) }
87 | LPR rlist RPR { $2 }
90 rlist EOF { MQList $1 }