2 /* arparse.y - Stange script language parser */
4 /* Copyright (C) 1992, 93, 95, 97, 98, 1999 Free Software Foundation, Inc.
6 This file is part of GNU Binutils.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
23 /* Contributed by Steve Chamberlain
27 #define DONTDECLARE_MALLOC
32 extern
int yylex PARAMS
((void));
33 static int yyerror PARAMS
((const char *));
44 %token
<name
> FILENAME
61 %type
<list
> modulelist
62 %type
<list
> modulename
63 %type
<name
> optional_filename
76 command NEWLINE
{ prompt
(); }
91 | END
{ ar_end
(); return
0; }
93 | FILENAME
{ yyerror("foo"); }
146 ADDLIB FILENAME modulelist
147 { ar_addlib
($2,$3); }
150 DIRECTORY FILENAME modulelist optional_filename
151 { ar_directory
($2, $3, $4); }
170 modulename optcomma FILENAME
171 { struct list
*n
= (struct list
*) malloc
(sizeof
(struct list
));
188 { verbose
= !verbose
; }
198 extern
int linenumber
;
200 printf
(_
("Syntax error in archive script, line %d\n"), linenumber
+ 1);