Commit | Line | Data |
---|---|---|
cfdf38f2 BE |
1 | %option noinput nounput |
2 | ||
252b5132 RH |
3 | %{ |
4 | /* arlex.l - Strange script language lexer */ | |
5 | ||
894e93a8 | 6 | /* Copyright 1992, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2011 |
aef6203b | 7 | Free Software Foundation, Inc. |
252b5132 | 8 | |
32866df7 | 9 | This file is part of GNU Binutils. |
252b5132 | 10 | |
32866df7 NC |
11 | This program is free software; you can redistribute it and/or modify |
12 | it under the terms of the GNU General Public License as published by | |
13 | the Free Software Foundation; either version 3 of the License, or | |
14 | (at your option) any later version. | |
252b5132 | 15 | |
32866df7 NC |
16 | This program is distributed in the hope that it will be useful, |
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | GNU General Public License for more details. | |
252b5132 | 20 | |
32866df7 NC |
21 | You should have received a copy of the GNU General Public License |
22 | along with this program; if not, write to the Free Software | |
23 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, | |
24 | MA 02110-1301, USA. */ | |
252b5132 RH |
25 | |
26 | ||
a2f33459 | 27 | /* Contributed by Steve Chamberlain <sac@cygnus.com>. */ |
252b5132 | 28 | |
252b5132 | 29 | #define DONTDECLARE_MALLOC |
e9792343 | 30 | #include "ansidecl.h" |
252b5132 RH |
31 | #include "libiberty.h" |
32 | #include "arparse.h" | |
33 | ||
894e93a8 | 34 | #ifndef YY_NO_UNPUT |
956c53ee | 35 | #define YY_NO_UNPUT |
894e93a8 NC |
36 | #endif |
37 | ||
2da42df6 | 38 | extern int yylex (void); |
956c53ee | 39 | |
252b5132 RH |
40 | int linenumber; |
41 | %} | |
12ff5d56 AM |
42 | |
43 | %a 10000 | |
44 | %o 25000 | |
45 | ||
252b5132 RH |
46 | %% |
47 | ||
48 | "ADDLIB" { return ADDLIB; } | |
49 | "ADDMOD" { return ADDMOD; } | |
50 | "CLEAR" { return CLEAR; } | |
51 | "CREATE" { return CREATE; } | |
52 | "DELETE" { return DELETE; } | |
53 | "DIRECTORY" { return DIRECTORY; } | |
54 | "END" { return END; } | |
55 | "EXTRACT" { return EXTRACT; } | |
56 | "FULLDIR" { return FULLDIR; } | |
57 | "HELP" { return HELP; } | |
58 | "LIST" { return LIST; } | |
59 | "OPEN" { return OPEN; } | |
60 | "REPLACE" { return REPLACE; } | |
61 | "VERBOSE" { return VERBOSE; } | |
62 | "SAVE" { return SAVE; } | |
63 | "addlib" { return ADDLIB; } | |
64 | "addmod" { return ADDMOD; } | |
65 | "clear" { return CLEAR; } | |
66 | "create" { return CREATE; } | |
67 | "delete" { return DELETE; } | |
68 | "directory" { return DIRECTORY; } | |
69 | "end" { return END; } | |
70 | "extract" { return EXTRACT; } | |
71 | "fulldir" { return FULLDIR; } | |
72 | "help" { return HELP; } | |
73 | "list" { return LIST; } | |
74 | "open" { return OPEN; } | |
75 | "replace" { return REPLACE; } | |
76 | "verbose" { return VERBOSE; } | |
77 | "save" { return SAVE; } | |
78 | "+\n" { linenumber ++; } | |
79 | "(" { return '('; } | |
80 | ")" { return ')'; } | |
81 | "," { return ','; } | |
5e9520c8 | 82 | [A-Za-z0-9/\\$:.\-\_]+ { |
252b5132 RH |
83 | yylval.name = xstrdup (yytext); |
84 | return FILENAME; | |
85 | } | |
86 | "*".* { } | |
87 | ";".* { } | |
88 | " " { } | |
89 | "\n" { linenumber ++; return NEWLINE; } | |
90 | ||
91 | %% | |
92 | #ifndef yywrap | |
93 | /* Needed for lex, though not flex. */ | |
2da42df6 | 94 | int yywrap(void) { return 1; } |
252b5132 | 95 | #endif |