2 /* arlex.l - Strange script language lexer */
4 /* Copyright 1992, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2007
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 3 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., 51 Franklin Street - Fifth Floor, Boston,
22 MA 02110-1301, USA. */
25 /* Contributed by Steve Chamberlain <sac@cygnus.com>. */
27 #define DONTDECLARE_MALLOC
29 #include "libiberty.h"
34 extern int yylex (void);
44 "ADDLIB" { return ADDLIB; }
45 "ADDMOD" { return ADDMOD; }
46 "CLEAR" { return CLEAR; }
47 "CREATE" { return CREATE; }
48 "DELETE" { return DELETE; }
49 "DIRECTORY" { return DIRECTORY; }
51 "EXTRACT" { return EXTRACT; }
52 "FULLDIR" { return FULLDIR; }
53 "HELP" { return HELP; }
54 "LIST" { return LIST; }
55 "OPEN" { return OPEN; }
56 "REPLACE" { return REPLACE; }
57 "VERBOSE" { return VERBOSE; }
58 "SAVE" { return SAVE; }
59 "addlib" { return ADDLIB; }
60 "addmod" { return ADDMOD; }
61 "clear" { return CLEAR; }
62 "create" { return CREATE; }
63 "delete" { return DELETE; }
64 "directory" { return DIRECTORY; }
66 "extract" { return EXTRACT; }
67 "fulldir" { return FULLDIR; }
68 "help" { return HELP; }
69 "list" { return LIST; }
70 "open" { return OPEN; }
71 "replace" { return REPLACE; }
72 "verbose" { return VERBOSE; }
73 "save" { return SAVE; }
74 "+\n" { linenumber ++; }
78 [A-Za-z0-9/\\$:.\-\_]+ {
79 yylval.name = xstrdup (yytext);
85 "\n" { linenumber ++; return NEWLINE; }
89 /* Needed for lex, though not flex. */
90 int yywrap(void) { return 1; }