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