]>
Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | %{ |
2 | /* arlex.l - Strange script language lexer */ | |
3 | ||
a2f33459 | 4 | /* Copyright 1992, 1997, 2000, 2002, 2003 Free Software Foundation, Inc. |
252b5132 RH |
5 | |
6 | This file is part of GNU Binutils. | |
7 | ||
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. | |
12 | ||
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. | |
17 | ||
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. */ | |
21 | ||
22 | ||
a2f33459 | 23 | /* Contributed by Steve Chamberlain <[email protected]>. */ |
252b5132 | 24 | |
252b5132 | 25 | #define DONTDECLARE_MALLOC |
e9792343 | 26 | #include "ansidecl.h" |
252b5132 RH |
27 | #include "libiberty.h" |
28 | #include "arparse.h" | |
29 | ||
956c53ee TS |
30 | #define YY_NO_UNPUT |
31 | ||
2da42df6 | 32 | extern int yylex (void); |
956c53ee | 33 | |
252b5132 RH |
34 | int linenumber; |
35 | %} | |
12ff5d56 AM |
36 | |
37 | %a 10000 | |
38 | %o 25000 | |
39 | ||
252b5132 RH |
40 | %% |
41 | ||
42 | "ADDLIB" { return ADDLIB; } | |
43 | "ADDMOD" { return ADDMOD; } | |
44 | "CLEAR" { return CLEAR; } | |
45 | "CREATE" { return CREATE; } | |
46 | "DELETE" { return DELETE; } | |
47 | "DIRECTORY" { return DIRECTORY; } | |
48 | "END" { return END; } | |
49 | "EXTRACT" { return EXTRACT; } | |
50 | "FULLDIR" { return FULLDIR; } | |
51 | "HELP" { return HELP; } | |
52 | "LIST" { return LIST; } | |
53 | "OPEN" { return OPEN; } | |
54 | "REPLACE" { return REPLACE; } | |
55 | "VERBOSE" { return VERBOSE; } | |
56 | "SAVE" { return SAVE; } | |
57 | "addlib" { return ADDLIB; } | |
58 | "addmod" { return ADDMOD; } | |
59 | "clear" { return CLEAR; } | |
60 | "create" { return CREATE; } | |
61 | "delete" { return DELETE; } | |
62 | "directory" { return DIRECTORY; } | |
63 | "end" { return END; } | |
64 | "extract" { return EXTRACT; } | |
65 | "fulldir" { return FULLDIR; } | |
66 | "help" { return HELP; } | |
67 | "list" { return LIST; } | |
68 | "open" { return OPEN; } | |
69 | "replace" { return REPLACE; } | |
70 | "verbose" { return VERBOSE; } | |
71 | "save" { return SAVE; } | |
72 | "+\n" { linenumber ++; } | |
73 | "(" { return '('; } | |
74 | ")" { return ')'; } | |
75 | "," { return ','; } | |
5e9520c8 | 76 | [A-Za-z0-9/\\$:.\-\_]+ { |
252b5132 RH |
77 | yylval.name = xstrdup (yytext); |
78 | return FILENAME; | |
79 | } | |
80 | "*".* { } | |
81 | ";".* { } | |
82 | " " { } | |
83 | "\n" { linenumber ++; return NEWLINE; } | |
84 | ||
85 | %% | |
86 | #ifndef yywrap | |
87 | /* Needed for lex, though not flex. */ | |
2da42df6 | 88 | int yywrap(void) { return 1; } |
252b5132 | 89 | #endif |