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 %token EOF MINUS PLUS TIMES AT FS CN CM SC QT TD OP CP OB CB OA CA
32 %token TYPE PROP DEF EB E PN EXIT
37 path: MINUS {} | FS {} ;
38 oftype: CN {} | CM {} ;
39 star: TIMES {} | AT {} ;
40 sc: E {} | SC {} | CN {} ;
54 | IDENT path idents { $1 :: $3 }
57 | IDENT { ($1, true, []) }
58 | IDENT QT QT { ($1, true, []) }
59 | IDENT QT local idents QT { ($1, $3, $4) }
62 | TYPE { A.Sort true }
63 | PROP { A.Sort false }
64 | qid { A.GRef ($1, []) }
65 | qid OP CP { A.GRef ($1, []) }
66 | qid OP terms CP { A.GRef ($1, $3) }
67 | OA term CA term { A.Appl ($2, $4) }
68 | OB IDENT oftype term CB term { A.Abst ($2, $4, $6) }
72 | term CM terms { $1 :: $3 }
75 | PLUS IDENT { A.Section (Some $2) }
76 | PLUS TIMES IDENT { A.Section (Some $3) }
77 | MINUS IDENT { A.Section None }
78 | EXIT { A.Section None }
79 | star { A.Context None }
80 | qid star { A.Context (Some $1) }
81 | IDENT DEF EB sc term { A.Block ($1, $5) }
82 | IDENT sc term DEF EB { A.Block ($1, $3) }
83 | OB IDENT oftype term CB { A.Block ($2, $4) }
84 | IDENT DEF PN sc term { A.Decl ($1, $5) }
85 | IDENT sc term DEF PN { A.Decl ($1, $3) }
86 | IDENT DEF expand term sc term { A.Def ($1, $6, $3, $4) }
87 | IDENT sc term DEF expand term { A.Def ($1, $3, $5, $6) }
91 | item items { $1 :: $2 }