2000-07-19 H.J. Lu <hjl@gnu.org>
[binutils.git] / binutils / arlex.l
blob2fd94da4dd82f9d84d2de07454059239faf2fc57
1 %{
2 /* arlex.l - Strange script language lexer */
4 /*   Copyright (C) 1992, 95, 1997 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
24                   sac@cygnus.com
27 #define DONTDECLARE_MALLOC
28 #include <ansidecl.h>
29 #include "libiberty.h"
30 #include "arparse.h"
32 int linenumber;
35 %a 10000
36 %o 25000
40 "ADDLIB"        { return ADDLIB; }
41 "ADDMOD"        { return ADDMOD; }
42 "CLEAR"         { return CLEAR; }
43 "CREATE"        { return CREATE; }
44 "DELETE"        { return DELETE; }
45 "DIRECTORY"     { return DIRECTORY; }
46 "END"           { return END; }
47 "EXTRACT"       { return EXTRACT; }
48 "FULLDIR"       { return FULLDIR; }
49 "HELP"          { return HELP; }
50 "LIST"          { return LIST; }
51 "OPEN"          { return OPEN; }
52 "REPLACE"       { return REPLACE; }
53 "VERBOSE"       { return VERBOSE; }
54 "SAVE"          { return SAVE; }
55 "addlib"        { return ADDLIB; }
56 "addmod"        { return ADDMOD; }
57 "clear"         { return CLEAR; }
58 "create"        { return CREATE; }
59 "delete"        { return DELETE; }
60 "directory"     { return DIRECTORY; }
61 "end"           { return END; }
62 "extract"       { return EXTRACT; }
63 "fulldir"       { return FULLDIR; }
64 "help"          { return HELP; }
65 "list"          { return LIST; }
66 "open"          { return OPEN; }
67 "replace"       { return REPLACE; }
68 "verbose"       { return VERBOSE; }
69 "save"          { return SAVE; }
70 "+\n"           { linenumber ++; }
71 "("             { return '('; }
72 ")"             { return ')'; }
73 ","             { return ','; }
74 [A-Za-z0-9/$:.\-\_]+  {         
75                 yylval.name =  xstrdup (yytext);
76                 return FILENAME;
77                 }
78 "*".*           { }
79 ";".*           { }
80 " "             { }
81 "\n"             { linenumber ++; return NEWLINE; }     
84 #ifndef yywrap
85 /* Needed for lex, though not flex. */
86 int yywrap() { return 1; }
87 #endif