* aoutx.h (NAME(aout,link_hash_table_create)): Allocate hash table
[deliverable/binutils-gdb.git] / binutils / deflex.l
CommitLineData
6f2d3212
SC
1%{
2/* deflex.l - Lexer for .def files */
3
4/* Copyright (C) 1995 Free Software Foundation, Inc.
5
6This file is part of GNU Binutils.
7
8This program is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2 of the License, or
11(at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with this program; if not, write to the Free Software
20Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
21
22
23/* Contributed by Steve Chamberlain
24 sac@cygnus.com
25
26*/
27#define DONTDECLARE_MALLOC
28#include "defparse.h"
29extern char *strdup();
30int linenumber;
31
32%}
33%%
34"NAME" { return NAME;}
35"LIBRARY" { return LIBRARY;}
36"DESCRIPTION" { return DESCRIPTION;}
37"STACKSIZE" { return STACKSIZE;}
38"HEAPSIZE" { return HEAPSIZE;}
39"CODE" { return CODE;}
40"DATA" { return DATA;}
41"SECTIONS" { return SECTIONS;}
42"EXPORTS" { return EXPORTS;}
43"IMPORTS" { return IMPORTS;}
44"VERSION" { return VERSION;}
45"BASE" { return BASE;}
46"CONSTANT" { return CONSTANT; }
47"NONAME" { return NONAME; }
48
49"READ" { return READ;}
50"WRITE" { return WRITE;}
51"EXECUTE" { return EXECUTE;}
52"SHARED" { return SHARED;}
53
54[0-9][x0-9A-Fa-f]* { yylval.number = strtol (yytext,0,0);
55 return NUMBER; }
56
57[A-Za-z$:\-\_][A-Za-z0-9/$:\-\_@]+ {
58 yylval.id = strdup(yytext);
59 return ID;
60 }
61"\""[^\"]*"\"" {
62 yylval.string = strdup (yytext+1);
63 yylval.string[yyleng-2] = 0;
64 return STRING;
65 }
66
67"\'"[^\']*"\'" {
68 yylval.string = strdup (yytext+1);
69 yylval.string[yyleng-2] = 0;
70 return STRING;
71 }
72"*".* { }
73";".* { }
74" " { }
75"\t" { }
76"\n" { linenumber ++ ;}
77"=" { return '=';}
78"." { return '.';}
79"@" { return '@';}
80"," { return ',';}
81%%
82#ifndef yywrap
83/* Needed for lex, though not flex. */
84int yywrap() { return 1; }
85#endif
This page took 0.025032 seconds and 4 git commands to generate.