1 %{/* deflex.l - Lexer for .def files */
3 /* Copyright 1995, 1997, 1998, 1999, 2002, 2003, 2004, 2005, 2007
4 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 3 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., 51 Franklin Street - Fifth Floor, Boston,
21 MA 02110-1301, USA. */
24 /* Contributed by Steve Chamberlain: sac@cygnus.com */
26 #define DONTDECLARE_MALLOC
27 #include "libiberty.h"
37 "NAME" { return NAME;}
38 "LIBRARY" { return LIBRARY;}
39 "DESCRIPTION" { return DESCRIPTION;}
40 "STACKSIZE" { return STACKSIZE;}
41 "HEAPSIZE" { return HEAPSIZE;}
42 "CODE" { return CODE;}
43 "DATA" { return DATA;}
44 "SECTIONS" { return SECTIONS;}
45 "EXPORTS" { return EXPORTS;}
46 "IMPORTS" { return IMPORTS;}
47 "VERSION" { return VERSIONK;}
48 "BASE" { return BASE;}
49 "CONSTANT" { return CONSTANT; }
50 "NONAME" { return NONAME; }
51 "PRIVATE" { return PRIVATE; }
52 "READ" { return READ;}
53 "WRITE" { return WRITE;}
54 "EXECUTE" { return EXECUTE;}
55 "SHARED" { return SHARED;}
56 "NONSHARED" { return NONSHARED;}
57 "SINGLE" { return SINGLE;}
58 "MULTIPLE" { return MULTIPLE;}
59 "INITINSTANCE" { return INITINSTANCE;}
60 "INITGLOBAL" { return INITGLOBAL;}
61 "TERMINSTANCE" { return TERMINSTANCE;}
62 "TERMGLOBAL" { return TERMGLOBAL;}
64 [0-9][x0-9A-Fa-f]* { yylval.number = strtol (yytext,0,0);
67 (@)?[A-Za-z$:\-\_?][A-Za-z0-9/$:\-\_@?]* {
68 yylval.id = xstrdup (yytext);
73 yylval.id = xstrdup (yytext+1);
74 yylval.id[yyleng-2] = 0;
79 yylval.id = xstrdup (yytext+1);
80 yylval.id[yyleng-2] = 0;
88 "\n" { linenumber ++ ;}
95 /* Needed for lex, though not flex. */
96 int yywrap(void) { return 1; }