2 /* arlex.l - Strange script language lexer */
4 /* Copyright 1992, 1997, 2000, 2001, 2002, 2003, 2004
5 Free Software Foundation, Inc.
7 This file is part of GNU Binutils.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
24 /* Contributed by Steve Chamberlain <sac@cygnus.com>. */
26 #define DONTDECLARE_MALLOC
28 #include "libiberty.h"
33 extern int yylex (void);
43 "ADDLIB" { return ADDLIB; }
44 "ADDMOD" { return ADDMOD; }
45 "CLEAR" { return CLEAR; }
46 "CREATE" { return CREATE; }
47 "DELETE" { return DELETE; }
48 "DIRECTORY" { return DIRECTORY; }
50 "EXTRACT" { return EXTRACT; }
51 "FULLDIR" { return FULLDIR; }
52 "HELP" { return HELP; }
53 "LIST" { return LIST; }
54 "OPEN" { return OPEN; }
55 "REPLACE" { return REPLACE; }
56 "VERBOSE" { return VERBOSE; }
57 "SAVE" { return SAVE; }
58 "addlib" { return ADDLIB; }
59 "addmod" { return ADDMOD; }
60 "clear" { return CLEAR; }
61 "create" { return CREATE; }
62 "delete" { return DELETE; }
63 "directory" { return DIRECTORY; }
65 "extract" { return EXTRACT; }
66 "fulldir" { return FULLDIR; }
67 "help" { return HELP; }
68 "list" { return LIST; }
69 "open" { return OPEN; }
70 "replace" { return REPLACE; }
71 "verbose" { return VERBOSE; }
72 "save" { return SAVE; }
73 "+\n" { linenumber ++; }
77 [A-Za-z0-9/\\$:.\-\_]+ {
78 yylval.name = xstrdup (yytext);
84 "\n" { linenumber ++; return NEWLINE; }
88 /* Needed for lex, though not flex. */
89 int yywrap(void) { return 1; }