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