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/.
31 let _ = Parsing.set_trace !G.debug_parser
34 %token <string> ID STR
35 %token OP CP OB CB OA CA OC CC FS CN CM EQ STAR HASH TE CT
36 %token GRAPH MAIN DECL AX CONG DEF TH GEN REQ OPEN CLOSE SORTS EOF
39 %type <Txt.command option> entry
60 | ID CM ids { $1 :: $3 }
64 | IX ID { Some $1, $2 }
68 | sort CM sorts { $1 :: $3 }
72 | CT IX { N.finite $2 }
76 | OB ID CN term CB layer { T.Abst ($6, $2, true, $4) }
77 | OB term CB layer { T.Abst ($4, "", false, $2) }
78 | OB ID TE term CB layer { T.Abst ($6, $2, false, $4) }
79 | OB ID EQ term CB { T.Abbr ($2, $4) }
82 | binder fs binder { [$1; $3] }
83 | binder fs binders { $1 :: $3 }
87 | OC binders CC { $2 }
91 | STAR IX { T.Sort $2 }
92 | STAR ID { T.NSrt $2 }
93 | hash IX { T.LRef $2 }
95 | HASH ID { T.NRef $2 }
96 | atom OP terms CP { T.Inst ($1, $3) }
100 | OA term CA fs term { T.Cast ($2, $5) }
101 | OP term CP fs term { T.Appl ($2, $5) }
102 | lenv fs term { T.Proj ($1, $3) }
107 | term CM terms { $1 :: $3 }
122 | main decl comment ID CN term
123 { T.Constant ($1, $2, $4, $3, $6) }
124 | main def comment ID EQ term
125 { T.Constant ($1, $2, $4, $3, $6) }
126 | main def comment ID EQ term CN term
127 { T.Constant ($1, $2, $4, $3, T.Cast ($8, $6)) }
133 { T.Section (Some $2) }
141 | GRAPH {} | decl {} | def {} | GEN {} |
142 | REQ {} | OPEN {} | CLOSE {} | SORTS {} | EOF {}
145 | command start { Some $1 }