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