1 | #ifndef lint |
---|
2 | static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; |
---|
3 | #endif |
---|
4 | #define YYBYACC 1 |
---|
5 | #define YYMAJOR 1 |
---|
6 | #define YYMINOR 9 |
---|
7 | #define yyclearin (yychar=(-1)) |
---|
8 | #define yyerrok (yyerrflag=0) |
---|
9 | #define YYRECOVERING (yyerrflag!=0) |
---|
10 | #define YYPREFIX "yy" |
---|
11 | #line 18 "convert.y" |
---|
12 | #include <stdlib.h> |
---|
13 | #include <stdio.h> |
---|
14 | #include <string.h> |
---|
15 | #include "decl.h" |
---|
16 | #line 24 "convert.y" |
---|
17 | typedef union { |
---|
18 | int ival; |
---|
19 | char na[LONGNOM]; |
---|
20 | listnom * ln; |
---|
21 | } YYSTYPE; |
---|
22 | #line 23 "y.tab.c" |
---|
23 | #define TOK_SEP 257 |
---|
24 | #define TOK_USE 258 |
---|
25 | #define TOK_MINWIDTH 259 |
---|
26 | #define TOK_REGRIDDING 260 |
---|
27 | #define TOK_COEFFRAFX 261 |
---|
28 | #define TOK_COEFFRAFY 262 |
---|
29 | #define TOK_COEFFRAFZ 263 |
---|
30 | #define TOK_COEFFRAFTX 264 |
---|
31 | #define TOK_COEFFRAFTY 265 |
---|
32 | #define TOK_COEFFRAFTZ 266 |
---|
33 | #define TOK_MODULEMAIN 267 |
---|
34 | #define TOK_NOTGRIDDEP 268 |
---|
35 | #define TOK_NUM 269 |
---|
36 | #define TOK_FILENAME 270 |
---|
37 | #define TOK_USEITEM 271 |
---|
38 | #define TOK_NAME 272 |
---|
39 | #define TOK_PROBTYPE 273 |
---|
40 | #define TOK_EFFICIENCY 274 |
---|
41 | #define TOK_RAFMAX 275 |
---|
42 | #define TOK_RAFMAXX 276 |
---|
43 | #define TOK_RAFMAXY 277 |
---|
44 | #define TOK_RAFMAXZ 278 |
---|
45 | #define YYERRCODE 256 |
---|
46 | short yylhs[] = { -1, |
---|
47 | 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
48 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
49 | 1, 1, |
---|
50 | }; |
---|
51 | short yylen[] = { 2, |
---|
52 | 0, 2, 1, 3, 5, 7, 3, 3, 3, 3, |
---|
53 | 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, |
---|
54 | 3, 3, |
---|
55 | }; |
---|
56 | short yydefred[] = { 1, |
---|
57 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
58 | 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, |
---|
59 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
60 | 0, 0, 0, 0, 0, 0, 0, 22, 21, 8, |
---|
61 | 7, 9, 10, 11, 12, 13, 14, 0, 0, 4, |
---|
62 | 16, 17, 18, 19, 20, 15, 0, 0, 5, 0, |
---|
63 | 6, |
---|
64 | }; |
---|
65 | short yydgoto[] = { 1, |
---|
66 | 20, |
---|
67 | }; |
---|
68 | short yysindex[] = { 0, |
---|
69 | -10, -268, -265, -264, -263, -262, -261, -260, -259, -258, |
---|
70 | -257, -245, -254, -256, -255, -250, -249, -248, 0, 0, |
---|
71 | -37, -36, -35, -34, -33, -32, -31, -30, -29, -28, |
---|
72 | -240, -43, -26, -25, -24, -23, -22, 0, 0, 0, |
---|
73 | 0, 0, 0, 0, 0, 0, 0, -21, -233, 0, |
---|
74 | 0, 0, 0, 0, 0, 0, -42, -232, 0, -18, |
---|
75 | 0, |
---|
76 | }; |
---|
77 | short yyrindex[] = { 0, |
---|
78 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
79 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
80 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
81 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
82 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
83 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
84 | 0, |
---|
85 | }; |
---|
86 | short yygindex[] = { 0, |
---|
87 | 0, |
---|
88 | }; |
---|
89 | #define YYTABLESIZE 268 |
---|
90 | short yytable[] = { 19, |
---|
91 | 49, 58, 21, 22, 23, 24, 25, 26, 27, 28, |
---|
92 | 29, 31, 33, 34, 30, 50, 59, 32, 35, 36, |
---|
93 | 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, |
---|
94 | 47, 48, 51, 52, 53, 54, 55, 56, 57, 60, |
---|
95 | 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
96 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
97 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
98 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
99 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
100 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
101 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
102 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
103 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
104 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
105 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
106 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
107 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
108 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
109 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
110 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
111 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
112 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
113 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
114 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
---|
115 | 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, |
---|
116 | 5, 6, 7, 8, 9, 10, 11, 12, 0, 0, |
---|
117 | 0, 0, 13, 14, 15, 16, 17, 18, |
---|
118 | }; |
---|
119 | short yycheck[] = { 10, |
---|
120 | 44, 44, 271, 269, 269, 269, 269, 269, 269, 269, |
---|
121 | 269, 257, 269, 269, 272, 59, 59, 272, 269, 269, |
---|
122 | 269, 59, 59, 59, 59, 59, 59, 59, 59, 59, |
---|
123 | 59, 272, 59, 59, 59, 59, 59, 59, 272, 272, |
---|
124 | 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
125 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
126 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
127 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
128 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
129 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
130 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
131 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
132 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
133 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
134 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
135 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
136 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
137 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
138 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
139 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
140 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
141 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
142 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
143 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
---|
144 | -1, -1, -1, -1, -1, -1, -1, 258, 259, 260, |
---|
145 | 261, 262, 263, 264, 265, 266, 267, 268, -1, -1, |
---|
146 | -1, -1, 273, 274, 275, 276, 277, 278, |
---|
147 | }; |
---|
148 | #define YYFINAL 1 |
---|
149 | #ifndef YYDEBUG |
---|
150 | #define YYDEBUG 1 |
---|
151 | #endif |
---|
152 | #define YYMAXTOKEN 278 |
---|
153 | #if YYDEBUG |
---|
154 | char *yyname[] = { |
---|
155 | "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
---|
156 | 0,0,0,0,0,0,0,0,0,"'('","')'",0,0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,"':'","';'",0, |
---|
157 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'['",0,"']'",0,0,0, |
---|
158 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
---|
159 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
---|
160 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
---|
161 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, |
---|
162 | "TOK_SEP","TOK_USE","TOK_MINWIDTH","TOK_REGRIDDING","TOK_COEFFRAFX", |
---|
163 | "TOK_COEFFRAFY","TOK_COEFFRAFZ","TOK_COEFFRAFTX","TOK_COEFFRAFTY", |
---|
164 | "TOK_COEFFRAFTZ","TOK_MODULEMAIN","TOK_NOTGRIDDEP","TOK_NUM","TOK_FILENAME", |
---|
165 | "TOK_USEITEM","TOK_NAME","TOK_PROBTYPE","TOK_EFFICIENCY","TOK_RAFMAX", |
---|
166 | "TOK_RAFMAXX","TOK_RAFMAXY","TOK_RAFMAXZ", |
---|
167 | }; |
---|
168 | char *yyrule[] = { |
---|
169 | "$accept : input", |
---|
170 | "input :", |
---|
171 | "input : input line", |
---|
172 | "line : '\\n'", |
---|
173 | "line : TOK_PROBTYPE TOK_NAME ';'", |
---|
174 | "line : TOK_PROBTYPE TOK_NAME ',' TOK_NAME ';'", |
---|
175 | "line : TOK_PROBTYPE TOK_NAME ',' TOK_NAME ',' TOK_NAME ';'", |
---|
176 | "line : TOK_COEFFRAFX TOK_NUM ';'", |
---|
177 | "line : TOK_REGRIDDING TOK_NUM ';'", |
---|
178 | "line : TOK_COEFFRAFY TOK_NUM ';'", |
---|
179 | "line : TOK_COEFFRAFZ TOK_NUM ';'", |
---|
180 | "line : TOK_COEFFRAFTX TOK_NUM ';'", |
---|
181 | "line : TOK_COEFFRAFTY TOK_NUM ';'", |
---|
182 | "line : TOK_COEFFRAFTZ TOK_NUM ';'", |
---|
183 | "line : TOK_MODULEMAIN TOK_NAME ';'", |
---|
184 | "line : TOK_NOTGRIDDEP TOK_SEP TOK_NAME ';'", |
---|
185 | "line : TOK_EFFICIENCY TOK_NUM ';'", |
---|
186 | "line : TOK_RAFMAX TOK_NUM ';'", |
---|
187 | "line : TOK_RAFMAXX TOK_NUM ';'", |
---|
188 | "line : TOK_RAFMAXY TOK_NUM ';'", |
---|
189 | "line : TOK_RAFMAXZ TOK_NUM ';'", |
---|
190 | "line : TOK_MINWIDTH TOK_NUM ';'", |
---|
191 | "line : TOK_USE TOK_USEITEM ';'", |
---|
192 | }; |
---|
193 | #endif |
---|
194 | #ifdef YYSTACKSIZE |
---|
195 | #undef YYMAXDEPTH |
---|
196 | #define YYMAXDEPTH YYSTACKSIZE |
---|
197 | #else |
---|
198 | #ifdef YYMAXDEPTH |
---|
199 | #define YYSTACKSIZE YYMAXDEPTH |
---|
200 | #else |
---|
201 | #define YYSTACKSIZE 500 |
---|
202 | #define YYMAXDEPTH 500 |
---|
203 | #endif |
---|
204 | #endif |
---|
205 | int yydebug; |
---|
206 | int yynerrs; |
---|
207 | int yyerrflag; |
---|
208 | int yychar; |
---|
209 | short *yyssp; |
---|
210 | YYSTYPE *yyvsp; |
---|
211 | YYSTYPE yyval; |
---|
212 | YYSTYPE yylval; |
---|
213 | short yyss[YYSTACKSIZE]; |
---|
214 | YYSTYPE yyvs[YYSTACKSIZE]; |
---|
215 | #define yystacksize YYSTACKSIZE |
---|
216 | #line 93 "convert.y" |
---|
217 | |
---|
218 | int main(int argc,char *argv[]) |
---|
219 | { |
---|
220 | extern FILE * yyin ; |
---|
221 | FILE *dependglobaloutput; |
---|
222 | char *tmp; |
---|
223 | int i; |
---|
224 | listnom *parcours; |
---|
225 | |
---|
226 | /******************************************************************************/ |
---|
227 | /* 1- Variables initialization */ |
---|
228 | /******************************************************************************/ |
---|
229 | globliste=(listvar *)NULL; |
---|
230 | listenamelist=(listnamelist *)NULL; |
---|
231 | globparam=(listvar *)NULL; |
---|
232 | globvarforcommon=(listvar *)NULL; |
---|
233 | AllocateList=(listallocate *)NULL; |
---|
234 | commonlist=(listvarcommon *)NULL; |
---|
235 | listofsubroutinewhereagrifisused=(listnom *)NULL; |
---|
236 | listofincludebysubroutine=(listusemodule *)NULL; |
---|
237 | listofmodulebysubroutine=(listusemodule *)NULL; |
---|
238 | listofmoduletmp=(listusemodule *)NULL; |
---|
239 | listmoduleinfile=(listmodule *)NULL; |
---|
240 | varofsubroutineliste=(listvar *)NULL; |
---|
241 | varsubroutine=(listvar *)NULL; |
---|
242 | listvarindoloop=(listvar *)NULL; |
---|
243 | listenotgriddepend=(listvar *)NULL; |
---|
244 | Listofavailableindices=(listindice *)NULL; |
---|
245 | Listofvarpointtovar=(listvarpointtovar *)NULL; |
---|
246 | globalvarofusefile = (listvar *)NULL; |
---|
247 | globalvarofusefile2 = (listvar *)NULL; |
---|
248 | |
---|
249 | strcpy(mainfile,argv[1]); |
---|
250 | strcpy(nomdir,"AGRIF_INC"); |
---|
251 | strcpy(commondirin,"."); |
---|
252 | strcpy(commondirout,"."); |
---|
253 | strcpy(filetoparse," "); |
---|
254 | strcpy(subofagrifinitgrids,""); |
---|
255 | strcpy(meetagrifinitgrids,""); |
---|
256 | strcpy(meetmpiinit,""); |
---|
257 | strcpy(mpiinitvar,""); |
---|
258 | |
---|
259 | listofvarofusemodulecreated=0; |
---|
260 | checkexistcommon=1; |
---|
261 | fortran77 = 0 ; |
---|
262 | Did_filetoparse_treated = 0 ; |
---|
263 | userefficiency=0; |
---|
264 | todebug=0; |
---|
265 | onlyfixedgrids=0; |
---|
266 | fixedgrids=0; |
---|
267 | InAgrifParentDef = 0; |
---|
268 | rafmaxx=0; |
---|
269 | rafmaxy=0; |
---|
270 | rafmaxz=0; |
---|
271 | IntegerIShouldBeAdd=0; |
---|
272 | IndicenbmaillesX=0; |
---|
273 | IndicenbmaillesY=0; |
---|
274 | IndicenbmaillesZ=0; |
---|
275 | minwidth=1; |
---|
276 | coeffrafx=0; |
---|
277 | coeffrafy=0; |
---|
278 | coeffrafz=0; |
---|
279 | indicemaxtabvars = 0; /* current indice in the table tabvars */ |
---|
280 | oldindicemaxtabvars = 0;/* current indice in the table tabvars */ |
---|
281 | SubloopScalar = 0; |
---|
282 | /******************************************************************************/ |
---|
283 | /* 2- Program arguments */ |
---|
284 | /******************************************************************************/ |
---|
285 | if (argc < 2) |
---|
286 | { |
---|
287 | printf("usage : conv <file> [-rm] [-incdir <directory>] \n"); |
---|
288 | printf(" [-comdirin <directory>] [-comdirout <directory>]\n"); |
---|
289 | printf(" [-convfile <FILENAME >] -SubloopScalar -SubloopScalar1 \n"); |
---|
290 | printf(" -f77\n"); |
---|
291 | exit(0); |
---|
292 | } |
---|
293 | |
---|
294 | |
---|
295 | if ((yyin=fopen(argv[1],"r"))==NULL) |
---|
296 | { |
---|
297 | printf("the file %s doesn't exist \n",argv[1]); |
---|
298 | exit(0); |
---|
299 | } |
---|
300 | |
---|
301 | i=2; |
---|
302 | while (i<argc) |
---|
303 | { |
---|
304 | if (!strcasecmp(argv[i],"-incdir")) |
---|
305 | { |
---|
306 | strcpy(nomdir,argv[i+1]); |
---|
307 | i++; |
---|
308 | } |
---|
309 | else if (!strcasecmp(argv[i],"-comdirin")) /* input directory */ |
---|
310 | { |
---|
311 | strcpy(commondirin,argv[i+1]); |
---|
312 | i++; |
---|
313 | } |
---|
314 | else if (!strcasecmp(argv[i],"-comdirout")) /* output directory */ |
---|
315 | { |
---|
316 | strcpy(commondirout,argv[i+1]); |
---|
317 | i++; |
---|
318 | } |
---|
319 | else if (!strcasecmp(argv[i],"-convfile")) /* file to parse */ |
---|
320 | { |
---|
321 | strcpy(filetoparse,argv[i+1]); |
---|
322 | i++; |
---|
323 | } |
---|
324 | else if (!strcasecmp(argv[i],"-f77")) /* fortran 77 file to parse */ |
---|
325 | { |
---|
326 | fortran77 = 1 ; |
---|
327 | } |
---|
328 | else if (!strcasecmp(argv[i],"-SubloopScalar")) /* file to parse */ |
---|
329 | { |
---|
330 | SubloopScalar = 1 ; |
---|
331 | } |
---|
332 | else if (!strcasecmp(argv[i],"-SubloopScalar1")) /* file to parse */ |
---|
333 | { |
---|
334 | SubloopScalar = 2 ; |
---|
335 | } |
---|
336 | else if (!strcasecmp(argv[i],"-rm")) |
---|
337 | { |
---|
338 | checkexistcommon=0; |
---|
339 | } |
---|
340 | else |
---|
341 | { |
---|
342 | printf("Unkwon option : %s\n",argv[i]); |
---|
343 | exit(0); |
---|
344 | } |
---|
345 | i++; |
---|
346 | } |
---|
347 | |
---|
348 | /******************************************************************************/ |
---|
349 | /* 3- Parsing of the conv file <name>.in */ |
---|
350 | /******************************************************************************/ |
---|
351 | |
---|
352 | if ((yyin=fopen(argv[1],"r"))==NULL) |
---|
353 | { |
---|
354 | printf("the file %s doesn't exist \n",argv[1]); |
---|
355 | exit(0); |
---|
356 | } |
---|
357 | strcpy(mainfile,argv[1]); |
---|
358 | |
---|
359 | yyparse(); |
---|
360 | |
---|
361 | /******************************************************************************/ |
---|
362 | /* 4- Preparation of the file parsing */ |
---|
363 | /******************************************************************************/ |
---|
364 | if ((yyin=fopen(filetoparse,"r"))==NULL) /* Is the file to parse exist ? */ |
---|
365 | { |
---|
366 | printf("the file %s doesn't exist \n",filetoparse); |
---|
367 | exit(0); |
---|
368 | } |
---|
369 | /* NameTamponfile : the name of the model file extract from the name */ |
---|
370 | /* of agrif_module_<NameTamponfile> */ |
---|
371 | tmp = strchr(filetoparse, '.'); |
---|
372 | NameTamponfile=(char *)malloc( |
---|
373 | (strlen(filetoparse)-strlen(tmp)+1)*sizeof(char)); |
---|
374 | strncpy(NameTamponfile,filetoparse,strlen(filetoparse)-strlen(tmp)+1); |
---|
375 | strcpy (&NameTamponfile[strlen(filetoparse)-strlen(tmp)], "\0"); |
---|
376 | /* mainfile : the name of the file to parse */ |
---|
377 | strcpy(mainfile,filetoparse); |
---|
378 | /* We should verify that this file has not been read before */ |
---|
379 | /* if it is the case we record the old globliste in the tmplocallist */ |
---|
380 | tmplocallist = NULL; |
---|
381 | tmpuselocallist = NULL; |
---|
382 | Did_filetoparse_treated = Did_filetoparse_readed(NameTamponfile); |
---|
383 | /* if Did_filetoparse_treated = 1 then the file to parse has been treated */ |
---|
384 | if ( Did_filetoparse_treated == 0 ) |
---|
385 | { |
---|
386 | /* if the filetoparse has not been treated, we should know the last */ |
---|
387 | /* tabvars indices which has been used */ |
---|
388 | if ((dependglobaloutput=fopen(".dependglobal","r"))!=NULL) |
---|
389 | { |
---|
390 | fscanf(dependglobaloutput,"%d\n",&indicemaxtabvars); |
---|
391 | fclose(dependglobaloutput); |
---|
392 | oldindicemaxtabvars = indicemaxtabvars; |
---|
393 | } |
---|
394 | } |
---|
395 | /* Write the .dependnbxnby file which contains indices of nbmaillsX, */ |
---|
396 | /* nbmailleY and nbmailleZ */ |
---|
397 | Readthedependnbxnbyfile(); |
---|
398 | |
---|
399 | /******************************************************************************/ |
---|
400 | /* 4- Parsing of the input file (2 times) */ |
---|
401 | /******************************************************************************/ |
---|
402 | |
---|
403 | firstpass = 1; |
---|
404 | processfortran(filetoparse); |
---|
405 | firstpass = 0; |
---|
406 | processfortran(filetoparse); |
---|
407 | |
---|
408 | /******************************************************************************/ |
---|
409 | /* 5- Write informations in output files */ |
---|
410 | /******************************************************************************/ |
---|
411 | |
---|
412 | if ( Did_filetoparse_treated == 0 ) /* if the file has never been treated */ |
---|
413 | { |
---|
414 | /* Write the .dependglobal file which contain the max indice */ |
---|
415 | /* of the tabvars table */ |
---|
416 | dependglobaloutput = fopen(".dependglobal","w"); |
---|
417 | fprintf(dependglobaloutput,"%d\n",indicemaxtabvars); |
---|
418 | fclose(dependglobaloutput); |
---|
419 | /* Write the .depend<namefile> file which contain general informations */ |
---|
420 | /* about variable of this file */ |
---|
421 | parcours = modulelist; |
---|
422 | while( parcours ) |
---|
423 | { |
---|
424 | Writethedependfile(parcours->nom,globliste); |
---|
425 | parcours=parcours->suiv; |
---|
426 | } |
---|
427 | } |
---|
428 | |
---|
429 | /******************************************************************************/ |
---|
430 | /* 7- Remove the non grid dependent variables */ |
---|
431 | /******************************************************************************/ |
---|
432 | |
---|
433 | /* we should remove from the globliste the non grid dependent variables */ |
---|
434 | RemoveNotgriddependFromGlobliste(); |
---|
435 | |
---|
436 | /******************************************************************************/ |
---|
437 | /* 8- Write informations in output files */ |
---|
438 | /******************************************************************************/ |
---|
439 | |
---|
440 | /* if this file has been treated in past called, */ |
---|
441 | /* we should compare the old parsing (record in the tmplocallist) */ |
---|
442 | /* and the new one contained in the globliste */ |
---|
443 | if ( Did_filetoparse_treated == 1 ) |
---|
444 | { |
---|
445 | parcours = modulelist; |
---|
446 | while( parcours ) |
---|
447 | { |
---|
448 | Recordtmplocallist(parcours->nom); |
---|
449 | parcours=parcours->suiv; |
---|
450 | } |
---|
451 | /* if the filetoparse has not been treated, we should know */ |
---|
452 | /* the last tabvars indices which has been used */ |
---|
453 | if ((dependglobaloutput=fopen(".dependglobal","r"))!=NULL) |
---|
454 | { |
---|
455 | fscanf(dependglobaloutput,"%d\n",&indicemaxtabvars); |
---|
456 | fclose(dependglobaloutput); |
---|
457 | oldindicemaxtabvars = indicemaxtabvars; |
---|
458 | } |
---|
459 | /* Read the list of available indice */ |
---|
460 | Readthedependavailablefile(); |
---|
461 | /* the old treatement has been recorded in the tmplocallist */ |
---|
462 | /* Now we should compare the old treatement with the new one */ |
---|
463 | /*mazauric for each module */ |
---|
464 | CompareNewparsingandoldone(); |
---|
465 | /* Write the .dependglobal file which contain general informations */ |
---|
466 | /* about globlist */ |
---|
467 | dependglobaloutput = fopen(".dependglobal","w"); |
---|
468 | fprintf(dependglobaloutput,"%d\n",indicemaxtabvars); |
---|
469 | fclose(dependglobaloutput); |
---|
470 | /* Write the list of available indice */ |
---|
471 | Writethedependavailablefile(); |
---|
472 | /* Write the .depend<namefile> file which contain general */ |
---|
473 | /* informations about variable of this file */ |
---|
474 | parcours = modulelist; |
---|
475 | while( parcours ) |
---|
476 | { |
---|
477 | Writethedependfile(parcours->nom,globliste); |
---|
478 | parcours=parcours->suiv; |
---|
479 | } |
---|
480 | /* Write the .dependnbxnby file which contains indices of nbmaillsX, */ |
---|
481 | /* nbmailleY and nbmailleZ */ |
---|
482 | Writethedependnbxnbyfile(); |
---|
483 | } |
---|
484 | /* Write the .dependnbxnby file which contains indices of nbmaillsX, */ |
---|
485 | /* nbmailleY and nbmailleZ */ |
---|
486 | Writethedependnbxnbyfile(); |
---|
487 | /* Write the list of module used in this file */ |
---|
488 | Writethedependlistofmoduleused(NameTamponfile); |
---|
489 | WritedependParameterList(NameTamponfile); |
---|
490 | /******************************************************************************/ |
---|
491 | /* 8- Create files in AGRIF_INC directory */ |
---|
492 | /******************************************************************************/ |
---|
493 | creefichieramr(NameTamponfile); |
---|
494 | return 0; |
---|
495 | } |
---|
496 | #line 497 "y.tab.c" |
---|
497 | #define YYABORT goto yyabort |
---|
498 | #define YYREJECT goto yyabort |
---|
499 | #define YYACCEPT goto yyaccept |
---|
500 | #define YYERROR goto yyerrlab |
---|
501 | int |
---|
502 | yyparse() |
---|
503 | { |
---|
504 | register int yym, yyn, yystate; |
---|
505 | #if YYDEBUG |
---|
506 | register char *yys; |
---|
507 | extern char *getenv(); |
---|
508 | |
---|
509 | if (yys = getenv("YYDEBUG")) |
---|
510 | { |
---|
511 | yyn = *yys; |
---|
512 | if (yyn >= '0' && yyn <= '9') |
---|
513 | yydebug = yyn - '0'; |
---|
514 | } |
---|
515 | #endif |
---|
516 | |
---|
517 | yynerrs = 0; |
---|
518 | yyerrflag = 0; |
---|
519 | yychar = (-1); |
---|
520 | |
---|
521 | yyssp = yyss; |
---|
522 | yyvsp = yyvs; |
---|
523 | *yyssp = yystate = 0; |
---|
524 | |
---|
525 | yyloop: |
---|
526 | if (yyn = yydefred[yystate]) goto yyreduce; |
---|
527 | if (yychar < 0) |
---|
528 | { |
---|
529 | if ((yychar = yylex()) < 0) yychar = 0; |
---|
530 | #if YYDEBUG |
---|
531 | if (yydebug) |
---|
532 | { |
---|
533 | yys = 0; |
---|
534 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
---|
535 | if (!yys) yys = "illegal-symbol"; |
---|
536 | printf("%sdebug: state %d, reading %d (%s)\n", |
---|
537 | YYPREFIX, yystate, yychar, yys); |
---|
538 | } |
---|
539 | #endif |
---|
540 | } |
---|
541 | if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && |
---|
542 | yyn <= YYTABLESIZE && yycheck[yyn] == yychar) |
---|
543 | { |
---|
544 | #if YYDEBUG |
---|
545 | if (yydebug) |
---|
546 | printf("%sdebug: state %d, shifting to state %d\n", |
---|
547 | YYPREFIX, yystate, yytable[yyn]); |
---|
548 | #endif |
---|
549 | if (yyssp >= yyss + yystacksize - 1) |
---|
550 | { |
---|
551 | goto yyoverflow; |
---|
552 | } |
---|
553 | *++yyssp = yystate = yytable[yyn]; |
---|
554 | *++yyvsp = yylval; |
---|
555 | yychar = (-1); |
---|
556 | if (yyerrflag > 0) --yyerrflag; |
---|
557 | goto yyloop; |
---|
558 | } |
---|
559 | if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && |
---|
560 | yyn <= YYTABLESIZE && yycheck[yyn] == yychar) |
---|
561 | { |
---|
562 | yyn = yytable[yyn]; |
---|
563 | goto yyreduce; |
---|
564 | } |
---|
565 | if (yyerrflag) goto yyinrecovery; |
---|
566 | #ifdef lint |
---|
567 | goto yynewerror; |
---|
568 | #endif |
---|
569 | yynewerror: |
---|
570 | yyerror("syntax error"); |
---|
571 | #ifdef lint |
---|
572 | goto yyerrlab; |
---|
573 | #endif |
---|
574 | yyerrlab: |
---|
575 | ++yynerrs; |
---|
576 | yyinrecovery: |
---|
577 | if (yyerrflag < 3) |
---|
578 | { |
---|
579 | yyerrflag = 3; |
---|
580 | for (;;) |
---|
581 | { |
---|
582 | if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && |
---|
583 | yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) |
---|
584 | { |
---|
585 | #if YYDEBUG |
---|
586 | if (yydebug) |
---|
587 | printf("%sdebug: state %d, error recovery shifting\ |
---|
588 | to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); |
---|
589 | #endif |
---|
590 | if (yyssp >= yyss + yystacksize - 1) |
---|
591 | { |
---|
592 | goto yyoverflow; |
---|
593 | } |
---|
594 | *++yyssp = yystate = yytable[yyn]; |
---|
595 | *++yyvsp = yylval; |
---|
596 | goto yyloop; |
---|
597 | } |
---|
598 | else |
---|
599 | { |
---|
600 | #if YYDEBUG |
---|
601 | if (yydebug) |
---|
602 | printf("%sdebug: error recovery discarding state %d\n", |
---|
603 | YYPREFIX, *yyssp); |
---|
604 | #endif |
---|
605 | if (yyssp <= yyss) goto yyabort; |
---|
606 | --yyssp; |
---|
607 | --yyvsp; |
---|
608 | } |
---|
609 | } |
---|
610 | } |
---|
611 | else |
---|
612 | { |
---|
613 | if (yychar == 0) goto yyabort; |
---|
614 | #if YYDEBUG |
---|
615 | if (yydebug) |
---|
616 | { |
---|
617 | yys = 0; |
---|
618 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
---|
619 | if (!yys) yys = "illegal-symbol"; |
---|
620 | printf("%sdebug: state %d, error recovery discards token %d (%s)\n", |
---|
621 | YYPREFIX, yystate, yychar, yys); |
---|
622 | } |
---|
623 | #endif |
---|
624 | yychar = (-1); |
---|
625 | goto yyloop; |
---|
626 | } |
---|
627 | yyreduce: |
---|
628 | #if YYDEBUG |
---|
629 | if (yydebug) |
---|
630 | printf("%sdebug: state %d, reducing by rule %d (%s)\n", |
---|
631 | YYPREFIX, yystate, yyn, yyrule[yyn]); |
---|
632 | #endif |
---|
633 | yym = yylen[yyn]; |
---|
634 | yyval = yyvsp[1-yym]; |
---|
635 | switch (yyn) |
---|
636 | { |
---|
637 | case 4: |
---|
638 | #line 64 "convert.y" |
---|
639 | {initdimprob(1,yyvsp[-1].na,"0","0");} |
---|
640 | break; |
---|
641 | case 5: |
---|
642 | #line 65 "convert.y" |
---|
643 | {initdimprob(2,yyvsp[-3].na, yyvsp[-1].na,"0");} |
---|
644 | break; |
---|
645 | case 6: |
---|
646 | #line 67 "convert.y" |
---|
647 | {initdimprob(3,yyvsp[-5].na, yyvsp[-3].na, yyvsp[-1].na);} |
---|
648 | break; |
---|
649 | case 7: |
---|
650 | #line 68 "convert.y" |
---|
651 | {coeffrafx =yyvsp[-1].ival;} |
---|
652 | break; |
---|
653 | case 8: |
---|
654 | #line 69 "convert.y" |
---|
655 | {regridding=yyvsp[-1].ival;} |
---|
656 | break; |
---|
657 | case 9: |
---|
658 | #line 70 "convert.y" |
---|
659 | {coeffrafy =yyvsp[-1].ival;} |
---|
660 | break; |
---|
661 | case 10: |
---|
662 | #line 71 "convert.y" |
---|
663 | {coeffrafz =yyvsp[-1].ival;} |
---|
664 | break; |
---|
665 | case 11: |
---|
666 | #line 72 "convert.y" |
---|
667 | {coeffraftx=yyvsp[-1].ival;} |
---|
668 | break; |
---|
669 | case 12: |
---|
670 | #line 73 "convert.y" |
---|
671 | {coeffrafty=yyvsp[-1].ival;} |
---|
672 | break; |
---|
673 | case 13: |
---|
674 | #line 74 "convert.y" |
---|
675 | {coeffraftz=yyvsp[-1].ival;} |
---|
676 | break; |
---|
677 | case 14: |
---|
678 | #line 75 "convert.y" |
---|
679 | {Add_ModuleTo_listofmodules(yyvsp[-1].na); |
---|
680 | Addmoduletothelist(yyvsp[-1].na);} |
---|
681 | break; |
---|
682 | case 15: |
---|
683 | #line 77 "convert.y" |
---|
684 | {ajoutenotgriddep(yyvsp[-1].na);} |
---|
685 | break; |
---|
686 | case 16: |
---|
687 | #line 78 "convert.y" |
---|
688 | {userefficiency=1;efficiency=yyvsp[-1].ival;} |
---|
689 | break; |
---|
690 | case 17: |
---|
691 | #line 79 "convert.y" |
---|
692 | {rafmaxx=yyvsp[-1].ival,rafmaxy=yyvsp[-1].ival,rafmaxz=yyvsp[-1].ival;} |
---|
693 | break; |
---|
694 | case 18: |
---|
695 | #line 80 "convert.y" |
---|
696 | {rafmaxx =yyvsp[-1].ival;} |
---|
697 | break; |
---|
698 | case 19: |
---|
699 | #line 81 "convert.y" |
---|
700 | {rafmaxy =yyvsp[-1].ival;} |
---|
701 | break; |
---|
702 | case 20: |
---|
703 | #line 82 "convert.y" |
---|
704 | {rafmaxz =yyvsp[-1].ival;} |
---|
705 | break; |
---|
706 | case 21: |
---|
707 | #line 83 "convert.y" |
---|
708 | {minwidth =yyvsp[-1].ival;} |
---|
709 | break; |
---|
710 | case 22: |
---|
711 | #line 84 "convert.y" |
---|
712 | { |
---|
713 | if (!strcasecmp(yyvsp[-1].na,"FIXED_GRIDS")) |
---|
714 | fixedgrids=1; |
---|
715 | if (!strcasecmp(yyvsp[-1].na,"ONLY_FIXED_GRIDS")) |
---|
716 | onlyfixedgrids=1; |
---|
717 | if (!strcasecmp(yyvsp[-1].na,"DEBUG")) todebug=1; |
---|
718 | } |
---|
719 | break; |
---|
720 | #line 721 "y.tab.c" |
---|
721 | } |
---|
722 | yyssp -= yym; |
---|
723 | yystate = *yyssp; |
---|
724 | yyvsp -= yym; |
---|
725 | yym = yylhs[yyn]; |
---|
726 | if (yystate == 0 && yym == 0) |
---|
727 | { |
---|
728 | #if YYDEBUG |
---|
729 | if (yydebug) |
---|
730 | printf("%sdebug: after reduction, shifting from state 0 to\ |
---|
731 | state %d\n", YYPREFIX, YYFINAL); |
---|
732 | #endif |
---|
733 | yystate = YYFINAL; |
---|
734 | *++yyssp = YYFINAL; |
---|
735 | *++yyvsp = yyval; |
---|
736 | if (yychar < 0) |
---|
737 | { |
---|
738 | if ((yychar = yylex()) < 0) yychar = 0; |
---|
739 | #if YYDEBUG |
---|
740 | if (yydebug) |
---|
741 | { |
---|
742 | yys = 0; |
---|
743 | if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; |
---|
744 | if (!yys) yys = "illegal-symbol"; |
---|
745 | printf("%sdebug: state %d, reading %d (%s)\n", |
---|
746 | YYPREFIX, YYFINAL, yychar, yys); |
---|
747 | } |
---|
748 | #endif |
---|
749 | } |
---|
750 | if (yychar == 0) goto yyaccept; |
---|
751 | goto yyloop; |
---|
752 | } |
---|
753 | if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && |
---|
754 | yyn <= YYTABLESIZE && yycheck[yyn] == yystate) |
---|
755 | yystate = yytable[yyn]; |
---|
756 | else |
---|
757 | yystate = yydgoto[yym]; |
---|
758 | #if YYDEBUG |
---|
759 | if (yydebug) |
---|
760 | printf("%sdebug: after reduction, shifting from state %d \ |
---|
761 | to state %d\n", YYPREFIX, *yyssp, yystate); |
---|
762 | #endif |
---|
763 | if (yyssp >= yyss + yystacksize - 1) |
---|
764 | { |
---|
765 | goto yyoverflow; |
---|
766 | } |
---|
767 | *++yyssp = yystate; |
---|
768 | *++yyvsp = yyval; |
---|
769 | goto yyloop; |
---|
770 | yyoverflow: |
---|
771 | yyerror("yacc stack overflow"); |
---|
772 | yyabort: |
---|
773 | return (1); |
---|
774 | yyaccept: |
---|
775 | return (0); |
---|
776 | } |
---|
777 | #line 2 "convert.yy.c" |
---|
778 | /* A lexical scanner generated by flex */ |
---|
779 | |
---|
780 | /* Scanner skeleton version: |
---|
781 | * $Header$ |
---|
782 | */ |
---|
783 | |
---|
784 | #define FLEX_SCANNER |
---|
785 | #define YY_FLEX_MAJOR_VERSION 2 |
---|
786 | #define YY_FLEX_MINOR_VERSION 5 |
---|
787 | |
---|
788 | #include <stdio.h> |
---|
789 | #include <unistd.h> |
---|
790 | |
---|
791 | |
---|
792 | /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ |
---|
793 | #ifdef c_plusplus |
---|
794 | #ifndef __cplusplus |
---|
795 | #define __cplusplus |
---|
796 | #endif |
---|
797 | #endif |
---|
798 | |
---|
799 | |
---|
800 | #ifdef __cplusplus |
---|
801 | |
---|
802 | #include <stdlib.h> |
---|
803 | |
---|
804 | /* Use prototypes in function declarations. */ |
---|
805 | #define YY_USE_PROTOS |
---|
806 | |
---|
807 | /* The "const" storage-class-modifier is valid. */ |
---|
808 | #define YY_USE_CONST |
---|
809 | |
---|
810 | #else /* ! __cplusplus */ |
---|
811 | |
---|
812 | #if __STDC__ |
---|
813 | |
---|
814 | #define YY_USE_PROTOS |
---|
815 | #define YY_USE_CONST |
---|
816 | |
---|
817 | #endif /* __STDC__ */ |
---|
818 | #endif /* ! __cplusplus */ |
---|
819 | |
---|
820 | #ifdef __TURBOC__ |
---|
821 | #pragma warn -rch |
---|
822 | #pragma warn -use |
---|
823 | #include <io.h> |
---|
824 | #include <stdlib.h> |
---|
825 | #define YY_USE_CONST |
---|
826 | #define YY_USE_PROTOS |
---|
827 | #endif |
---|
828 | |
---|
829 | #ifdef YY_USE_CONST |
---|
830 | #define yyconst const |
---|
831 | #else |
---|
832 | #define yyconst |
---|
833 | #endif |
---|
834 | |
---|
835 | |
---|
836 | #ifdef YY_USE_PROTOS |
---|
837 | #define YY_PROTO(proto) proto |
---|
838 | #else |
---|
839 | #define YY_PROTO(proto) () |
---|
840 | #endif |
---|
841 | |
---|
842 | /* Returned upon end-of-file. */ |
---|
843 | #define YY_NULL 0 |
---|
844 | |
---|
845 | /* Promotes a possibly negative, possibly signed char to an unsigned |
---|
846 | * integer for use as an array index. If the signed char is negative, |
---|
847 | * we want to instead treat it as an 8-bit unsigned char, hence the |
---|
848 | * double cast. |
---|
849 | */ |
---|
850 | #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) |
---|
851 | |
---|
852 | /* Enter a start condition. This macro really ought to take a parameter, |
---|
853 | * but we do it the disgusting crufty way forced on us by the ()-less |
---|
854 | * definition of BEGIN. |
---|
855 | */ |
---|
856 | #define BEGIN yy_start = 1 + 2 * |
---|
857 | |
---|
858 | /* Translate the current start state into a value that can be later handed |
---|
859 | * to BEGIN to return to the state. The YYSTATE alias is for lex |
---|
860 | * compatibility. |
---|
861 | */ |
---|
862 | #define YY_START ((yy_start - 1) / 2) |
---|
863 | #define YYSTATE YY_START |
---|
864 | |
---|
865 | /* Action number for EOF rule of a given start state. */ |
---|
866 | #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) |
---|
867 | |
---|
868 | /* Special action meaning "start processing a new file". */ |
---|
869 | #define YY_NEW_FILE yyrestart( yyin ) |
---|
870 | |
---|
871 | #define YY_END_OF_BUFFER_CHAR 0 |
---|
872 | |
---|
873 | /* Size of default input buffer. */ |
---|
874 | #define YY_BUF_SIZE 16384 |
---|
875 | |
---|
876 | typedef struct yy_buffer_state *YY_BUFFER_STATE; |
---|
877 | |
---|
878 | extern int yyleng; |
---|
879 | extern FILE *yyin, *yyout; |
---|
880 | |
---|
881 | #define EOB_ACT_CONTINUE_SCAN 0 |
---|
882 | #define EOB_ACT_END_OF_FILE 1 |
---|
883 | #define EOB_ACT_LAST_MATCH 2 |
---|
884 | |
---|
885 | /* The funky do-while in the following #define is used to turn the definition |
---|
886 | * int a single C statement (which needs a semi-colon terminator). This |
---|
887 | * avoids problems with code like: |
---|
888 | * |
---|
889 | * if ( condition_holds ) |
---|
890 | * yyless( 5 ); |
---|
891 | * else |
---|
892 | * do_something_else(); |
---|
893 | * |
---|
894 | * Prior to using the do-while the compiler would get upset at the |
---|
895 | * "else" because it interpreted the "if" statement as being all |
---|
896 | * done when it reached the ';' after the yyless() call. |
---|
897 | */ |
---|
898 | |
---|
899 | /* Return all but the first 'n' matched characters back to the input stream. */ |
---|
900 | |
---|
901 | #define yyless(n) \ |
---|
902 | do \ |
---|
903 | { \ |
---|
904 | /* Undo effects of setting up yytext. */ \ |
---|
905 | *yy_cp = yy_hold_char; \ |
---|
906 | YY_RESTORE_YY_MORE_OFFSET \ |
---|
907 | yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ |
---|
908 | YY_DO_BEFORE_ACTION; /* set up yytext again */ \ |
---|
909 | } \ |
---|
910 | while ( 0 ) |
---|
911 | |
---|
912 | #define unput(c) yyunput( c, yytext_ptr ) |
---|
913 | |
---|
914 | /* The following is because we cannot portably get our hands on size_t |
---|
915 | * (without autoconf's help, which isn't available because we want |
---|
916 | * flex-generated scanners to compile on their own). |
---|
917 | */ |
---|
918 | typedef unsigned int yy_size_t; |
---|
919 | |
---|
920 | |
---|
921 | struct yy_buffer_state |
---|
922 | { |
---|
923 | FILE *yy_input_file; |
---|
924 | |
---|
925 | char *yy_ch_buf; /* input buffer */ |
---|
926 | char *yy_buf_pos; /* current position in input buffer */ |
---|
927 | |
---|
928 | /* Size of input buffer in bytes, not including room for EOB |
---|
929 | * characters. |
---|
930 | */ |
---|
931 | yy_size_t yy_buf_size; |
---|
932 | |
---|
933 | /* Number of characters read into yy_ch_buf, not including EOB |
---|
934 | * characters. |
---|
935 | */ |
---|
936 | int yy_n_chars; |
---|
937 | |
---|
938 | /* Whether we "own" the buffer - i.e., we know we created it, |
---|
939 | * and can realloc() it to grow it, and should free() it to |
---|
940 | * delete it. |
---|
941 | */ |
---|
942 | int yy_is_our_buffer; |
---|
943 | |
---|
944 | /* Whether this is an "interactive" input source; if so, and |
---|
945 | * if we're using stdio for input, then we want to use getc() |
---|
946 | * instead of fread(), to make sure we stop fetching input after |
---|
947 | * each newline. |
---|
948 | */ |
---|
949 | int yy_is_interactive; |
---|
950 | |
---|
951 | /* Whether we're considered to be at the beginning of a line. |
---|
952 | * If so, '^' rules will be active on the next match, otherwise |
---|
953 | * not. |
---|
954 | */ |
---|
955 | int yy_at_bol; |
---|
956 | |
---|
957 | /* Whether to try to fill the input buffer when we reach the |
---|
958 | * end of it. |
---|
959 | */ |
---|
960 | int yy_fill_buffer; |
---|
961 | |
---|
962 | int yy_buffer_status; |
---|
963 | #define YY_BUFFER_NEW 0 |
---|
964 | #define YY_BUFFER_NORMAL 1 |
---|
965 | /* When an EOF's been seen but there's still some text to process |
---|
966 | * then we mark the buffer as YY_EOF_PENDING, to indicate that we |
---|
967 | * shouldn't try reading from the input source any more. We might |
---|
968 | * still have a bunch of tokens to match, though, because of |
---|
969 | * possible backing-up. |
---|
970 | * |
---|
971 | * When we actually see the EOF, we change the status to "new" |
---|
972 | * (via yyrestart()), so that the user can continue scanning by |
---|
973 | * just pointing yyin at a new input file. |
---|
974 | */ |
---|
975 | #define YY_BUFFER_EOF_PENDING 2 |
---|
976 | }; |
---|
977 | |
---|
978 | static YY_BUFFER_STATE yy_current_buffer = 0; |
---|
979 | |
---|
980 | /* We provide macros for accessing buffer states in case in the |
---|
981 | * future we want to put the buffer states in a more general |
---|
982 | * "scanner state". |
---|
983 | */ |
---|
984 | #define YY_CURRENT_BUFFER yy_current_buffer |
---|
985 | |
---|
986 | |
---|
987 | /* yy_hold_char holds the character lost when yytext is formed. */ |
---|
988 | static char yy_hold_char; |
---|
989 | |
---|
990 | static int yy_n_chars; /* number of characters read into yy_ch_buf */ |
---|
991 | |
---|
992 | |
---|
993 | int yyleng; |
---|
994 | |
---|
995 | /* Points to current character in buffer. */ |
---|
996 | static char *yy_c_buf_p = (char *) 0; |
---|
997 | static int yy_init = 1; /* whether we need to initialize */ |
---|
998 | static int yy_start = 0; /* start state number */ |
---|
999 | |
---|
1000 | /* Flag which is used to allow yywrap()'s to do buffer switches |
---|
1001 | * instead of setting up a fresh yyin. A bit of a hack ... |
---|
1002 | */ |
---|
1003 | static int yy_did_buffer_switch_on_eof; |
---|
1004 | |
---|
1005 | void yyrestart YY_PROTO(( FILE *input_file )); |
---|
1006 | |
---|
1007 | void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); |
---|
1008 | void yy_load_buffer_state YY_PROTO(( void )); |
---|
1009 | YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); |
---|
1010 | void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); |
---|
1011 | void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); |
---|
1012 | void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); |
---|
1013 | #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) |
---|
1014 | |
---|
1015 | YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); |
---|
1016 | YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); |
---|
1017 | YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); |
---|
1018 | |
---|
1019 | static void *yy_flex_alloc YY_PROTO(( yy_size_t )); |
---|
1020 | static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); |
---|
1021 | static void yy_flex_free YY_PROTO(( void * )); |
---|
1022 | |
---|
1023 | #define yy_new_buffer yy_create_buffer |
---|
1024 | |
---|
1025 | #define yy_set_interactive(is_interactive) \ |
---|
1026 | { \ |
---|
1027 | if ( ! yy_current_buffer ) \ |
---|
1028 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ |
---|
1029 | yy_current_buffer->yy_is_interactive = is_interactive; \ |
---|
1030 | } |
---|
1031 | |
---|
1032 | #define yy_set_bol(at_bol) \ |
---|
1033 | { \ |
---|
1034 | if ( ! yy_current_buffer ) \ |
---|
1035 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ |
---|
1036 | yy_current_buffer->yy_at_bol = at_bol; \ |
---|
1037 | } |
---|
1038 | |
---|
1039 | #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) |
---|
1040 | |
---|
1041 | typedef unsigned char YY_CHAR; |
---|
1042 | FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; |
---|
1043 | typedef int yy_state_type; |
---|
1044 | extern char *yytext; |
---|
1045 | #define yytext_ptr yytext |
---|
1046 | |
---|
1047 | static yy_state_type yy_get_previous_state YY_PROTO(( void )); |
---|
1048 | static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); |
---|
1049 | static int yy_get_next_buffer YY_PROTO(( void )); |
---|
1050 | static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); |
---|
1051 | |
---|
1052 | /* Done after the current pattern has been matched and before the |
---|
1053 | * corresponding action - sets up yytext. |
---|
1054 | */ |
---|
1055 | #define YY_DO_BEFORE_ACTION \ |
---|
1056 | yytext_ptr = yy_bp; \ |
---|
1057 | yyleng = (int) (yy_cp - yy_bp); \ |
---|
1058 | yy_hold_char = *yy_cp; \ |
---|
1059 | *yy_cp = '\0'; \ |
---|
1060 | yy_c_buf_p = yy_cp; |
---|
1061 | |
---|
1062 | #define YY_NUM_RULES 27 |
---|
1063 | #define YY_END_OF_BUFFER 28 |
---|
1064 | static yyconst short int yy_accept[133] = |
---|
1065 | { 0, |
---|
1066 | 0, 0, 0, 0, 28, 27, 26, 25, 27, 24, |
---|
1067 | 23, 23, 23, 23, 24, 22, 22, 22, 22, 22, |
---|
1068 | 22, 22, 22, 22, 22, 22, 26, 0, 17, 23, |
---|
1069 | 21, 18, 0, 22, 22, 22, 22, 22, 22, 22, |
---|
1070 | 22, 22, 22, 22, 22, 19, 22, 22, 22, 22, |
---|
1071 | 22, 22, 22, 22, 22, 22, 15, 19, 22, 22, |
---|
1072 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 20, |
---|
1073 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, |
---|
1074 | 22, 22, 22, 22, 22, 10, 22, 22, 22, 22, |
---|
1075 | 22, 22, 22, 22, 11, 12, 13, 22, 22, 22, |
---|
1076 | |
---|
1077 | 22, 16, 22, 22, 22, 22, 22, 2, 3, 4, |
---|
1078 | 22, 22, 22, 22, 22, 22, 5, 6, 7, 9, |
---|
1079 | 22, 14, 22, 22, 1, 22, 8, 22, 22, 22, |
---|
1080 | 22, 0 |
---|
1081 | } ; |
---|
1082 | |
---|
1083 | static yyconst int yy_ec[256] = |
---|
1084 | { 0, |
---|
1085 | 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, |
---|
1086 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1087 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1088 | 1, 2, 1, 1, 1, 1, 4, 1, 1, 5, |
---|
1089 | 6, 1, 1, 7, 1, 8, 1, 9, 10, 11, |
---|
1090 | 12, 9, 9, 9, 9, 9, 9, 13, 14, 1, |
---|
1091 | 1, 1, 1, 1, 18, 19, 20, 21, 22, 23, |
---|
1092 | 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, |
---|
1093 | 27, 33, 34, 35, 36, 27, 37, 38, 39, 40, |
---|
1094 | 15, 1, 16, 1, 17, 1, 18, 19, 20, 21, |
---|
1095 | |
---|
1096 | 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, |
---|
1097 | 31, 32, 27, 33, 34, 35, 36, 27, 37, 38, |
---|
1098 | 39, 40, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1099 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1100 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1101 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1102 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1103 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1104 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1105 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1106 | |
---|
1107 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1108 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1109 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1110 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1111 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1112 | 1, 1, 1, 1, 1 |
---|
1113 | } ; |
---|
1114 | |
---|
1115 | static yyconst int yy_meta[41] = |
---|
1116 | { 0, |
---|
1117 | 1, 1, 2, 1, 1, 1, 1, 3, 4, 4, |
---|
1118 | 4, 4, 1, 1, 1, 1, 5, 5, 5, 5, |
---|
1119 | 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, |
---|
1120 | 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 |
---|
1121 | } ; |
---|
1122 | |
---|
1123 | static yyconst short int yy_base[137] = |
---|
1124 | { 0, |
---|
1125 | 0, 0, 0, 0, 284, 285, 281, 285, 278, 285, |
---|
1126 | 32, 36, 40, 44, 268, 272, 50, 51, 52, 54, |
---|
1127 | 56, 55, 58, 59, 61, 60, 277, 274, 273, 80, |
---|
1128 | 285, 285, 0, 268, 62, 66, 64, 63, 68, 70, |
---|
1129 | 85, 87, 88, 91, 92, 0, 89, 94, 95, 96, |
---|
1130 | 98, 99, 100, 101, 102, 108, 267, 0, 109, 114, |
---|
1131 | 116, 119, 117, 118, 120, 121, 126, 134, 125, 266, |
---|
1132 | 137, 138, 140, 139, 141, 144, 145, 146, 148, 149, |
---|
1133 | 151, 154, 158, 160, 161, 164, 166, 168, 169, 172, |
---|
1134 | 170, 173, 174, 176, 265, 264, 263, 180, 182, 188, |
---|
1135 | |
---|
1136 | 185, 262, 192, 193, 177, 199, 201, 253, 250, 249, |
---|
1137 | 208, 202, 210, 211, 216, 219, 248, 247, 246, 242, |
---|
1138 | 217, 240, 218, 223, 230, 222, 229, 220, 226, 228, |
---|
1139 | 225, 285, 259, 262, 193, 264 |
---|
1140 | } ; |
---|
1141 | |
---|
1142 | static yyconst short int yy_def[137] = |
---|
1143 | { 0, |
---|
1144 | 132, 1, 1, 1, 132, 132, 132, 132, 133, 132, |
---|
1145 | 132, 132, 132, 132, 132, 134, 134, 134, 134, 134, |
---|
1146 | 134, 134, 134, 134, 134, 134, 132, 133, 133, 132, |
---|
1147 | 132, 132, 135, 134, 134, 134, 134, 134, 134, 134, |
---|
1148 | 134, 134, 134, 134, 134, 136, 134, 134, 134, 134, |
---|
1149 | 134, 134, 134, 134, 134, 134, 134, 136, 134, 134, |
---|
1150 | 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, |
---|
1151 | 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, |
---|
1152 | 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, |
---|
1153 | 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, |
---|
1154 | |
---|
1155 | 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, |
---|
1156 | 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, |
---|
1157 | 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, |
---|
1158 | 134, 0, 132, 132, 132, 132 |
---|
1159 | } ; |
---|
1160 | |
---|
1161 | static yyconst short int yy_nxt[326] = |
---|
1162 | { 0, |
---|
1163 | 6, 7, 8, 9, 10, 10, 10, 6, 11, 12, |
---|
1164 | 13, 14, 15, 10, 10, 10, 16, 16, 16, 17, |
---|
1165 | 18, 19, 20, 16, 16, 16, 16, 16, 21, 22, |
---|
1166 | 23, 24, 25, 16, 16, 26, 16, 16, 16, 16, |
---|
1167 | 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, |
---|
1168 | 30, 30, 30, 30, 30, 30, 31, 33, 33, 33, |
---|
1169 | 31, 33, 33, 33, 31, 33, 33, 33, 33, 33, |
---|
1170 | 33, 33, 36, 33, 37, 33, 42, 33, 43, 38, |
---|
1171 | 35, 39, 44, 47, 48, 40, 49, 41, 30, 30, |
---|
1172 | 30, 30, 33, 45, 33, 33, 33, 51, 33, 33, |
---|
1173 | |
---|
1174 | 50, 33, 33, 33, 52, 33, 33, 33, 33, 33, |
---|
1175 | 55, 59, 53, 57, 56, 33, 33, 62, 66, 54, |
---|
1176 | 61, 33, 64, 33, 33, 33, 33, 33, 33, 60, |
---|
1177 | 67, 69, 33, 33, 63, 71, 75, 70, 65, 72, |
---|
1178 | 68, 33, 73, 77, 33, 33, 33, 33, 33, 76, |
---|
1179 | 74, 33, 33, 33, 81, 33, 33, 79, 33, 78, |
---|
1180 | 82, 33, 80, 84, 83, 33, 87, 33, 33, 88, |
---|
1181 | 89, 33, 85, 33, 90, 33, 33, 33, 92, 33, |
---|
1182 | 33, 33, 86, 33, 33, 93, 98, 33, 91, 33, |
---|
1183 | 99, 94, 33, 103, 102, 33, 105, 46, 100, 33, |
---|
1184 | |
---|
1185 | 33, 95, 96, 97, 101, 106, 33, 111, 33, 33, |
---|
1186 | 112, 104, 115, 113, 114, 33, 107, 33, 33, 108, |
---|
1187 | 109, 110, 121, 33, 33, 33, 33, 33, 116, 33, |
---|
1188 | 33, 123, 33, 33, 126, 33, 33, 33, 117, 118, |
---|
1189 | 119, 122, 125, 124, 127, 128, 120, 33, 131, 33, |
---|
1190 | 70, 130, 129, 33, 33, 33, 33, 33, 70, 28, |
---|
1191 | 33, 28, 28, 28, 34, 34, 34, 58, 58, 33, |
---|
1192 | 33, 33, 33, 33, 33, 33, 29, 29, 27, 33, |
---|
1193 | 32, 29, 27, 132, 5, 132, 132, 132, 132, 132, |
---|
1194 | 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, |
---|
1195 | |
---|
1196 | 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, |
---|
1197 | 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, |
---|
1198 | 132, 132, 132, 132, 132 |
---|
1199 | } ; |
---|
1200 | |
---|
1201 | static yyconst short int yy_chk[326] = |
---|
1202 | { 0, |
---|
1203 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1204 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1205 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1206 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
---|
1207 | 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, |
---|
1208 | 13, 13, 14, 14, 14, 14, 12, 17, 18, 19, |
---|
1209 | 13, 20, 22, 21, 14, 23, 24, 26, 25, 35, |
---|
1210 | 38, 37, 18, 36, 19, 39, 24, 40, 25, 20, |
---|
1211 | 17, 21, 25, 35, 36, 22, 37, 23, 30, 30, |
---|
1212 | 30, 30, 41, 26, 42, 43, 47, 39, 44, 45, |
---|
1213 | |
---|
1214 | 38, 48, 49, 50, 40, 51, 52, 53, 54, 55, |
---|
1215 | 43, 47, 41, 45, 44, 56, 59, 50, 54, 42, |
---|
1216 | 49, 60, 52, 61, 63, 64, 62, 65, 66, 48, |
---|
1217 | 55, 59, 69, 67, 51, 61, 65, 60, 53, 62, |
---|
1218 | 56, 68, 63, 67, 71, 72, 74, 73, 75, 66, |
---|
1219 | 64, 76, 77, 78, 72, 79, 80, 69, 81, 68, |
---|
1220 | 73, 82, 71, 75, 74, 83, 78, 84, 85, 79, |
---|
1221 | 80, 86, 76, 87, 81, 88, 89, 91, 83, 90, |
---|
1222 | 92, 93, 77, 94, 105, 84, 87, 98, 82, 99, |
---|
1223 | 88, 85, 101, 92, 91, 100, 94, 135, 89, 103, |
---|
1224 | |
---|
1225 | 104, 86, 86, 86, 90, 98, 106, 100, 107, 112, |
---|
1226 | 101, 93, 105, 103, 104, 111, 99, 113, 114, 99, |
---|
1227 | 99, 99, 112, 115, 121, 123, 116, 128, 106, 126, |
---|
1228 | 124, 114, 131, 129, 123, 130, 127, 125, 107, 107, |
---|
1229 | 107, 113, 116, 115, 124, 126, 111, 122, 130, 120, |
---|
1230 | 121, 129, 128, 119, 118, 117, 110, 109, 131, 133, |
---|
1231 | 108, 133, 133, 133, 134, 134, 134, 136, 136, 102, |
---|
1232 | 97, 96, 95, 70, 57, 34, 29, 28, 27, 16, |
---|
1233 | 15, 9, 7, 5, 132, 132, 132, 132, 132, 132, |
---|
1234 | 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, |
---|
1235 | |
---|
1236 | 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, |
---|
1237 | 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, |
---|
1238 | 132, 132, 132, 132, 132 |
---|
1239 | } ; |
---|
1240 | |
---|
1241 | static yy_state_type yy_last_accepting_state; |
---|
1242 | static char *yy_last_accepting_cpos; |
---|
1243 | |
---|
1244 | /* The intent behind this definition is that it'll catch |
---|
1245 | * any uses of REJECT which flex missed. |
---|
1246 | */ |
---|
1247 | #define REJECT reject_used_but_not_detected |
---|
1248 | #define yymore() yymore_used_but_not_detected |
---|
1249 | #define YY_MORE_ADJ 0 |
---|
1250 | #define YY_RESTORE_YY_MORE_OFFSET |
---|
1251 | char *yytext; |
---|
1252 | #line 1 "convert.lex" |
---|
1253 | #define INITIAL 0 |
---|
1254 | /******************************************************************************/ |
---|
1255 | /* */ |
---|
1256 | /* CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran) */ |
---|
1257 | /* */ |
---|
1258 | /* Copyright (C) 2005 Laurent Debreu (Laurent.Debreu@imag.fr) */ |
---|
1259 | /* Cyril Mazauric (Cyril.Mazauric@imag.fr) */ |
---|
1260 | /* */ |
---|
1261 | /* This program is free software; you can redistribute it and/or modify */ |
---|
1262 | /* it */ |
---|
1263 | /* */ |
---|
1264 | /* This program is distributed in the hope that it will be useful, */ |
---|
1265 | /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
---|
1266 | /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ |
---|
1267 | /* GNU General Public License for more details. */ |
---|
1268 | /* */ |
---|
1269 | /******************************************************************************/ |
---|
1270 | #define character 1 |
---|
1271 | |
---|
1272 | #line 19 "convert.lex" |
---|
1273 | #include <math.h> |
---|
1274 | #include <stdlib.h> |
---|
1275 | #include <string.h> |
---|
1276 | int line_num=1; |
---|
1277 | extern FILE * yyin; |
---|
1278 | #define MAX_INCLUDE_DEPTH 30 |
---|
1279 | YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; |
---|
1280 | #line 505 "convert.yy.c" |
---|
1281 | |
---|
1282 | /* Macros after this point can all be overridden by user definitions in |
---|
1283 | * section 1. |
---|
1284 | */ |
---|
1285 | |
---|
1286 | #ifndef YY_SKIP_YYWRAP |
---|
1287 | #ifdef __cplusplus |
---|
1288 | extern "C" int yywrap YY_PROTO(( void )); |
---|
1289 | #else |
---|
1290 | extern int yywrap YY_PROTO(( void )); |
---|
1291 | #endif |
---|
1292 | #endif |
---|
1293 | |
---|
1294 | #ifndef YY_NO_UNPUT |
---|
1295 | static void yyunput YY_PROTO(( int c, char *buf_ptr )); |
---|
1296 | #endif |
---|
1297 | |
---|
1298 | #ifndef yytext_ptr |
---|
1299 | static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); |
---|
1300 | #endif |
---|
1301 | |
---|
1302 | #ifdef YY_NEED_STRLEN |
---|
1303 | static int yy_flex_strlen YY_PROTO(( yyconst char * )); |
---|
1304 | #endif |
---|
1305 | |
---|
1306 | #ifndef YY_NO_INPUT |
---|
1307 | #ifdef __cplusplus |
---|
1308 | static int yyinput YY_PROTO(( void )); |
---|
1309 | #else |
---|
1310 | static int input YY_PROTO(( void )); |
---|
1311 | #endif |
---|
1312 | #endif |
---|
1313 | |
---|
1314 | #if YY_STACK_USED |
---|
1315 | static int yy_start_stack_ptr = 0; |
---|
1316 | static int yy_start_stack_depth = 0; |
---|
1317 | static int *yy_start_stack = 0; |
---|
1318 | #ifndef YY_NO_PUSH_STATE |
---|
1319 | static void yy_push_state YY_PROTO(( int new_state )); |
---|
1320 | #endif |
---|
1321 | #ifndef YY_NO_POP_STATE |
---|
1322 | static void yy_pop_state YY_PROTO(( void )); |
---|
1323 | #endif |
---|
1324 | #ifndef YY_NO_TOP_STATE |
---|
1325 | static int yy_top_state YY_PROTO(( void )); |
---|
1326 | #endif |
---|
1327 | |
---|
1328 | #else |
---|
1329 | #define YY_NO_PUSH_STATE 1 |
---|
1330 | #define YY_NO_POP_STATE 1 |
---|
1331 | #define YY_NO_TOP_STATE 1 |
---|
1332 | #endif |
---|
1333 | |
---|
1334 | #ifdef YY_MALLOC_DECL |
---|
1335 | YY_MALLOC_DECL |
---|
1336 | #else |
---|
1337 | #if __STDC__ |
---|
1338 | #ifndef __cplusplus |
---|
1339 | #include <stdlib.h> |
---|
1340 | #endif |
---|
1341 | #else |
---|
1342 | /* Just try to get by without declaring the routines. This will fail |
---|
1343 | * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) |
---|
1344 | * or sizeof(void*) != sizeof(int). |
---|
1345 | */ |
---|
1346 | #endif |
---|
1347 | #endif |
---|
1348 | |
---|
1349 | /* Amount of stuff to slurp up with each read. */ |
---|
1350 | #ifndef YY_READ_BUF_SIZE |
---|
1351 | #define YY_READ_BUF_SIZE 8192 |
---|
1352 | #endif |
---|
1353 | |
---|
1354 | /* Copy whatever the last rule matched to the standard output. */ |
---|
1355 | |
---|
1356 | #ifndef ECHO |
---|
1357 | /* This used to be an fputs(), but since the string might contain NUL's, |
---|
1358 | * we now use fwrite(). |
---|
1359 | */ |
---|
1360 | #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) |
---|
1361 | #endif |
---|
1362 | |
---|
1363 | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
---|
1364 | * is returned in "result". |
---|
1365 | */ |
---|
1366 | #ifndef YY_INPUT |
---|
1367 | #define YY_INPUT(buf,result,max_size) \ |
---|
1368 | if ( yy_current_buffer->yy_is_interactive ) \ |
---|
1369 | { \ |
---|
1370 | int c = '*', n; \ |
---|
1371 | for ( n = 0; n < max_size && \ |
---|
1372 | (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ |
---|
1373 | buf[n] = (char) c; \ |
---|
1374 | if ( c == '\n' ) \ |
---|
1375 | buf[n++] = (char) c; \ |
---|
1376 | if ( c == EOF && ferror( yyin ) ) \ |
---|
1377 | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
---|
1378 | result = n; \ |
---|
1379 | } \ |
---|
1380 | else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ |
---|
1381 | && ferror( yyin ) ) \ |
---|
1382 | YY_FATAL_ERROR( "input in flex scanner failed" ); |
---|
1383 | #endif |
---|
1384 | |
---|
1385 | /* No semi-colon after return; correct usage is to write "yyterminate();" - |
---|
1386 | * we don't want an extra ';' after the "return" because that will cause |
---|
1387 | * some compilers to complain about unreachable statements. |
---|
1388 | */ |
---|
1389 | #ifndef yyterminate |
---|
1390 | #define yyterminate() return YY_NULL |
---|
1391 | #endif |
---|
1392 | |
---|
1393 | /* Number of entries by which start-condition stack grows. */ |
---|
1394 | #ifndef YY_START_STACK_INCR |
---|
1395 | #define YY_START_STACK_INCR 25 |
---|
1396 | #endif |
---|
1397 | |
---|
1398 | /* Report a fatal error. */ |
---|
1399 | #ifndef YY_FATAL_ERROR |
---|
1400 | #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) |
---|
1401 | #endif |
---|
1402 | |
---|
1403 | /* Default declaration of generated scanner - a define so the user can |
---|
1404 | * easily add parameters. |
---|
1405 | */ |
---|
1406 | #ifndef YY_DECL |
---|
1407 | #define YY_DECL int yylex YY_PROTO(( void )) |
---|
1408 | #endif |
---|
1409 | |
---|
1410 | /* Code executed at the beginning of each rule, after yytext and yyleng |
---|
1411 | * have been set up. |
---|
1412 | */ |
---|
1413 | #ifndef YY_USER_ACTION |
---|
1414 | #define YY_USER_ACTION |
---|
1415 | #endif |
---|
1416 | |
---|
1417 | /* Code executed at the end of each rule. */ |
---|
1418 | #ifndef YY_BREAK |
---|
1419 | #define YY_BREAK break; |
---|
1420 | #endif |
---|
1421 | |
---|
1422 | #define YY_RULE_SETUP \ |
---|
1423 | YY_USER_ACTION |
---|
1424 | |
---|
1425 | YY_DECL |
---|
1426 | { |
---|
1427 | register yy_state_type yy_current_state; |
---|
1428 | register char *yy_cp, *yy_bp; |
---|
1429 | register int yy_act; |
---|
1430 | |
---|
1431 | #line 39 "convert.lex" |
---|
1432 | |
---|
1433 | #line 658 "convert.yy.c" |
---|
1434 | |
---|
1435 | if ( yy_init ) |
---|
1436 | { |
---|
1437 | yy_init = 0; |
---|
1438 | |
---|
1439 | #ifdef YY_USER_INIT |
---|
1440 | YY_USER_INIT; |
---|
1441 | #endif |
---|
1442 | |
---|
1443 | if ( ! yy_start ) |
---|
1444 | yy_start = 1; /* first start state */ |
---|
1445 | |
---|
1446 | if ( ! yyin ) |
---|
1447 | yyin = stdin; |
---|
1448 | |
---|
1449 | if ( ! yyout ) |
---|
1450 | yyout = stdout; |
---|
1451 | |
---|
1452 | if ( ! yy_current_buffer ) |
---|
1453 | yy_current_buffer = |
---|
1454 | yy_create_buffer( yyin, YY_BUF_SIZE ); |
---|
1455 | |
---|
1456 | yy_load_buffer_state(); |
---|
1457 | } |
---|
1458 | |
---|
1459 | while ( 1 ) /* loops until end-of-file is reached */ |
---|
1460 | { |
---|
1461 | yy_cp = yy_c_buf_p; |
---|
1462 | |
---|
1463 | /* Support of yytext. */ |
---|
1464 | *yy_cp = yy_hold_char; |
---|
1465 | |
---|
1466 | /* yy_bp points to the position in yy_ch_buf of the start of |
---|
1467 | * the current run. |
---|
1468 | */ |
---|
1469 | yy_bp = yy_cp; |
---|
1470 | |
---|
1471 | yy_current_state = yy_start; |
---|
1472 | yy_match: |
---|
1473 | do |
---|
1474 | { |
---|
1475 | register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; |
---|
1476 | if ( yy_accept[yy_current_state] ) |
---|
1477 | { |
---|
1478 | yy_last_accepting_state = yy_current_state; |
---|
1479 | yy_last_accepting_cpos = yy_cp; |
---|
1480 | } |
---|
1481 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
1482 | { |
---|
1483 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
1484 | if ( yy_current_state >= 133 ) |
---|
1485 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
1486 | } |
---|
1487 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
1488 | ++yy_cp; |
---|
1489 | } |
---|
1490 | while ( yy_base[yy_current_state] != 285 ); |
---|
1491 | |
---|
1492 | yy_find_action: |
---|
1493 | yy_act = yy_accept[yy_current_state]; |
---|
1494 | if ( yy_act == 0 ) |
---|
1495 | { /* have to back up */ |
---|
1496 | yy_cp = yy_last_accepting_cpos; |
---|
1497 | yy_current_state = yy_last_accepting_state; |
---|
1498 | yy_act = yy_accept[yy_current_state]; |
---|
1499 | } |
---|
1500 | |
---|
1501 | YY_DO_BEFORE_ACTION; |
---|
1502 | |
---|
1503 | |
---|
1504 | do_action: /* This label is used only to access EOF actions. */ |
---|
1505 | |
---|
1506 | |
---|
1507 | switch ( yy_act ) |
---|
1508 | { /* beginning of action switch */ |
---|
1509 | case 0: /* must back up */ |
---|
1510 | /* undo the effects of YY_DO_BEFORE_ACTION */ |
---|
1511 | *yy_cp = yy_hold_char; |
---|
1512 | yy_cp = yy_last_accepting_cpos; |
---|
1513 | yy_current_state = yy_last_accepting_state; |
---|
1514 | goto yy_find_action; |
---|
1515 | |
---|
1516 | case 1: |
---|
1517 | YY_RULE_SETUP |
---|
1518 | #line 40 "convert.lex" |
---|
1519 | return TOK_REGRIDDING; /* period of regridding */ |
---|
1520 | YY_BREAK |
---|
1521 | case 2: |
---|
1522 | YY_RULE_SETUP |
---|
1523 | #line 41 "convert.lex" |
---|
1524 | return TOK_COEFFRAFX; /* space refinement in the x direction */ |
---|
1525 | YY_BREAK |
---|
1526 | case 3: |
---|
1527 | YY_RULE_SETUP |
---|
1528 | #line 42 "convert.lex" |
---|
1529 | return TOK_COEFFRAFY; /* space refinement in the y direction */ |
---|
1530 | YY_BREAK |
---|
1531 | case 4: |
---|
1532 | YY_RULE_SETUP |
---|
1533 | #line 43 "convert.lex" |
---|
1534 | return TOK_COEFFRAFZ; /* space refinement in the z direction */ |
---|
1535 | YY_BREAK |
---|
1536 | case 5: |
---|
1537 | YY_RULE_SETUP |
---|
1538 | #line 44 "convert.lex" |
---|
1539 | return TOK_COEFFRAFTX; /* time refinement in the x direction */ |
---|
1540 | YY_BREAK |
---|
1541 | case 6: |
---|
1542 | YY_RULE_SETUP |
---|
1543 | #line 45 "convert.lex" |
---|
1544 | return TOK_COEFFRAFTY; /* time refinement in the y direction */ |
---|
1545 | YY_BREAK |
---|
1546 | case 7: |
---|
1547 | YY_RULE_SETUP |
---|
1548 | #line 46 "convert.lex" |
---|
1549 | return TOK_COEFFRAFTZ; /* time refinement in the z direction */ |
---|
1550 | YY_BREAK |
---|
1551 | case 8: |
---|
1552 | YY_RULE_SETUP |
---|
1553 | #line 47 "convert.lex" |
---|
1554 | return TOK_MODULEMAIN; /* name of the module */ |
---|
1555 | YY_BREAK |
---|
1556 | case 9: |
---|
1557 | YY_RULE_SETUP |
---|
1558 | #line 48 "convert.lex" |
---|
1559 | return TOK_EFFICIENCY; /* efficiency for the adaptive refinement */ |
---|
1560 | YY_BREAK |
---|
1561 | case 10: |
---|
1562 | YY_RULE_SETUP |
---|
1563 | #line 49 "convert.lex" |
---|
1564 | return TOK_RAFMAX; /* minimum size in all directions */ |
---|
1565 | YY_BREAK |
---|
1566 | case 11: |
---|
1567 | YY_RULE_SETUP |
---|
1568 | #line 50 "convert.lex" |
---|
1569 | return TOK_RAFMAXX; /* minimum size in x direction */ |
---|
1570 | YY_BREAK |
---|
1571 | case 12: |
---|
1572 | YY_RULE_SETUP |
---|
1573 | #line 51 "convert.lex" |
---|
1574 | return TOK_RAFMAXY; /* minimum size in y direction */ |
---|
1575 | YY_BREAK |
---|
1576 | case 13: |
---|
1577 | YY_RULE_SETUP |
---|
1578 | #line 52 "convert.lex" |
---|
1579 | return TOK_RAFMAXZ; /* minimum size in z direction */ |
---|
1580 | YY_BREAK |
---|
1581 | case 14: |
---|
1582 | YY_RULE_SETUP |
---|
1583 | #line 53 "convert.lex" |
---|
1584 | return TOK_NOTGRIDDEP; /* variable which are not grid dependent */ |
---|
1585 | YY_BREAK |
---|
1586 | case 15: |
---|
1587 | YY_RULE_SETUP |
---|
1588 | #line 54 "convert.lex" |
---|
1589 | return TOK_USE; |
---|
1590 | YY_BREAK |
---|
1591 | case 16: |
---|
1592 | YY_RULE_SETUP |
---|
1593 | #line 55 "convert.lex" |
---|
1594 | return TOK_MINWIDTH; /* minimum width of rectangles for the */ |
---|
1595 | YY_BREAK |
---|
1596 | /* adaptive refinement */ |
---|
1597 | case 17: |
---|
1598 | YY_RULE_SETUP |
---|
1599 | #line 57 "convert.lex" |
---|
1600 | {} |
---|
1601 | YY_BREAK |
---|
1602 | case 18: |
---|
1603 | YY_RULE_SETUP |
---|
1604 | #line 58 "convert.lex" |
---|
1605 | return TOK_SEP; |
---|
1606 | YY_BREAK |
---|
1607 | case 19: |
---|
1608 | YY_RULE_SETUP |
---|
1609 | #line 59 "convert.lex" |
---|
1610 | {strcpy(yylval.na,yytext); return TOK_FILENAME;} |
---|
1611 | YY_BREAK |
---|
1612 | case 20: |
---|
1613 | YY_RULE_SETUP |
---|
1614 | #line 60 "convert.lex" |
---|
1615 | {strcpy(yylval.na,yytext); return TOK_USEITEM;} |
---|
1616 | YY_BREAK |
---|
1617 | case 21: |
---|
1618 | YY_RULE_SETUP |
---|
1619 | #line 61 "convert.lex" |
---|
1620 | {strcpy(yylval.na,yytext); return TOK_PROBTYPE;} |
---|
1621 | YY_BREAK |
---|
1622 | /* dimension of the problem */ |
---|
1623 | case 22: |
---|
1624 | YY_RULE_SETUP |
---|
1625 | #line 63 "convert.lex" |
---|
1626 | {strcpy(yylval.na,yytext); return TOK_NAME;} |
---|
1627 | YY_BREAK |
---|
1628 | case 23: |
---|
1629 | YY_RULE_SETUP |
---|
1630 | #line 64 "convert.lex" |
---|
1631 | {yylval.ival=atoi(yytext); return TOK_NUM;} |
---|
1632 | YY_BREAK |
---|
1633 | case 24: |
---|
1634 | YY_RULE_SETUP |
---|
1635 | #line 65 "convert.lex" |
---|
1636 | {return (int) *yytext;} |
---|
1637 | YY_BREAK |
---|
1638 | case 25: |
---|
1639 | YY_RULE_SETUP |
---|
1640 | #line 66 "convert.lex" |
---|
1641 | {line_num++;return (int) *yytext;} |
---|
1642 | YY_BREAK |
---|
1643 | case 26: |
---|
1644 | YY_RULE_SETUP |
---|
1645 | #line 67 "convert.lex" |
---|
1646 | ; |
---|
1647 | YY_BREAK |
---|
1648 | case 27: |
---|
1649 | YY_RULE_SETUP |
---|
1650 | #line 68 "convert.lex" |
---|
1651 | ECHO; |
---|
1652 | YY_BREAK |
---|
1653 | #line 878 "convert.yy.c" |
---|
1654 | case YY_STATE_EOF(INITIAL): |
---|
1655 | case YY_STATE_EOF(character): |
---|
1656 | yyterminate(); |
---|
1657 | |
---|
1658 | case YY_END_OF_BUFFER: |
---|
1659 | { |
---|
1660 | /* Amount of text matched not including the EOB char. */ |
---|
1661 | int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; |
---|
1662 | |
---|
1663 | /* Undo the effects of YY_DO_BEFORE_ACTION. */ |
---|
1664 | *yy_cp = yy_hold_char; |
---|
1665 | YY_RESTORE_YY_MORE_OFFSET |
---|
1666 | |
---|
1667 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) |
---|
1668 | { |
---|
1669 | /* We're scanning a new file or input source. It's |
---|
1670 | * possible that this happened because the user |
---|
1671 | * just pointed yyin at a new source and called |
---|
1672 | * yylex(). If so, then we have to assure |
---|
1673 | * consistency between yy_current_buffer and our |
---|
1674 | * globals. Here is the right place to do so, because |
---|
1675 | * this is the first action (other than possibly a |
---|
1676 | * back-up) that will match for the new input source. |
---|
1677 | */ |
---|
1678 | yy_n_chars = yy_current_buffer->yy_n_chars; |
---|
1679 | yy_current_buffer->yy_input_file = yyin; |
---|
1680 | yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; |
---|
1681 | } |
---|
1682 | |
---|
1683 | /* Note that here we test for yy_c_buf_p "<=" to the position |
---|
1684 | * of the first EOB in the buffer, since yy_c_buf_p will |
---|
1685 | * already have been incremented past the NUL character |
---|
1686 | * (since all states make transitions on EOB to the |
---|
1687 | * end-of-buffer state). Contrast this with the test |
---|
1688 | * in input(). |
---|
1689 | */ |
---|
1690 | if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) |
---|
1691 | { /* This was really a NUL. */ |
---|
1692 | yy_state_type yy_next_state; |
---|
1693 | |
---|
1694 | yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; |
---|
1695 | |
---|
1696 | yy_current_state = yy_get_previous_state(); |
---|
1697 | |
---|
1698 | /* Okay, we're now positioned to make the NUL |
---|
1699 | * transition. We couldn't have |
---|
1700 | * yy_get_previous_state() go ahead and do it |
---|
1701 | * for us because it doesn't know how to deal |
---|
1702 | * with the possibility of jamming (and we don't |
---|
1703 | * want to build jamming into it because then it |
---|
1704 | * will run more slowly). |
---|
1705 | */ |
---|
1706 | |
---|
1707 | yy_next_state = yy_try_NUL_trans( yy_current_state ); |
---|
1708 | |
---|
1709 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
---|
1710 | |
---|
1711 | if ( yy_next_state ) |
---|
1712 | { |
---|
1713 | /* Consume the NUL. */ |
---|
1714 | yy_cp = ++yy_c_buf_p; |
---|
1715 | yy_current_state = yy_next_state; |
---|
1716 | goto yy_match; |
---|
1717 | } |
---|
1718 | |
---|
1719 | else |
---|
1720 | { |
---|
1721 | yy_cp = yy_c_buf_p; |
---|
1722 | goto yy_find_action; |
---|
1723 | } |
---|
1724 | } |
---|
1725 | |
---|
1726 | else switch ( yy_get_next_buffer() ) |
---|
1727 | { |
---|
1728 | case EOB_ACT_END_OF_FILE: |
---|
1729 | { |
---|
1730 | yy_did_buffer_switch_on_eof = 0; |
---|
1731 | |
---|
1732 | if ( yywrap() ) |
---|
1733 | { |
---|
1734 | /* Note: because we've taken care in |
---|
1735 | * yy_get_next_buffer() to have set up |
---|
1736 | * yytext, we can now set up |
---|
1737 | * yy_c_buf_p so that if some total |
---|
1738 | * hoser (like flex itself) wants to |
---|
1739 | * call the scanner after we return the |
---|
1740 | * YY_NULL, it'll still work - another |
---|
1741 | * YY_NULL will get returned. |
---|
1742 | */ |
---|
1743 | yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; |
---|
1744 | |
---|
1745 | yy_act = YY_STATE_EOF(YY_START); |
---|
1746 | goto do_action; |
---|
1747 | } |
---|
1748 | |
---|
1749 | else |
---|
1750 | { |
---|
1751 | if ( ! yy_did_buffer_switch_on_eof ) |
---|
1752 | YY_NEW_FILE; |
---|
1753 | } |
---|
1754 | break; |
---|
1755 | } |
---|
1756 | |
---|
1757 | case EOB_ACT_CONTINUE_SCAN: |
---|
1758 | yy_c_buf_p = |
---|
1759 | yytext_ptr + yy_amount_of_matched_text; |
---|
1760 | |
---|
1761 | yy_current_state = yy_get_previous_state(); |
---|
1762 | |
---|
1763 | yy_cp = yy_c_buf_p; |
---|
1764 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
---|
1765 | goto yy_match; |
---|
1766 | |
---|
1767 | case EOB_ACT_LAST_MATCH: |
---|
1768 | yy_c_buf_p = |
---|
1769 | &yy_current_buffer->yy_ch_buf[yy_n_chars]; |
---|
1770 | |
---|
1771 | yy_current_state = yy_get_previous_state(); |
---|
1772 | |
---|
1773 | yy_cp = yy_c_buf_p; |
---|
1774 | yy_bp = yytext_ptr + YY_MORE_ADJ; |
---|
1775 | goto yy_find_action; |
---|
1776 | } |
---|
1777 | break; |
---|
1778 | } |
---|
1779 | |
---|
1780 | default: |
---|
1781 | YY_FATAL_ERROR( |
---|
1782 | "fatal flex scanner internal error--no action found" ); |
---|
1783 | } /* end of action switch */ |
---|
1784 | } /* end of scanning one token */ |
---|
1785 | } /* end of yylex */ |
---|
1786 | |
---|
1787 | |
---|
1788 | /* yy_get_next_buffer - try to read in a new buffer |
---|
1789 | * |
---|
1790 | * Returns a code representing an action: |
---|
1791 | * EOB_ACT_LAST_MATCH - |
---|
1792 | * EOB_ACT_CONTINUE_SCAN - continue scanning from current position |
---|
1793 | * EOB_ACT_END_OF_FILE - end of file |
---|
1794 | */ |
---|
1795 | |
---|
1796 | static int yy_get_next_buffer() |
---|
1797 | { |
---|
1798 | register char *dest = yy_current_buffer->yy_ch_buf; |
---|
1799 | register char *source = yytext_ptr; |
---|
1800 | register int number_to_move, i; |
---|
1801 | int ret_val; |
---|
1802 | |
---|
1803 | if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) |
---|
1804 | YY_FATAL_ERROR( |
---|
1805 | "fatal flex scanner internal error--end of buffer missed" ); |
---|
1806 | |
---|
1807 | if ( yy_current_buffer->yy_fill_buffer == 0 ) |
---|
1808 | { /* Don't try to fill the buffer, so this is an EOF. */ |
---|
1809 | if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) |
---|
1810 | { |
---|
1811 | /* We matched a single character, the EOB, so |
---|
1812 | * treat this as a final EOF. |
---|
1813 | */ |
---|
1814 | return EOB_ACT_END_OF_FILE; |
---|
1815 | } |
---|
1816 | |
---|
1817 | else |
---|
1818 | { |
---|
1819 | /* We matched some text prior to the EOB, first |
---|
1820 | * process it. |
---|
1821 | */ |
---|
1822 | return EOB_ACT_LAST_MATCH; |
---|
1823 | } |
---|
1824 | } |
---|
1825 | |
---|
1826 | /* Try to read more data. */ |
---|
1827 | |
---|
1828 | /* First move last chars to start of buffer. */ |
---|
1829 | number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; |
---|
1830 | |
---|
1831 | for ( i = 0; i < number_to_move; ++i ) |
---|
1832 | *(dest++) = *(source++); |
---|
1833 | |
---|
1834 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) |
---|
1835 | /* don't do the read, it's not guaranteed to return an EOF, |
---|
1836 | * just force an EOF |
---|
1837 | */ |
---|
1838 | yy_current_buffer->yy_n_chars = yy_n_chars = 0; |
---|
1839 | |
---|
1840 | else |
---|
1841 | { |
---|
1842 | int num_to_read = |
---|
1843 | yy_current_buffer->yy_buf_size - number_to_move - 1; |
---|
1844 | |
---|
1845 | while ( num_to_read <= 0 ) |
---|
1846 | { /* Not enough room in the buffer - grow it. */ |
---|
1847 | #ifdef YY_USES_REJECT |
---|
1848 | YY_FATAL_ERROR( |
---|
1849 | "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); |
---|
1850 | #else |
---|
1851 | |
---|
1852 | /* just a shorter name for the current buffer */ |
---|
1853 | YY_BUFFER_STATE b = yy_current_buffer; |
---|
1854 | |
---|
1855 | int yy_c_buf_p_offset = |
---|
1856 | (int) (yy_c_buf_p - b->yy_ch_buf); |
---|
1857 | |
---|
1858 | if ( b->yy_is_our_buffer ) |
---|
1859 | { |
---|
1860 | int new_size = b->yy_buf_size * 2; |
---|
1861 | |
---|
1862 | if ( new_size <= 0 ) |
---|
1863 | b->yy_buf_size += b->yy_buf_size / 8; |
---|
1864 | else |
---|
1865 | b->yy_buf_size *= 2; |
---|
1866 | |
---|
1867 | b->yy_ch_buf = (char *) |
---|
1868 | /* Include room in for 2 EOB chars. */ |
---|
1869 | yy_flex_realloc( (void *) b->yy_ch_buf, |
---|
1870 | b->yy_buf_size + 2 ); |
---|
1871 | } |
---|
1872 | else |
---|
1873 | /* Can't grow it, we don't own it. */ |
---|
1874 | b->yy_ch_buf = 0; |
---|
1875 | |
---|
1876 | if ( ! b->yy_ch_buf ) |
---|
1877 | YY_FATAL_ERROR( |
---|
1878 | "fatal error - scanner input buffer overflow" ); |
---|
1879 | |
---|
1880 | yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; |
---|
1881 | |
---|
1882 | num_to_read = yy_current_buffer->yy_buf_size - |
---|
1883 | number_to_move - 1; |
---|
1884 | #endif |
---|
1885 | } |
---|
1886 | |
---|
1887 | if ( num_to_read > YY_READ_BUF_SIZE ) |
---|
1888 | num_to_read = YY_READ_BUF_SIZE; |
---|
1889 | |
---|
1890 | /* Read in more data. */ |
---|
1891 | YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), |
---|
1892 | yy_n_chars, num_to_read ); |
---|
1893 | |
---|
1894 | yy_current_buffer->yy_n_chars = yy_n_chars; |
---|
1895 | } |
---|
1896 | |
---|
1897 | if ( yy_n_chars == 0 ) |
---|
1898 | { |
---|
1899 | if ( number_to_move == YY_MORE_ADJ ) |
---|
1900 | { |
---|
1901 | ret_val = EOB_ACT_END_OF_FILE; |
---|
1902 | yyrestart( yyin ); |
---|
1903 | } |
---|
1904 | |
---|
1905 | else |
---|
1906 | { |
---|
1907 | ret_val = EOB_ACT_LAST_MATCH; |
---|
1908 | yy_current_buffer->yy_buffer_status = |
---|
1909 | YY_BUFFER_EOF_PENDING; |
---|
1910 | } |
---|
1911 | } |
---|
1912 | |
---|
1913 | else |
---|
1914 | ret_val = EOB_ACT_CONTINUE_SCAN; |
---|
1915 | |
---|
1916 | yy_n_chars += number_to_move; |
---|
1917 | yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; |
---|
1918 | yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; |
---|
1919 | |
---|
1920 | yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; |
---|
1921 | |
---|
1922 | return ret_val; |
---|
1923 | } |
---|
1924 | |
---|
1925 | |
---|
1926 | /* yy_get_previous_state - get the state just before the EOB char was reached */ |
---|
1927 | |
---|
1928 | static yy_state_type yy_get_previous_state() |
---|
1929 | { |
---|
1930 | register yy_state_type yy_current_state; |
---|
1931 | register char *yy_cp; |
---|
1932 | |
---|
1933 | yy_current_state = yy_start; |
---|
1934 | |
---|
1935 | for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) |
---|
1936 | { |
---|
1937 | register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); |
---|
1938 | if ( yy_accept[yy_current_state] ) |
---|
1939 | { |
---|
1940 | yy_last_accepting_state = yy_current_state; |
---|
1941 | yy_last_accepting_cpos = yy_cp; |
---|
1942 | } |
---|
1943 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
1944 | { |
---|
1945 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
1946 | if ( yy_current_state >= 133 ) |
---|
1947 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
1948 | } |
---|
1949 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
1950 | } |
---|
1951 | |
---|
1952 | return yy_current_state; |
---|
1953 | } |
---|
1954 | |
---|
1955 | |
---|
1956 | /* yy_try_NUL_trans - try to make a transition on the NUL character |
---|
1957 | * |
---|
1958 | * synopsis |
---|
1959 | * next_state = yy_try_NUL_trans( current_state ); |
---|
1960 | */ |
---|
1961 | |
---|
1962 | #ifdef YY_USE_PROTOS |
---|
1963 | static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) |
---|
1964 | #else |
---|
1965 | static yy_state_type yy_try_NUL_trans( yy_current_state ) |
---|
1966 | yy_state_type yy_current_state; |
---|
1967 | #endif |
---|
1968 | { |
---|
1969 | register int yy_is_jam; |
---|
1970 | register char *yy_cp = yy_c_buf_p; |
---|
1971 | |
---|
1972 | register YY_CHAR yy_c = 1; |
---|
1973 | if ( yy_accept[yy_current_state] ) |
---|
1974 | { |
---|
1975 | yy_last_accepting_state = yy_current_state; |
---|
1976 | yy_last_accepting_cpos = yy_cp; |
---|
1977 | } |
---|
1978 | while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) |
---|
1979 | { |
---|
1980 | yy_current_state = (int) yy_def[yy_current_state]; |
---|
1981 | if ( yy_current_state >= 133 ) |
---|
1982 | yy_c = yy_meta[(unsigned int) yy_c]; |
---|
1983 | } |
---|
1984 | yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; |
---|
1985 | yy_is_jam = (yy_current_state == 132); |
---|
1986 | |
---|
1987 | return yy_is_jam ? 0 : yy_current_state; |
---|
1988 | } |
---|
1989 | |
---|
1990 | |
---|
1991 | #ifndef YY_NO_UNPUT |
---|
1992 | #ifdef YY_USE_PROTOS |
---|
1993 | static void yyunput( int c, register char *yy_bp ) |
---|
1994 | #else |
---|
1995 | static void yyunput( c, yy_bp ) |
---|
1996 | int c; |
---|
1997 | register char *yy_bp; |
---|
1998 | #endif |
---|
1999 | { |
---|
2000 | register char *yy_cp = yy_c_buf_p; |
---|
2001 | |
---|
2002 | /* undo effects of setting up yytext */ |
---|
2003 | *yy_cp = yy_hold_char; |
---|
2004 | |
---|
2005 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) |
---|
2006 | { /* need to shift things up to make room */ |
---|
2007 | /* +2 for EOB chars. */ |
---|
2008 | register int number_to_move = yy_n_chars + 2; |
---|
2009 | register char *dest = &yy_current_buffer->yy_ch_buf[ |
---|
2010 | yy_current_buffer->yy_buf_size + 2]; |
---|
2011 | register char *source = |
---|
2012 | &yy_current_buffer->yy_ch_buf[number_to_move]; |
---|
2013 | |
---|
2014 | while ( source > yy_current_buffer->yy_ch_buf ) |
---|
2015 | *--dest = *--source; |
---|
2016 | |
---|
2017 | yy_cp += (int) (dest - source); |
---|
2018 | yy_bp += (int) (dest - source); |
---|
2019 | yy_current_buffer->yy_n_chars = |
---|
2020 | yy_n_chars = yy_current_buffer->yy_buf_size; |
---|
2021 | |
---|
2022 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) |
---|
2023 | YY_FATAL_ERROR( "flex scanner push-back overflow" ); |
---|
2024 | } |
---|
2025 | |
---|
2026 | *--yy_cp = (char) c; |
---|
2027 | |
---|
2028 | |
---|
2029 | yytext_ptr = yy_bp; |
---|
2030 | yy_hold_char = *yy_cp; |
---|
2031 | yy_c_buf_p = yy_cp; |
---|
2032 | } |
---|
2033 | #endif /* ifndef YY_NO_UNPUT */ |
---|
2034 | |
---|
2035 | |
---|
2036 | #ifdef __cplusplus |
---|
2037 | static int yyinput() |
---|
2038 | #else |
---|
2039 | static int input() |
---|
2040 | #endif |
---|
2041 | { |
---|
2042 | int c; |
---|
2043 | |
---|
2044 | *yy_c_buf_p = yy_hold_char; |
---|
2045 | |
---|
2046 | if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) |
---|
2047 | { |
---|
2048 | /* yy_c_buf_p now points to the character we want to return. |
---|
2049 | * If this occurs *before* the EOB characters, then it's a |
---|
2050 | * valid NUL; if not, then we've hit the end of the buffer. |
---|
2051 | */ |
---|
2052 | if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) |
---|
2053 | /* This was really a NUL. */ |
---|
2054 | *yy_c_buf_p = '\0'; |
---|
2055 | |
---|
2056 | else |
---|
2057 | { /* need more input */ |
---|
2058 | int offset = yy_c_buf_p - yytext_ptr; |
---|
2059 | ++yy_c_buf_p; |
---|
2060 | |
---|
2061 | switch ( yy_get_next_buffer() ) |
---|
2062 | { |
---|
2063 | case EOB_ACT_LAST_MATCH: |
---|
2064 | /* This happens because yy_g_n_b() |
---|
2065 | * sees that we've accumulated a |
---|
2066 | * token and flags that we need to |
---|
2067 | * try matching the token before |
---|
2068 | * proceeding. But for input(), |
---|
2069 | * there's no matching to consider. |
---|
2070 | * So convert the EOB_ACT_LAST_MATCH |
---|
2071 | * to EOB_ACT_END_OF_FILE. |
---|
2072 | */ |
---|
2073 | |
---|
2074 | /* Reset buffer status. */ |
---|
2075 | yyrestart( yyin ); |
---|
2076 | |
---|
2077 | /* fall through */ |
---|
2078 | |
---|
2079 | case EOB_ACT_END_OF_FILE: |
---|
2080 | { |
---|
2081 | if ( yywrap() ) |
---|
2082 | return EOF; |
---|
2083 | |
---|
2084 | if ( ! yy_did_buffer_switch_on_eof ) |
---|
2085 | YY_NEW_FILE; |
---|
2086 | #ifdef __cplusplus |
---|
2087 | return yyinput(); |
---|
2088 | #else |
---|
2089 | return input(); |
---|
2090 | #endif |
---|
2091 | } |
---|
2092 | |
---|
2093 | case EOB_ACT_CONTINUE_SCAN: |
---|
2094 | yy_c_buf_p = yytext_ptr + offset; |
---|
2095 | break; |
---|
2096 | } |
---|
2097 | } |
---|
2098 | } |
---|
2099 | |
---|
2100 | c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ |
---|
2101 | *yy_c_buf_p = '\0'; /* preserve yytext */ |
---|
2102 | yy_hold_char = *++yy_c_buf_p; |
---|
2103 | |
---|
2104 | |
---|
2105 | return c; |
---|
2106 | } |
---|
2107 | |
---|
2108 | |
---|
2109 | #ifdef YY_USE_PROTOS |
---|
2110 | void yyrestart( FILE *input_file ) |
---|
2111 | #else |
---|
2112 | void yyrestart( input_file ) |
---|
2113 | FILE *input_file; |
---|
2114 | #endif |
---|
2115 | { |
---|
2116 | if ( ! yy_current_buffer ) |
---|
2117 | yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); |
---|
2118 | |
---|
2119 | yy_init_buffer( yy_current_buffer, input_file ); |
---|
2120 | yy_load_buffer_state(); |
---|
2121 | } |
---|
2122 | |
---|
2123 | |
---|
2124 | #ifdef YY_USE_PROTOS |
---|
2125 | void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) |
---|
2126 | #else |
---|
2127 | void yy_switch_to_buffer( new_buffer ) |
---|
2128 | YY_BUFFER_STATE new_buffer; |
---|
2129 | #endif |
---|
2130 | { |
---|
2131 | if ( yy_current_buffer == new_buffer ) |
---|
2132 | return; |
---|
2133 | |
---|
2134 | if ( yy_current_buffer ) |
---|
2135 | { |
---|
2136 | /* Flush out information for old buffer. */ |
---|
2137 | *yy_c_buf_p = yy_hold_char; |
---|
2138 | yy_current_buffer->yy_buf_pos = yy_c_buf_p; |
---|
2139 | yy_current_buffer->yy_n_chars = yy_n_chars; |
---|
2140 | } |
---|
2141 | |
---|
2142 | yy_current_buffer = new_buffer; |
---|
2143 | yy_load_buffer_state(); |
---|
2144 | |
---|
2145 | /* We don't actually know whether we did this switch during |
---|
2146 | * EOF (yywrap()) processing, but the only time this flag |
---|
2147 | * is looked at is after yywrap() is called, so it's safe |
---|
2148 | * to go ahead and always set it. |
---|
2149 | */ |
---|
2150 | yy_did_buffer_switch_on_eof = 1; |
---|
2151 | } |
---|
2152 | |
---|
2153 | |
---|
2154 | #ifdef YY_USE_PROTOS |
---|
2155 | void yy_load_buffer_state( void ) |
---|
2156 | #else |
---|
2157 | void yy_load_buffer_state() |
---|
2158 | #endif |
---|
2159 | { |
---|
2160 | yy_n_chars = yy_current_buffer->yy_n_chars; |
---|
2161 | yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; |
---|
2162 | yyin = yy_current_buffer->yy_input_file; |
---|
2163 | yy_hold_char = *yy_c_buf_p; |
---|
2164 | } |
---|
2165 | |
---|
2166 | |
---|
2167 | #ifdef YY_USE_PROTOS |
---|
2168 | YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) |
---|
2169 | #else |
---|
2170 | YY_BUFFER_STATE yy_create_buffer( file, size ) |
---|
2171 | FILE *file; |
---|
2172 | int size; |
---|
2173 | #endif |
---|
2174 | { |
---|
2175 | YY_BUFFER_STATE b; |
---|
2176 | |
---|
2177 | b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); |
---|
2178 | if ( ! b ) |
---|
2179 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
---|
2180 | |
---|
2181 | b->yy_buf_size = size; |
---|
2182 | |
---|
2183 | /* yy_ch_buf has to be 2 characters longer than the size given because |
---|
2184 | * we need to put in 2 end-of-buffer characters. |
---|
2185 | */ |
---|
2186 | b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); |
---|
2187 | if ( ! b->yy_ch_buf ) |
---|
2188 | YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |
---|
2189 | |
---|
2190 | b->yy_is_our_buffer = 1; |
---|
2191 | |
---|
2192 | yy_init_buffer( b, file ); |
---|
2193 | |
---|
2194 | return b; |
---|
2195 | } |
---|
2196 | |
---|
2197 | |
---|
2198 | #ifdef YY_USE_PROTOS |
---|
2199 | void yy_delete_buffer( YY_BUFFER_STATE b ) |
---|
2200 | #else |
---|
2201 | void yy_delete_buffer( b ) |
---|
2202 | YY_BUFFER_STATE b; |
---|
2203 | #endif |
---|
2204 | { |
---|
2205 | if ( ! b ) |
---|
2206 | return; |
---|
2207 | |
---|
2208 | if ( b == yy_current_buffer ) |
---|
2209 | yy_current_buffer = (YY_BUFFER_STATE) 0; |
---|
2210 | |
---|
2211 | if ( b->yy_is_our_buffer ) |
---|
2212 | yy_flex_free( (void *) b->yy_ch_buf ); |
---|
2213 | |
---|
2214 | yy_flex_free( (void *) b ); |
---|
2215 | } |
---|
2216 | |
---|
2217 | |
---|
2218 | |
---|
2219 | #ifdef YY_USE_PROTOS |
---|
2220 | void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) |
---|
2221 | #else |
---|
2222 | void yy_init_buffer( b, file ) |
---|
2223 | YY_BUFFER_STATE b; |
---|
2224 | FILE *file; |
---|
2225 | #endif |
---|
2226 | |
---|
2227 | |
---|
2228 | { |
---|
2229 | yy_flush_buffer( b ); |
---|
2230 | |
---|
2231 | b->yy_input_file = file; |
---|
2232 | b->yy_fill_buffer = 1; |
---|
2233 | |
---|
2234 | #if YY_ALWAYS_INTERACTIVE |
---|
2235 | b->yy_is_interactive = 1; |
---|
2236 | #else |
---|
2237 | #if YY_NEVER_INTERACTIVE |
---|
2238 | b->yy_is_interactive = 0; |
---|
2239 | #else |
---|
2240 | b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; |
---|
2241 | #endif |
---|
2242 | #endif |
---|
2243 | } |
---|
2244 | |
---|
2245 | |
---|
2246 | #ifdef YY_USE_PROTOS |
---|
2247 | void yy_flush_buffer( YY_BUFFER_STATE b ) |
---|
2248 | #else |
---|
2249 | void yy_flush_buffer( b ) |
---|
2250 | YY_BUFFER_STATE b; |
---|
2251 | #endif |
---|
2252 | |
---|
2253 | { |
---|
2254 | if ( ! b ) |
---|
2255 | return; |
---|
2256 | |
---|
2257 | b->yy_n_chars = 0; |
---|
2258 | |
---|
2259 | /* We always need two end-of-buffer characters. The first causes |
---|
2260 | * a transition to the end-of-buffer state. The second causes |
---|
2261 | * a jam in that state. |
---|
2262 | */ |
---|
2263 | b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; |
---|
2264 | b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; |
---|
2265 | |
---|
2266 | b->yy_buf_pos = &b->yy_ch_buf[0]; |
---|
2267 | |
---|
2268 | b->yy_at_bol = 1; |
---|
2269 | b->yy_buffer_status = YY_BUFFER_NEW; |
---|
2270 | |
---|
2271 | if ( b == yy_current_buffer ) |
---|
2272 | yy_load_buffer_state(); |
---|
2273 | } |
---|
2274 | |
---|
2275 | |
---|
2276 | #ifndef YY_NO_SCAN_BUFFER |
---|
2277 | #ifdef YY_USE_PROTOS |
---|
2278 | YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) |
---|
2279 | #else |
---|
2280 | YY_BUFFER_STATE yy_scan_buffer( base, size ) |
---|
2281 | char *base; |
---|
2282 | yy_size_t size; |
---|
2283 | #endif |
---|
2284 | { |
---|
2285 | YY_BUFFER_STATE b; |
---|
2286 | |
---|
2287 | if ( size < 2 || |
---|
2288 | base[size-2] != YY_END_OF_BUFFER_CHAR || |
---|
2289 | base[size-1] != YY_END_OF_BUFFER_CHAR ) |
---|
2290 | /* They forgot to leave room for the EOB's. */ |
---|
2291 | return 0; |
---|
2292 | |
---|
2293 | b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); |
---|
2294 | if ( ! b ) |
---|
2295 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); |
---|
2296 | |
---|
2297 | b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ |
---|
2298 | b->yy_buf_pos = b->yy_ch_buf = base; |
---|
2299 | b->yy_is_our_buffer = 0; |
---|
2300 | b->yy_input_file = 0; |
---|
2301 | b->yy_n_chars = b->yy_buf_size; |
---|
2302 | b->yy_is_interactive = 0; |
---|
2303 | b->yy_at_bol = 1; |
---|
2304 | b->yy_fill_buffer = 0; |
---|
2305 | b->yy_buffer_status = YY_BUFFER_NEW; |
---|
2306 | |
---|
2307 | yy_switch_to_buffer( b ); |
---|
2308 | |
---|
2309 | return b; |
---|
2310 | } |
---|
2311 | #endif |
---|
2312 | |
---|
2313 | |
---|
2314 | #ifndef YY_NO_SCAN_STRING |
---|
2315 | #ifdef YY_USE_PROTOS |
---|
2316 | YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) |
---|
2317 | #else |
---|
2318 | YY_BUFFER_STATE yy_scan_string( yy_str ) |
---|
2319 | yyconst char *yy_str; |
---|
2320 | #endif |
---|
2321 | { |
---|
2322 | int len; |
---|
2323 | for ( len = 0; yy_str[len]; ++len ) |
---|
2324 | ; |
---|
2325 | |
---|
2326 | return yy_scan_bytes( yy_str, len ); |
---|
2327 | } |
---|
2328 | #endif |
---|
2329 | |
---|
2330 | |
---|
2331 | #ifndef YY_NO_SCAN_BYTES |
---|
2332 | #ifdef YY_USE_PROTOS |
---|
2333 | YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) |
---|
2334 | #else |
---|
2335 | YY_BUFFER_STATE yy_scan_bytes( bytes, len ) |
---|
2336 | yyconst char *bytes; |
---|
2337 | int len; |
---|
2338 | #endif |
---|
2339 | { |
---|
2340 | YY_BUFFER_STATE b; |
---|
2341 | char *buf; |
---|
2342 | yy_size_t n; |
---|
2343 | int i; |
---|
2344 | |
---|
2345 | /* Get memory for full buffer, including space for trailing EOB's. */ |
---|
2346 | n = len + 2; |
---|
2347 | buf = (char *) yy_flex_alloc( n ); |
---|
2348 | if ( ! buf ) |
---|
2349 | YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); |
---|
2350 | |
---|
2351 | for ( i = 0; i < len; ++i ) |
---|
2352 | buf[i] = bytes[i]; |
---|
2353 | |
---|
2354 | buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; |
---|
2355 | |
---|
2356 | b = yy_scan_buffer( buf, n ); |
---|
2357 | if ( ! b ) |
---|
2358 | YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); |
---|
2359 | |
---|
2360 | /* It's okay to grow etc. this buffer, and we should throw it |
---|
2361 | * away when we're done. |
---|
2362 | */ |
---|
2363 | b->yy_is_our_buffer = 1; |
---|
2364 | |
---|
2365 | return b; |
---|
2366 | } |
---|
2367 | #endif |
---|
2368 | |
---|
2369 | |
---|
2370 | #ifndef YY_NO_PUSH_STATE |
---|
2371 | #ifdef YY_USE_PROTOS |
---|
2372 | static void yy_push_state( int new_state ) |
---|
2373 | #else |
---|
2374 | static void yy_push_state( new_state ) |
---|
2375 | int new_state; |
---|
2376 | #endif |
---|
2377 | { |
---|
2378 | if ( yy_start_stack_ptr >= yy_start_stack_depth ) |
---|
2379 | { |
---|
2380 | yy_size_t new_size; |
---|
2381 | |
---|
2382 | yy_start_stack_depth += YY_START_STACK_INCR; |
---|
2383 | new_size = yy_start_stack_depth * sizeof( int ); |
---|
2384 | |
---|
2385 | if ( ! yy_start_stack ) |
---|
2386 | yy_start_stack = (int *) yy_flex_alloc( new_size ); |
---|
2387 | |
---|
2388 | else |
---|
2389 | yy_start_stack = (int *) yy_flex_realloc( |
---|
2390 | (void *) yy_start_stack, new_size ); |
---|
2391 | |
---|
2392 | if ( ! yy_start_stack ) |
---|
2393 | YY_FATAL_ERROR( |
---|
2394 | "out of memory expanding start-condition stack" ); |
---|
2395 | } |
---|
2396 | |
---|
2397 | yy_start_stack[yy_start_stack_ptr++] = YY_START; |
---|
2398 | |
---|
2399 | BEGIN(new_state); |
---|
2400 | } |
---|
2401 | #endif |
---|
2402 | |
---|
2403 | |
---|
2404 | #ifndef YY_NO_POP_STATE |
---|
2405 | static void yy_pop_state() |
---|
2406 | { |
---|
2407 | if ( --yy_start_stack_ptr < 0 ) |
---|
2408 | YY_FATAL_ERROR( "start-condition stack underflow" ); |
---|
2409 | |
---|
2410 | BEGIN(yy_start_stack[yy_start_stack_ptr]); |
---|
2411 | } |
---|
2412 | #endif |
---|
2413 | |
---|
2414 | |
---|
2415 | #ifndef YY_NO_TOP_STATE |
---|
2416 | static int yy_top_state() |
---|
2417 | { |
---|
2418 | return yy_start_stack[yy_start_stack_ptr - 1]; |
---|
2419 | } |
---|
2420 | #endif |
---|
2421 | |
---|
2422 | #ifndef YY_EXIT_FAILURE |
---|
2423 | #define YY_EXIT_FAILURE 2 |
---|
2424 | #endif |
---|
2425 | |
---|
2426 | #ifdef YY_USE_PROTOS |
---|
2427 | static void yy_fatal_error( yyconst char msg[] ) |
---|
2428 | #else |
---|
2429 | static void yy_fatal_error( msg ) |
---|
2430 | char msg[]; |
---|
2431 | #endif |
---|
2432 | { |
---|
2433 | (void) fprintf( stderr, "%s\n", msg ); |
---|
2434 | exit( YY_EXIT_FAILURE ); |
---|
2435 | } |
---|
2436 | |
---|
2437 | |
---|
2438 | |
---|
2439 | /* Redefine yyless() so it works in section 3 code. */ |
---|
2440 | |
---|
2441 | #undef yyless |
---|
2442 | #define yyless(n) \ |
---|
2443 | do \ |
---|
2444 | { \ |
---|
2445 | /* Undo effects of setting up yytext. */ \ |
---|
2446 | yytext[yyleng] = yy_hold_char; \ |
---|
2447 | yy_c_buf_p = yytext + n; \ |
---|
2448 | yy_hold_char = *yy_c_buf_p; \ |
---|
2449 | *yy_c_buf_p = '\0'; \ |
---|
2450 | yyleng = n; \ |
---|
2451 | } \ |
---|
2452 | while ( 0 ) |
---|
2453 | |
---|
2454 | |
---|
2455 | /* Internal utility routines. */ |
---|
2456 | |
---|
2457 | #ifndef yytext_ptr |
---|
2458 | #ifdef YY_USE_PROTOS |
---|
2459 | static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) |
---|
2460 | #else |
---|
2461 | static void yy_flex_strncpy( s1, s2, n ) |
---|
2462 | char *s1; |
---|
2463 | yyconst char *s2; |
---|
2464 | int n; |
---|
2465 | #endif |
---|
2466 | { |
---|
2467 | register int i; |
---|
2468 | for ( i = 0; i < n; ++i ) |
---|
2469 | s1[i] = s2[i]; |
---|
2470 | } |
---|
2471 | #endif |
---|
2472 | |
---|
2473 | #ifdef YY_NEED_STRLEN |
---|
2474 | #ifdef YY_USE_PROTOS |
---|
2475 | static int yy_flex_strlen( yyconst char *s ) |
---|
2476 | #else |
---|
2477 | static int yy_flex_strlen( s ) |
---|
2478 | yyconst char *s; |
---|
2479 | #endif |
---|
2480 | { |
---|
2481 | register int n; |
---|
2482 | for ( n = 0; s[n]; ++n ) |
---|
2483 | ; |
---|
2484 | |
---|
2485 | return n; |
---|
2486 | } |
---|
2487 | #endif |
---|
2488 | |
---|
2489 | |
---|
2490 | #ifdef YY_USE_PROTOS |
---|
2491 | static void *yy_flex_alloc( yy_size_t size ) |
---|
2492 | #else |
---|
2493 | static void *yy_flex_alloc( size ) |
---|
2494 | yy_size_t size; |
---|
2495 | #endif |
---|
2496 | { |
---|
2497 | return (void *) malloc( size ); |
---|
2498 | } |
---|
2499 | |
---|
2500 | #ifdef YY_USE_PROTOS |
---|
2501 | static void *yy_flex_realloc( void *ptr, yy_size_t size ) |
---|
2502 | #else |
---|
2503 | static void *yy_flex_realloc( ptr, size ) |
---|
2504 | void *ptr; |
---|
2505 | yy_size_t size; |
---|
2506 | #endif |
---|
2507 | { |
---|
2508 | /* The cast to (char *) in the following accommodates both |
---|
2509 | * implementations that use char* generic pointers, and those |
---|
2510 | * that use void* generic pointers. It works with the latter |
---|
2511 | * because both ANSI C and C++ allow castless assignment from |
---|
2512 | * any pointer type to void*, and deal with argument conversions |
---|
2513 | * as though doing an assignment. |
---|
2514 | */ |
---|
2515 | return (void *) realloc( (char *) ptr, size ); |
---|
2516 | } |
---|
2517 | |
---|
2518 | #ifdef YY_USE_PROTOS |
---|
2519 | static void yy_flex_free( void *ptr ) |
---|
2520 | #else |
---|
2521 | static void yy_flex_free( ptr ) |
---|
2522 | void *ptr; |
---|
2523 | #endif |
---|
2524 | { |
---|
2525 | free( ptr ); |
---|
2526 | } |
---|
2527 | |
---|
2528 | #if YY_MAIN |
---|
2529 | int main() |
---|
2530 | { |
---|
2531 | yylex(); |
---|
2532 | return 0; |
---|
2533 | } |
---|
2534 | #endif |
---|
2535 | #line 68 "convert.lex" |
---|
2536 | |
---|
2537 | |
---|
2538 | |
---|
2539 | int yywrap() |
---|
2540 | { |
---|
2541 | } |
---|
2542 | |
---|
2543 | |
---|
2544 | yyerror(char *s) |
---|
2545 | { |
---|
2546 | if (!strcasecmp(curfile,mainfile)) |
---|
2547 | { |
---|
2548 | printf("Dans convert %s line %d, fichier %s\n",s,line_num,curfile); |
---|
2549 | } |
---|
2550 | else |
---|
2551 | { |
---|
2552 | printf("Dans convert %s line %d, fichier %s\n",s,line_num,curfile); |
---|
2553 | } |
---|
2554 | exit(0); |
---|
2555 | } |
---|