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