1 %{/* deflex.l - Lexer for .def files */
3 /* Copyright 1995, 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
5 This file is part of GNU Binutils.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
22 /* Contributed by Steve Chamberlain
26 #define DONTDECLARE_MALLOC
27 #include "libiberty.h"
35 "NAME" { return NAME;}
36 "LIBRARY" { return LIBRARY;}
37 "DESCRIPTION" { return DESCRIPTION;}
38 "STACKSIZE" { return STACKSIZE;}
39 "HEAPSIZE" { return HEAPSIZE;}
40 "CODE" { return CODE;}
41 "DATA" { return DATA;}
42 "SECTIONS" { return SECTIONS;}
43 "EXPORTS" { return EXPORTS;}
44 "IMPORTS" { return IMPORTS;}
45 "VERSION" { return VERSIONK;}
46 "BASE" { return BASE;}
47 "CONSTANT" { return CONSTANT; }
48 "NONAME" { return NONAME; }
49 "READ" { return READ;}
50 "WRITE" { return WRITE;}
51 "EXECUTE" { return EXECUTE;}
52 "SHARED" { return SHARED;}
53 "NONSHARED" { return NONSHARED;}
54 "SINGLE" { return SINGLE;}
55 "MULTIPLE" { return MULTIPLE;}
56 "INITINSTANCE" { return INITINSTANCE;}
57 "INITGLOBAL" { return INITGLOBAL;}
58 "TERMINSTANCE" { return TERMINSTANCE;}
59 "TERMGLOBAL" { return TERMGLOBAL;}
61 [0-9][x0-9A-Fa-f]* { yylval.number = strtol (yytext,0,0);
64 (@)?[A-Za-z$:\-\_?][A-Za-z0-9/$:\-\_@?]* {
65 yylval.id = xstrdup (yytext);
70 yylval.id = xstrdup (yytext+1);
71 yylval.id[yyleng-2] = 0;
76 yylval.id = xstrdup (yytext+1);
77 yylval.id[yyleng-2] = 0;
84 "\n" { linenumber ++ ;}
91 /* Needed for lex, though not flex. */
92 int yywrap() { return 1; }