blob: 3c7441095bedb3f6b11561a8f95267d181a49ce3 (
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
|
%{
#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);
/* Autorise la lecture des opérateurs. */
void allow_itanium_operators(void);
/* Autorise la lecture des opérateurs. */
void exclude_itanium_operators(void);
%}
%option noyywrap
%option stack
%option yylineno
%x identifier
%x operators
%%
<INITIAL,operators>{
_Z { return ITANIUM_SIGNATURE; }
E { return EE; }
N { return NN; }
I { return II; }
F { return FF; }
L { return LL; }
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; }
} /* INITIAL,operators> */
<operators>{
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; }
} /* operators */
<INITIAL,operators>{
S_ { return SUBSTI_FIRST; }
S[0-9a-z]_ { yylval.val = atoi(yytext + 1); return SUBSTI_N; }
T_ { return TPARAM_FIRST; }
T[0-9]*_ { yylval.val = atoi(yytext + 1); return TPARAM_N; }
[0-9]+ { yylval.val = atoi(yytext); return NUMBER; }
} /* <INITIAL,operators> */
<identifier>. { if (--itanium_txt_length == 0) yy_pop_state(); yylval.car = *yytext; return CHAR; }
<INITIAL,operators>[ ]
<*>. { 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;
yy_push_state(identifier);
}
/******************************************************************************
* *
* Paramètres : - *
* *
* Description : Autorise la lecture des opérateurs. *
* *
* Retour : - *
* *
* Remarques : - *
* *
******************************************************************************/
void allow_itanium_operators(void)
{
BEGIN(operators);
}
/******************************************************************************
* *
* Paramètres : - *
* *
* Description : Autorise la lecture des opérateurs. *
* *
* Retour : - *
* *
* Remarques : - *
* *
******************************************************************************/
void exclude_itanium_operators(void)
{
BEGIN(INITIAL);
}
|