ENABLE_CHECKING in bfd, opcodes, binutils, ld
[deliverable/binutils-gdb.git] / binutils / syslex.l
1 %option noinput nounput noyywrap
2
3 %{
4 /* Copyright (C) 2001-2021 Free Software Foundation, Inc.
5
6 This file is part of GNU Binutils.
7
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, or (at your option)
11 any later version.
12
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.
17
18 You should have received a copy of the GNU General Public License
19 along with GLD; see the file COPYING. If not, write to the Free
20 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
21 02110-1301, USA. */
22
23 /* Note: config.h is #included via syslex_wrap.c. */
24
25 #include <string.h>
26 #include "sysinfo.h"
27
28 #ifndef YY_NO_UNPUT
29 #define YY_NO_UNPUT
30 #endif
31
32 extern int yylex (void);
33 %}
34 %%
35 "(" { return '(';}
36 ")" { return ')';}
37 "[" { return '[';}
38 "]" { return ']';}
39 " " { ; }
40 ";".* { ; }
41 "\t" { ; }
42 "\n" { ; }
43 "\""[^\"]*"\"" {
44 yylval.s = malloc (yyleng - 1);
45 memcpy (yylval.s, yytext + 1, yyleng - 2);
46 yylval.s[yyleng - 2] = '\0';
47 return NAME;
48 }
49
50 0x[0-9a-f]+ {
51 yylval.i = strtol(yytext,0,16);
52 return NUMBER;
53 }
54
55 [0-9]+ {
56 yylval.i = atoi(yytext);
57 return NUMBER;
58 }
59
60
61 "bits" { yylval.i =1 ;return UNIT;}
62 "bit" { yylval.i = 1; return UNIT;}
63 "bytes" { yylval.i= 8; return UNIT;}
64 "byte" { yylval.i = 8; return UNIT;}
65
66 "int" { yylval.s = "INT"; return TYPE;}
67 "barray" { yylval.s = "BARRAY"; return TYPE;}
68 "chars" { yylval.s = "CHARS"; return TYPE;}
69 "variable" { yylval.i = 0; return NUMBER;}
70 "counted" { yylval.i = -4; return NUMBER;}
71 "addrsize" { yylval.i = -2; return NUMBER; }
72 "segsize" { yylval.i = -1; return NUMBER; }
73 "cond" { return COND;}
74 "repeat" { return REPEAT;}
This page took 0.030463 seconds and 4 git commands to generate.