summaryrefslogtreecommitdiff
path: root/src/format/mangling/itanium_tok.l
blob: bc5f5f1c5beef4e3425ee7556f360502493b5989 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165

%{

#include "itanium_gram.h" 


static unsigned int itanium_txt_length = 0;


/* Borne la longueur d'une chaîne à lire. */
void set_itanium_text_length(unsigned int);


%}


%option noyywrap
%option yylineno


%x identifier


%%


_Z                      { return ITANIUM_SIGNATURE; }

E                       { return EE; }
N                       { return NN; }
I                       { return II; }

C1                      { return C1; }
C2                      { return C2; }
C3                      { return C3; }
D0                      { return C1; }
D1                      { return D2; }
D2                      { return D3; }

v                       { return V; }
w                       { return W; }
b                       { return B; }
c                       { return C; }
a                       { return A; }
h                       { return H; }
s                       { return S; }
t                       { return T; }
i                       { return I; }
j                       { return J; }
l                       { return L; }
m                       { return M; }
x                       { return X; }
y                       { return Y; }
n                       { return N; }
o                       { return O; }
f                       { return F; }
d                       { return D; }
e                       { return E; }
g                       { return G; }
z                       { return Z; }
Dd                      { return DD; }
De                      { return DE; }
Df                      { return DF; }
Dh                      { return DH; }
Di                      { return DI; }
Ds                      { return DS; }
u                       { return U; }

P                       { return TP; }
R                       { return TR; }
O                       { return TO; }
C                       { return TC; }
G                       { return TG; }

r                       { return QR; }
V                       { return QV; }
K                       { return QK; }

St                      { return ST; }
Sa                      { return SA; }
Sb                      { return SB; }
Ss                      { return SS; }
Si                      { return SI; }
So                      { return SO; }
Sd                      { return SD; }


nw                      { return OPER_NEW; }
na                      { return OPER_NEW_ARRAY; }
dl                      { return OPER_DELETE; }
da                      { return OPER_DELETE_ARRAY; }      
ps                      { return OPER_PLUS_UNARY; }
ng                      { return OPER_NEG_UNARY; }
ad                      { return OPER_AND_UNARY; }
de                      { return OPER_DE_UNARY; }
co                      { return OPER_COMPL; }
pl                      { return OPER_PLUS; }
mi                      { return OPER_MINUS; }
ml                      { return OPER_MUL; }
dv                      { return OPER_DIV; }
rm                      { return OPER_MOD; }
an                      { return OPER_AND; }
or                      { return OPER_OR; }
eo                      { return OPER_EXCL_OR; }
aS                      { return OPER_AS; }
pL                      { return OPER_PLUS_EQ; }
mI                      { return OPER_MINUS_EQ; }
mL                      { return OPER_MUL_EQ; }
dV                      { return OPER_DIV_EQ; }
rM                      { return OPER_MOD_EQ; }
aN                      { return OPER_AND_EQ; }
oR                      { return OPER_OR_EQ; }
eO                      { return OPER_EXCL_OR_EQ; }
ls                      { return OPER_LEFT_SHIFT; }
rs                      { return OPER_RIGHT_SHIFT; }
lS                      { return OPER_LEFT_SHIFT_EQ; }
rS                      { return OPER_RIGHT_SHIFT_EQ; }
eq                      { return OPER_EQUAL; }
ne                      { return OPER_NOT_EQ; }
lt                      { return OPER_LESS; }
gt                      { return OPER_GREATER; }
le                      { return OPER_LESS_EQ; }
ge                      { return OPER_GREATER_EQ; }
nt                      { return OPER_NOT; }
aa                      { return OPER_AND_AND; }
oo                      { return OPER_OR_OR; }
pp                      { return OPER_PLUS_PLUS; }
mm                      { return OPER_MINUS_MINUS; }
cm                      { return OPER_COMMA; }
pm                      { return OPER_PRIV_MEMB; }
pt                      { return OPER_POINTER_TO; }
cl                      { return OPER_CLASS; }
ix                      { return OPER_INDEX; }



[0-9]+                  { yylval.val = atoi(yytext); return NUMBER; }

<identifier>.           { if (--itanium_txt_length == 0) BEGIN(INITIAL); yylval.car = *yytext; return CHAR; }

<*>.                    { printf("error  : '%s'\n", yytext); }


%%


/******************************************************************************
*                                                                             *
*  Paramètres  : length = taille de chaîne à lire.                            *
*                                                                             *
*  Description : Borne la longueur d'une chaîne à lire.                       *
*                                                                             *
*  Retour      : -                                                            *
*                                                                             *
*  Remarques   : -                                                            *
*                                                                             *
******************************************************************************/

void set_itanium_text_length(unsigned int length)
{
    itanium_txt_length = length;

    BEGIN(identifier);

}