OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [binutils/] [syslex.l] - Blame information for rev 171

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 15 khays
%option noinput nounput
2
 
3
%{
4
/* Copyright 2001, 2003, 2005, 2007, 2011 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
#include "config.h"
24
#ifdef HAVE_STRING_H
25
#include 
26
#else
27
#ifdef HAVE_STRINGS_H
28
#include 
29
#endif
30
#endif
31
#include "sysinfo.h"
32
 
33
#ifndef YY_NO_UNPUT
34
#define YY_NO_UNPUT
35
#endif
36
 
37
#ifndef yywrap
38
static int yywrap (void) { return 1; }
39
#endif
40
 
41
extern int yylex (void);
42
%}
43
%%
44
"(" { return '(';}
45
")" { return ')';}
46
"[" { return '[';}
47
"]" { return ']';}
48
" " { ; }
49
";".* { ; }
50
"\t" { ; }
51
"\n" { ; }
52
"\""[^\"]*"\"" {
53
        yylval.s = malloc (yyleng - 1);
54
        memcpy (yylval.s, yytext + 1, yyleng - 2);
55
        yylval.s[yyleng - 2] = '\0';
56
        return NAME;
57
        }
58
 
59
0x[0-9a-f]+ {
60
        yylval.i = strtol(yytext,0,16);
61
        return  NUMBER;
62
        }
63
 
64
[0-9]+ {
65
        yylval.i = atoi(yytext);
66
        return  NUMBER;
67
        }
68
 
69
 
70
"bits" { yylval.i =1 ;return UNIT;}
71
"bit" { yylval.i = 1; return UNIT;}
72
"bytes" { yylval.i= 8; return UNIT;}
73
"byte" { yylval.i = 8; return UNIT;}
74
 
75
"int" { yylval.s = "INT"; return TYPE;}
76
"barray" { yylval.s = "BARRAY"; return TYPE;}
77
"chars" { yylval.s = "CHARS"; return TYPE;}
78
"variable" { yylval.i = 0; return NUMBER;}
79
"counted" { yylval.i = -4; return NUMBER;}
80
"addrsize" { yylval.i = -2; return NUMBER; }
81
"segsize" { yylval.i = -1; return NUMBER; }
82
"cond" { return COND;}
83
"repeat" { return REPEAT;}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.