* arlex.l: Fix formatting.
[binutils.git] / binutils / arlex.l
bloba7f0ca296774cfb2ba1397a0adfdce95576e50b3
1 %{
2 /* arlex.l - Strange script language lexer */
4 /* Copyright 1992, 1997, 2000, 2002, 2003 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 <sac@cygnus.com>.  */
25 #define DONTDECLARE_MALLOC
26 #include "ansidecl.h"
27 #include "libiberty.h"
28 #include "arparse.h"
30 #define YY_NO_UNPUT
32 extern int yylex (void);
34 int linenumber;
37 %a 10000
38 %o 25000
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 ','; }
76 [A-Za-z0-9/\\$:.\-\_]+  {       
77                 yylval.name =  xstrdup (yytext);
78                 return FILENAME;
79                 }
80 "*".*           { }
81 ";".*           { }
82 " "             { }
83 "\n"             { linenumber ++; return NEWLINE; }     
86 #ifndef yywrap
87 /* Needed for lex, though not flex. */
88 int yywrap(void) { return 1; }
89 #endif