Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
include.c
Go to the documentation of this file.
1/** @file include.c
2 */
3#line 2 "include.c"
4
5#line 4 "include.c"
6
7#define YY_INT_ALIGNED short int
8
9/* A lexical scanner generated by flex */
10
11#define yy_create_buffer inc_create_buffer
12#define yy_delete_buffer inc_delete_buffer
13#define yy_scan_buffer inc_scan_buffer
14#define yy_scan_string inc_scan_string
15#define yy_scan_bytes inc_scan_bytes
16#define yy_init_buffer inc_init_buffer
17#define yy_flush_buffer inc_flush_buffer
18#define yy_load_buffer_state inc_load_buffer_state
19#define yy_switch_to_buffer inc_switch_to_buffer
20#define yypush_buffer_state incpush_buffer_state
21#define yypop_buffer_state incpop_buffer_state
22#define yyensure_buffer_stack incensure_buffer_stack
23#define yy_flex_debug inc_flex_debug
24#define yyin incin
25#define yyleng incleng
26#define yylex inclex
27#define yylineno inclineno
28#define yyout incout
29#define yyrestart increstart
30#define yytext inctext
31#define yywrap incwrap
32#define yyalloc incalloc
33#define yyrealloc increalloc
34#define yyfree incfree
35
36#define FLEX_SCANNER
37#define YY_FLEX_MAJOR_VERSION 2
38#define YY_FLEX_MINOR_VERSION 6
39#define YY_FLEX_SUBMINOR_VERSION 4
40#if YY_FLEX_SUBMINOR_VERSION > 0
41#define FLEX_BETA
42#endif
43
44#ifdef yy_create_buffer
45#define inc_create_buffer_ALREADY_DEFINED
46#else
47#define yy_create_buffer inc_create_buffer
48#endif
49
50#ifdef yy_delete_buffer
51#define inc_delete_buffer_ALREADY_DEFINED
52#else
53#define yy_delete_buffer inc_delete_buffer
54#endif
55
56#ifdef yy_scan_buffer
57#define inc_scan_buffer_ALREADY_DEFINED
58#else
59#define yy_scan_buffer inc_scan_buffer
60#endif
61
62#ifdef yy_scan_string
63#define inc_scan_string_ALREADY_DEFINED
64#else
65#define yy_scan_string inc_scan_string
66#endif
67
68#ifdef yy_scan_bytes
69#define inc_scan_bytes_ALREADY_DEFINED
70#else
71#define yy_scan_bytes inc_scan_bytes
72#endif
73
74#ifdef yy_init_buffer
75#define inc_init_buffer_ALREADY_DEFINED
76#else
77#define yy_init_buffer inc_init_buffer
78#endif
79
80#ifdef yy_flush_buffer
81#define inc_flush_buffer_ALREADY_DEFINED
82#else
83#define yy_flush_buffer inc_flush_buffer
84#endif
85
86#ifdef yy_load_buffer_state
87#define inc_load_buffer_state_ALREADY_DEFINED
88#else
89#define yy_load_buffer_state inc_load_buffer_state
90#endif
91
92#ifdef yy_switch_to_buffer
93#define inc_switch_to_buffer_ALREADY_DEFINED
94#else
95#define yy_switch_to_buffer inc_switch_to_buffer
96#endif
97
98#ifdef yypush_buffer_state
99#define incpush_buffer_state_ALREADY_DEFINED
100#else
101#define yypush_buffer_state incpush_buffer_state
102#endif
103
104#ifdef yypop_buffer_state
105#define incpop_buffer_state_ALREADY_DEFINED
106#else
107#define yypop_buffer_state incpop_buffer_state
108#endif
109
110#ifdef yyensure_buffer_stack
111#define incensure_buffer_stack_ALREADY_DEFINED
112#else
113#define yyensure_buffer_stack incensure_buffer_stack
114#endif
115
116#ifdef yylex
117#define inclex_ALREADY_DEFINED
118#else
119#define yylex inclex
120#endif
121
122#ifdef yyrestart
123#define increstart_ALREADY_DEFINED
124#else
125#define yyrestart increstart
126#endif
127
128#ifdef yylex_init
129#define inclex_init_ALREADY_DEFINED
130#else
131#define yylex_init inclex_init
132#endif
133
134#ifdef yylex_init_extra
135#define inclex_init_extra_ALREADY_DEFINED
136#else
137#define yylex_init_extra inclex_init_extra
138#endif
139
140#ifdef yylex_destroy
141#define inclex_destroy_ALREADY_DEFINED
142#else
143#define yylex_destroy inclex_destroy
144#endif
145
146#ifdef yyget_debug
147#define incget_debug_ALREADY_DEFINED
148#else
149#define yyget_debug incget_debug
150#endif
151
152#ifdef yyset_debug
153#define incset_debug_ALREADY_DEFINED
154#else
155#define yyset_debug incset_debug
156#endif
157
158#ifdef yyget_extra
159#define incget_extra_ALREADY_DEFINED
160#else
161#define yyget_extra incget_extra
162#endif
163
164#ifdef yyset_extra
165#define incset_extra_ALREADY_DEFINED
166#else
167#define yyset_extra incset_extra
168#endif
169
170#ifdef yyget_in
171#define incget_in_ALREADY_DEFINED
172#else
173#define yyget_in incget_in
174#endif
175
176#ifdef yyset_in
177#define incset_in_ALREADY_DEFINED
178#else
179#define yyset_in incset_in
180#endif
181
182#ifdef yyget_out
183#define incget_out_ALREADY_DEFINED
184#else
185#define yyget_out incget_out
186#endif
187
188#ifdef yyset_out
189#define incset_out_ALREADY_DEFINED
190#else
191#define yyset_out incset_out
192#endif
193
194#ifdef yyget_leng
195#define incget_leng_ALREADY_DEFINED
196#else
197#define yyget_leng incget_leng
198#endif
199
200#ifdef yyget_text
201#define incget_text_ALREADY_DEFINED
202#else
203#define yyget_text incget_text
204#endif
205
206#ifdef yyget_lineno
207#define incget_lineno_ALREADY_DEFINED
208#else
209#define yyget_lineno incget_lineno
210#endif
211
212#ifdef yyset_lineno
213#define incset_lineno_ALREADY_DEFINED
214#else
215#define yyset_lineno incset_lineno
216#endif
217
218#ifdef yywrap
219#define incwrap_ALREADY_DEFINED
220#else
221#define yywrap incwrap
222#endif
223
224#ifdef yyalloc
225#define incalloc_ALREADY_DEFINED
226#else
227#define yyalloc incalloc
228#endif
229
230#ifdef yyrealloc
231#define increalloc_ALREADY_DEFINED
232#else
233#define yyrealloc increalloc
234#endif
235
236#ifdef yyfree
237#define incfree_ALREADY_DEFINED
238#else
239#define yyfree incfree
240#endif
241
242#ifdef yytext
243#define inctext_ALREADY_DEFINED
244#else
245#define yytext inctext
246#endif
247
248#ifdef yyleng
249#define incleng_ALREADY_DEFINED
250#else
251#define yyleng incleng
252#endif
253
254#ifdef yyin
255#define incin_ALREADY_DEFINED
256#else
257#define yyin incin
258#endif
259
260#ifdef yyout
261#define incout_ALREADY_DEFINED
262#else
263#define yyout incout
264#endif
265
266#ifdef yy_flex_debug
267#define inc_flex_debug_ALREADY_DEFINED
268#else
269#define yy_flex_debug inc_flex_debug
270#endif
271
272#ifdef yylineno
273#define inclineno_ALREADY_DEFINED
274#else
275#define yylineno inclineno
276#endif
277
278/* First, we deal with platform-specific or compiler-specific issues. */
279
280/* begin standard C headers. */
281#include <stdio.h>
282#include <string.h>
283#include <errno.h>
284#include <stdlib.h>
285
286/* end standard C headers. */
287
288/* flex integer type definitions */
289
290#ifndef FLEXINT_H
291#define FLEXINT_H
292
293/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
294
295#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
296
297/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
298 * if you want the limit (max/min) macros for int types.
299 */
300#ifndef __STDC_LIMIT_MACROS
301#define __STDC_LIMIT_MACROS 1
302#endif
303
304#include <inttypes.h>
305typedef int8_t flex_int8_t;
306typedef uint8_t flex_uint8_t;
307typedef int16_t flex_int16_t;
308typedef uint16_t flex_uint16_t;
309typedef int32_t flex_int32_t;
310typedef uint32_t flex_uint32_t;
311#else
312typedef signed char flex_int8_t;
313typedef short int flex_int16_t;
314typedef int flex_int32_t;
315typedef unsigned char flex_uint8_t;
316typedef unsigned short int flex_uint16_t;
317typedef unsigned int flex_uint32_t;
318
319/* Limits of integral types. */
320#ifndef INT8_MIN
321#define INT8_MIN (-128)
322#endif
323#ifndef INT16_MIN
324#define INT16_MIN (-32767-1)
325#endif
326#ifndef INT32_MIN
327#define INT32_MIN (-2147483647-1)
328#endif
329#ifndef INT8_MAX
330#define INT8_MAX (127)
331#endif
332#ifndef INT16_MAX
333#define INT16_MAX (32767)
334#endif
335#ifndef INT32_MAX
336#define INT32_MAX (2147483647)
337#endif
338#ifndef UINT8_MAX
339#define UINT8_MAX (255U)
340#endif
341#ifndef UINT16_MAX
342#define UINT16_MAX (65535U)
343#endif
344#ifndef UINT32_MAX
345#define UINT32_MAX (4294967295U)
346#endif
347
348#ifndef SIZE_MAX
349#define SIZE_MAX (~(size_t)0)
350#endif
351
352#endif /* ! C99 */
353
354#endif /* ! FLEXINT_H */
355
356/* begin standard C++ headers. */
357
358/* TODO: this is always defined, so inline it */
359#define yyconst const
360
361#if defined(__GNUC__) && __GNUC__ >= 3
362#define yynoreturn __attribute__((__noreturn__))
363#else
364#define yynoreturn
365#endif
366
367/* Returned upon end-of-file. */
368#define YY_NULL 0
369
370/* Promotes a possibly negative, possibly signed char to an
371 * integer in range [0..255] for use as an array index.
372 */
373#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
374
375/* Enter a start condition. This macro really ought to take a parameter,
376 * but we do it the disgusting crufty way forced on us by the ()-less
377 * definition of BEGIN.
378 */
379#define BEGIN (yy_start) = 1 + 2 *
380/* Translate the current start state into a value that can be later handed
381 * to BEGIN to return to the state. The YYSTATE alias is for lex
382 * compatibility.
383 */
384#define YY_START (((yy_start) - 1) / 2)
385#define YYSTATE YY_START
386/* Action number for EOF rule of a given start state. */
387#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
388/* Special action meaning "start processing a new file". */
389#define YY_NEW_FILE yyrestart( yyin )
390#define YY_END_OF_BUFFER_CHAR 0
391
392/* Size of default input buffer. */
393#ifndef YY_BUF_SIZE
394#ifdef __ia64__
395/* On IA-64, the buffer size is 16k, not 8k.
396 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
397 * Ditto for the __ia64__ case accordingly.
398 */
399#define YY_BUF_SIZE 32768
400#else
401#define YY_BUF_SIZE 16384
402#endif /* __ia64__ */
403#endif
404
405/* The state buf must be large enough to hold one state per character in the main buffer.
406 */
407#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
408
409#ifndef YY_TYPEDEF_YY_BUFFER_STATE
410#define YY_TYPEDEF_YY_BUFFER_STATE
412#endif
413
414#ifndef YY_TYPEDEF_YY_SIZE_T
415#define YY_TYPEDEF_YY_SIZE_T
416typedef size_t yy_size_t;
417#endif
418
419extern int yyleng;
420
421extern FILE *yyin, *yyout;
422
423#define EOB_ACT_CONTINUE_SCAN 0
424#define EOB_ACT_END_OF_FILE 1
425#define EOB_ACT_LAST_MATCH 2
426
427 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
428 * access to the local variable yy_act. Since yyless() is a macro, it would break
429 * existing scanners that call yyless() from OUTSIDE yylex.
430 * One obvious solution it to make yy_act a global. I tried that, and saw
431 * a 5% performance hit in a non-yylineno scanner, because yy_act is
432 * normally declared as a register variable-- so it is not worth it.
433 */
434 #define YY_LESS_LINENO(n) \
435 do { \
436 int yyl;\
437 for ( yyl = n; yyl < yyleng; ++yyl )\
438 if ( yytext[yyl] == '\n' )\
439 --yylineno;\
440 }while(0)
441 #define YY_LINENO_REWIND_TO(dst) \
442 do {\
443 const char *p;\
444 for ( p = yy_cp-1; p >= (dst); --p)\
445 if ( *p == '\n' )\
446 --yylineno;\
447 }while(0)
448
449/* Return all but the first "n" matched characters back to the input stream. */
450#define yyless(n) \
451 do \
452 { \
453 /* Undo effects of setting up yytext. */ \
454 int yyless_macro_arg = (n); \
455 YY_LESS_LINENO(yyless_macro_arg);\
456 *yy_cp = (yy_hold_char); \
457 YY_RESTORE_YY_MORE_OFFSET \
458 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
459 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
460 } \
461 while ( 0 )
462#define unput(c) yyunput( c, (yytext_ptr) )
463
464#ifndef YY_STRUCT_YY_BUFFER_STATE
465#define YY_STRUCT_YY_BUFFER_STATE
466struct yy_buffer_state
467 {
469
470 char *yy_ch_buf; /* input buffer */
471 char *yy_buf_pos; /* current position in input buffer */
472
473 /* Size of input buffer in bytes, not including room for EOB
474 * characters.
475 */
476 int yy_buf_size;
477
478 /* Number of characters read into yy_ch_buf, not including EOB
479 * characters.
480 */
481 int yy_n_chars;
482
483 /* Whether we "own" the buffer - i.e., we know we created it,
484 * and can realloc() it to grow it, and should free() it to
485 * delete it.
486 */
488
489 /* Whether this is an "interactive" input source; if so, and
490 * if we're using stdio for input, then we want to use getc()
491 * instead of fread(), to make sure we stop fetching input after
492 * each newline.
493 */
495
496 /* Whether we're considered to be at the beginning of a line.
497 * If so, '^' rules will be active on the next match, otherwise
498 * not.
499 */
500 int yy_at_bol;
501
502 int yy_bs_lineno; /**< The line count. */
503 int yy_bs_column; /**< The column count. */
504
505 /* Whether to try to fill the input buffer when we reach the
506 * end of it.
507 */
508 int yy_fill_buffer;
509
511
512#define YY_BUFFER_NEW 0
513#define YY_BUFFER_NORMAL 1
514 /* When an EOF's been seen but there's still some text to process
515 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
516 * shouldn't try reading from the input source any more. We might
517 * still have a bunch of tokens to match, though, because of
518 * possible backing-up.
519 *
520 * When we actually see the EOF, we change the status to "new"
521 * (via yyrestart()), so that the user can continue scanning by
522 * just pointing yyin at a new input file.
523 */
524#define YY_BUFFER_EOF_PENDING 2
525
526 };
527#endif /* !YY_STRUCT_YY_BUFFER_STATE */
528
529/* Stack of input buffers. */
530static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
531static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
532static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
533
534/* We provide macros for accessing buffer states in case in the
535 * future we want to put the buffer states in a more general
536 * "scanner state".
537 *
538 * Returns the top of the stack, or NULL.
539 */
540#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
541 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
542 : NULL)
543/* Same as previous macro, but useful when we know that the buffer stack is not
544 * NULL or when we need an lvalue. For internal use only.
545 */
546#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
547
548/* yy_hold_char holds the character lost when yytext is formed. */
549static char yy_hold_char;
550static int yy_n_chars; /* number of characters read into yy_ch_buf */
552
553/* Points to current character in buffer. */
554static char *yy_c_buf_p = NULL;
555static int yy_init = 0; /* whether we need to initialize */
556static int yy_start = 0; /* start state number */
557
558/* Flag which is used to allow yywrap()'s to do buffer switches
559 * instead of setting up a fresh yyin. A bit of a hack ...
560 */
562
563void yyrestart ( FILE *input_file );
569void yypop_buffer_state ( void );
570
571static void yyensure_buffer_stack ( void );
572static void yy_load_buffer_state ( void );
573static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
574#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
575
578YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
579
580void *yyalloc ( yy_size_t );
581void *yyrealloc ( void *, yy_size_t );
582void yyfree ( void * );
583
584#define yy_new_buffer yy_create_buffer
585#define yy_set_interactive(is_interactive) \
586 { \
587 if ( ! YY_CURRENT_BUFFER ){ \
588 yyensure_buffer_stack (); \
589 YY_CURRENT_BUFFER_LVALUE = \
590 yy_create_buffer( yyin, YY_BUF_SIZE ); \
591 } \
592 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
593 }
594#define yy_set_bol(at_bol) \
595 { \
596 if ( ! YY_CURRENT_BUFFER ){\
597 yyensure_buffer_stack (); \
598 YY_CURRENT_BUFFER_LVALUE = \
599 yy_create_buffer( yyin, YY_BUF_SIZE ); \
600 } \
601 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
602 }
603#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
604
605/* Begin user sect3 */
606
607#define incwrap() (/*CONSTCOND*/1)
608#define YY_SKIP_YYWRAP
610
612
613typedef int yy_state_type;
614
615extern int yylineno;
616int yylineno = 1;
617
618extern char *yytext;
619#ifdef yytext_ptr
620#undef yytext_ptr
621#endif
622#define yytext_ptr yytext
623
626static int yy_get_next_buffer ( void );
627static void yynoreturn yy_fatal_error ( const char* msg );
628
629/* Done after the current pattern has been matched and before the
630 * corresponding action - sets up yytext.
631 */
632#define YY_DO_BEFORE_ACTION \
633 (yytext_ptr) = yy_bp; \
634 yyleng = (int) (yy_cp - yy_bp); \
635 (yy_hold_char) = *yy_cp; \
636 *yy_cp = '\0'; \
637 (yy_c_buf_p) = yy_cp;
638#define YY_NUM_RULES 21
639#define YY_END_OF_BUFFER 22
640/* This struct is not used in this scanner,
641 but its presence is necessary. */
642struct yy_trans_info
643 {
646 };
647static const flex_int16_t yy_acclist[76] =
648 { 0,
649 22, 18, 21, 18, 21, 19, 21, 18, 21, 18,
650 21, 18, 21, 15, 18, 21, 15, 18, 21, 4,
651 18, 21, 5, 18, 21, 18, 21, 18, 21, 15,
652 18, 21, 15, 18, 21, 15, 18, 21, 18, 21,
653 20, 16, 17, 15, 14, 15, 15, 15, 15, 20,
654 20, 3, 17, 15, 15, 15, 12, 15, 2, 15,
655 15, 1, 2, 15, 15, 15, 15, 13, 13, 6,
656 10, 7, 11, 9, 8
657 } ;
658
659static const flex_int16_t yy_accept[158] =
660 { 0,
661 1, 1, 1, 2, 4, 6, 8, 10, 12, 14,
662 17, 20, 23, 26, 28, 30, 33, 36, 39, 41,
663 41, 41, 42, 42, 42, 43, 44, 44, 45, 46,
664 47, 47, 47, 47, 47, 47, 47, 47, 47, 48,
665 49, 49, 50, 50, 51, 52, 52, 52, 53, 54,
666 55, 55, 55, 55, 55, 55, 56, 56, 56, 56,
667 57, 57, 57, 57, 58, 58, 59, 59, 60, 60,
668 60, 60, 60, 60, 61, 61, 61, 62, 62, 64,
669 64, 65, 65, 65, 66, 66, 67, 67, 67, 68,
670 68, 69, 69, 69, 70, 70, 70, 70, 70, 70,
671
672 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
673 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
674 70, 70, 70, 70, 71, 71, 71, 71, 71, 71,
675 71, 71, 71, 71, 71, 71, 71, 71, 71, 72,
676 72, 72, 72, 72, 72, 72, 73, 73, 74, 74,
677 74, 75, 75, 75, 75, 76, 76
678 } ;
679
680static const YY_CHAR yy_ec[256] =
681 { 0,
682 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
683 4, 4, 1, 1, 1, 1, 1, 1, 1, 1,
684 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
685 1, 2, 1, 5, 6, 1, 1, 1, 7, 8,
686 1, 9, 1, 1, 1, 1, 10, 11, 12, 13,
687 14, 11, 11, 11, 11, 15, 15, 1, 16, 1,
688 1, 1, 17, 1, 18, 19, 15, 20, 21, 15,
689 22, 23, 24, 25, 25, 26, 27, 28, 29, 30,
690 25, 31, 32, 33, 34, 25, 25, 25, 35, 25,
691 1, 36, 1, 1, 37, 1, 38, 39, 40, 41,
692
693 42, 43, 25, 25, 44, 25, 25, 45, 46, 47,
694 48, 49, 25, 50, 51, 52, 53, 54, 25, 55,
695 56, 25, 57, 1, 58, 59, 1, 1, 1, 1,
696 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
697 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
698 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
699 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
700 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
701 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
702 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
703
704 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
705 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
706 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
707 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
708 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
709 1, 1, 1, 1, 1
710 } ;
711
712static const YY_CHAR yy_meta[60] =
713 { 0,
714 1, 2, 3, 4, 5, 6, 7, 1, 8, 1,
715 9, 9, 9, 9, 10, 4, 7, 10, 10, 10,
716 10, 2, 2, 2, 2, 2, 2, 2, 2, 2,
717 2, 2, 2, 2, 2, 7, 2, 9, 9, 10,
718 10, 10, 9, 2, 2, 2, 11, 2, 2, 11,
719 2, 11, 2, 11, 11, 2, 1, 1, 1
720 } ;
721
722static const flex_int16_t yy_base[172] =
723 { 0,
724 0, 59, 457, 546, 449, 546, 6, 0, 3, 16,
725 21, 546, 546, 24, 12, 31, 69, 77, 394, 10,
726 34, 46, 91, 441, 546, 0, 80, 104, 546, 110,
727 39, 53, 125, 88, 405, 399, 133, 19, 136, 151,
728 386, 154, 374, 119, 169, 164, 0, 546, 0, 182,
729 185, 379, 354, 188, 203, 211, 176, 218, 250, 234,
730 349, 347, 240, 546, 29, 243, 388, 546, 387, 71,
731 236, 83, 0, 294, 342, 335, 297, 376, 546, 40,
732 300, 332, 332, 305, 106, 315, 361, 319, 321, 97,
733 324, 327, 352, 353, 161, 325, 314, 326, 320, 297,
734
735 139, 159, 315, 311, 287, 290, 269, 307, 140, 282,
736 285, 273, 251, 241, 277, 277, 162, 228, 223, 197,
737 270, 175, 192, 546, 160, 162, 136, 275, 115, 129,
738 98, 330, 148, 66, 348, 77, 363, 206, 546, 39,
739 368, 356, 215, 7, 223, 374, 231, 546, 380, 238,
740 546, 383, 255, 264, 546, 546, 397, 408, 419, 430,
741 440, 450, 460, 467, 478, 488, 491, 501, 512, 523,
742 534
743 } ;
744
745static const flex_int16_t yy_def[172] =
746 { 0,
747 157, 158, 156, 156, 156, 156, 159, 160, 156, 161,
748 161, 156, 156, 162, 156, 163, 163, 163, 156, 159,
749 159, 156, 164, 156, 156, 165, 156, 161, 156, 161,
750 162, 156, 162, 156, 156, 156, 166, 156, 163, 163,
751 156, 163, 156, 156, 156, 159, 167, 156, 165, 161,
752 166, 156, 156, 166, 166, 163, 168, 159, 159, 161,
753 156, 156, 166, 156, 156, 163, 168, 156, 169, 168,
754 168, 159, 59, 161, 156, 156, 163, 169, 156, 168,
755 161, 156, 156, 163, 168, 161, 156, 156, 163, 168,
756 156, 156, 156, 166, 168, 156, 156, 156, 156, 156,
757
758 156, 168, 156, 156, 156, 156, 156, 170, 168, 156,
759 156, 156, 156, 156, 170, 171, 168, 156, 156, 156,
760 156, 156, 171, 156, 156, 156, 156, 156, 156, 156,
761 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
762 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
763 156, 156, 156, 156, 156, 0, 156, 156, 156, 156,
764 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
765 156
766 } ;
767
768static const flex_int16_t yy_nxt[606] =
769 { 0,
770 4, 5, 6, 4, 7, 4, 8, 4, 4, 9,
771 22, 25, 26, 34, 22, 4, 4, 27, 27, 27,
772 55, 156, 27, 27, 27, 31, 156, 38, 20, 32,
773 55, 29, 37, 27, 27, 4, 29, 65, 22, 38,
774 31, 23, 68, 156, 32, 23, 29, 44, 45, 45,
775 20, 11, 35, 149, 34, 36, 12, 13, 4, 4,
776 14, 6, 4, 7, 15, 8, 4, 4, 9, 23,
777 37, 27, 27, 68, 4, 4, 30, 38, 37, 27,
778 27, 27, 27, 27, 29, 38, 144, 22, 17, 34,
779 17, 85, 29, 35, 4, 29, 36, 142, 40, 68,
780
781 40, 46, 46, 46, 46, 27, 27, 27, 68, 140,
782 18, 27, 27, 27, 80, 12, 13, 19, 23, 29,
783 44, 45, 45, 20, 136, 29, 51, 41, 35, 156,
784 156, 36, 42, 38, 37, 27, 27, 37, 27, 27,
785 101, 38, 68, 108, 38, 47, 95, 90, 29, 138,
786 139, 29, 37, 27, 27, 37, 27, 27, 50, 38,
787 135, 68, 38, 68, 68, 134, 29, 132, 22, 29,
788 44, 45, 45, 20, 58, 58, 58, 58, 68, 131,
789 40, 117, 40, 27, 27, 27, 51, 156, 156, 63,
790 156, 156, 130, 38, 124, 64, 65, 29, 102, 23,
791
792 156, 69, 56, 156, 55, 156, 156, 138, 139, 41,
793 109, 156, 37, 27, 27, 69, 147, 148, 156, 38,
794 70, 129, 22, 60, 150, 151, 29, 127, 72, 72,
795 72, 72, 147, 148, 71, 27, 27, 27, 68, 150,
796 151, 63, 156, 156, 37, 27, 27, 64, 65, 29,
797 126, 38, 66, 23, 22, 156, 154, 155, 29, 125,
798 73, 73, 73, 73, 73, 154, 155, 73, 73, 73,
799 73, 128, 128, 128, 74, 69, 128, 128, 128, 124,
800 70, 116, 122, 77, 121, 23, 133, 73, 73, 73,
801 73, 73, 73, 120, 71, 27, 27, 27, 37, 27,
802
803 27, 27, 27, 27, 119, 38, 37, 27, 27, 29,
804 118, 116, 29, 38, 114, 29, 91, 91, 91, 113,
805 29, 112, 94, 91, 91, 91, 91, 91, 92, 38,
806 29, 137, 137, 137, 111, 81, 29, 110, 84, 29,
807 107, 106, 86, 105, 104, 96, 103, 89, 97, 141,
808 141, 141, 98, 101, 94, 91, 91, 146, 146, 146,
809 93, 38, 92, 99, 137, 137, 137, 100, 29, 141,
810 141, 141, 88, 87, 143, 146, 146, 146, 79, 145,
811 145, 152, 152, 152, 152, 152, 152, 83, 82, 79,
812 68, 76, 75, 62, 153, 153, 153, 10, 10, 10,
813
814 10, 10, 10, 10, 10, 10, 10, 10, 16, 16,
815 16, 16, 16, 16, 16, 16, 16, 16, 16, 21,
816 21, 61, 21, 21, 21, 21, 21, 21, 21, 21,
817 24, 24, 57, 24, 24, 24, 24, 24, 24, 24,
818 24, 28, 28, 28, 43, 53, 52, 48, 28, 28,
819 28, 33, 43, 20, 33, 33, 156, 156, 33, 33,
820 33, 39, 39, 39, 156, 156, 156, 39, 39, 39,
821 39, 21, 156, 21, 156, 21, 156, 21, 49, 49,
822 156, 49, 49, 49, 49, 49, 49, 49, 49, 54,
823 54, 54, 156, 156, 156, 54, 54, 54, 54, 59,
824
825 59, 67, 67, 67, 67, 67, 67, 67, 67, 67,
826 67, 67, 78, 78, 78, 78, 78, 78, 78, 78,
827 78, 78, 78, 115, 115, 115, 115, 115, 115, 115,
828 115, 115, 115, 115, 123, 123, 123, 123, 123, 123,
829 123, 123, 123, 123, 123, 3, 156, 156, 156, 156,
830 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
831 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
832 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
833 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
834 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
835
836 156, 156, 156, 156, 156
837 } ;
838
839static const flex_int16_t yy_chk[606] =
840 { 0,
841 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
842 7, 9, 9, 15, 20, 1, 1, 10, 10, 10,
843 38, 0, 11, 11, 11, 14, 0, 38, 14, 14,
844 65, 10, 16, 16, 16, 1, 11, 65, 21, 16,
845 31, 7, 80, 31, 31, 20, 16, 22, 22, 22,
846 22, 1, 15, 144, 32, 15, 1, 1, 1, 2,
847 2, 2, 2, 2, 2, 2, 2, 2, 2, 21,
848 17, 17, 17, 70, 2, 2, 11, 17, 18, 18,
849 18, 27, 27, 27, 17, 18, 140, 72, 2, 34,
850 2, 80, 18, 32, 2, 27, 32, 136, 17, 90,
851
852 17, 23, 23, 23, 23, 28, 28, 28, 85, 134,
853 2, 30, 30, 30, 70, 2, 2, 2, 72, 28,
854 44, 44, 44, 44, 131, 30, 33, 17, 34, 33,
855 33, 34, 18, 33, 37, 37, 37, 39, 39, 39,
856 101, 37, 109, 101, 39, 23, 90, 85, 37, 133,
857 133, 39, 40, 40, 40, 42, 42, 42, 30, 40,
858 130, 102, 42, 95, 117, 129, 40, 127, 46, 42,
859 45, 45, 45, 45, 46, 46, 46, 46, 57, 126,
860 40, 109, 40, 50, 50, 50, 51, 51, 51, 54,
861 54, 54, 125, 51, 123, 54, 54, 50, 95, 46,
862
863 51, 117, 42, 54, 55, 55, 55, 138, 138, 40,
864 102, 55, 56, 56, 56, 57, 143, 143, 55, 56,
865 57, 122, 58, 50, 145, 145, 56, 120, 58, 58,
866 58, 58, 147, 147, 57, 60, 60, 60, 71, 150,
867 150, 63, 63, 63, 66, 66, 66, 63, 63, 60,
868 119, 66, 56, 58, 59, 63, 153, 153, 66, 118,
869 59, 59, 59, 59, 59, 154, 154, 59, 59, 59,
870 59, 121, 121, 121, 60, 71, 128, 128, 128, 116,
871 71, 115, 114, 66, 113, 59, 128, 59, 59, 59,
872 59, 59, 59, 112, 71, 74, 74, 74, 77, 77,
873
874 77, 81, 81, 81, 111, 77, 84, 84, 84, 74,
875 110, 108, 77, 84, 107, 81, 86, 86, 86, 106,
876 84, 105, 89, 89, 89, 91, 91, 91, 92, 89,
877 86, 132, 132, 132, 104, 74, 89, 103, 77, 91,
878 100, 99, 81, 98, 97, 92, 96, 84, 92, 135,
879 135, 135, 92, 93, 94, 94, 94, 142, 142, 142,
880 88, 94, 87, 92, 137, 137, 137, 92, 94, 141,
881 141, 141, 83, 82, 137, 146, 146, 146, 78, 141,
882 141, 149, 149, 149, 152, 152, 152, 76, 75, 69,
883 67, 62, 61, 53, 152, 152, 152, 157, 157, 157,
884
885 157, 157, 157, 157, 157, 157, 157, 157, 158, 158,
886 158, 158, 158, 158, 158, 158, 158, 158, 158, 159,
887 159, 52, 159, 159, 159, 159, 159, 159, 159, 159,
888 160, 160, 43, 160, 160, 160, 160, 160, 160, 160,
889 160, 161, 161, 161, 41, 36, 35, 24, 161, 161,
890 161, 162, 19, 5, 162, 162, 3, 0, 162, 162,
891 162, 163, 163, 163, 0, 0, 0, 163, 163, 163,
892 163, 164, 0, 164, 0, 164, 0, 164, 165, 165,
893 0, 165, 165, 165, 165, 165, 165, 165, 165, 166,
894 166, 166, 0, 0, 0, 166, 166, 166, 166, 167,
895
896 167, 168, 168, 168, 168, 168, 168, 168, 168, 168,
897 168, 168, 169, 169, 169, 169, 169, 169, 169, 169,
898 169, 169, 169, 170, 170, 170, 170, 170, 170, 170,
899 170, 170, 170, 170, 171, 171, 171, 171, 171, 171,
900 171, 171, 171, 171, 171, 156, 156, 156, 156, 156,
901 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
902 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
903 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
904 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
905 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
906
907 156, 156, 156, 156, 156
908 } ;
909
910/* Table of booleans, true if rule could match eol. */
912 { 0,
9131, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1,
914 1, 0, };
915
916extern int yy_flex_debug;
918
920static char *yy_full_match;
921static int yy_lp;
922#define REJECT \
923{ \
924*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \
925yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
926++(yy_lp); \
927goto find_rule; \
928}
929
930#define yymore() yymore_used_but_not_detected
931#define YY_MORE_ADJ 0
932#define YY_RESTORE_YY_MORE_OFFSET
933char *yytext;
934#line 1 "include.lex"
935#line 4 "include.lex"
936 #include <assert.h>
937 #include <sys/stat.h>
938 #include <sys/types.h>
939 #include "ast/allocator.h"
940
941 enum { FUNCTION, TYPEDEF };
942
943 typedef struct {
944 char * id, * file;
945 int line, type;
946 } Tag;
947
948 static Tag * tagsa = NULL;
949 static int ntags = 0, target = 1, keywords_only = 0, scope = 0, intypedef = 0;
950 static int warninclude = 0;
951 static FILE * swigfp = NULL;
952 static Allocator * alloc = NULL;
953
954 static void append_tag (Tag t) {
955 ntags++;
956 tagsa = realloc (tagsa, ntags*sizeof(Tag));
957 tagsa[ntags-1] = t;
958 tagsa[ntags-1].id = strdup (t.id);
959 tagsa[ntags-1].file = strdup (t.file);
960 tagsa[ntags-1].type = t.type;
961 char * page = strstr (tagsa[ntags-1].file, ".page");
962 if (page) *page = '\0';
963 }
964
965 static Tag * lookup_tag (const char * id) {
966 int i;
967 for (i = 0; i < ntags; i++)
968 if (!strcmp(tagsa[i].id, id))
969 return &tagsa[i];
970 return NULL;
971 }
972
973 static FILE * fdepend = NULL, * ftags = NULL, * myout = NULL;
974 static char * fname;
975
976 static char * paths[100] = { LIBDIR }, grid[80] = "";
977 static int npath = 1, hasgrid = 0, debug = 0;
978 static int dimension = 0, bghosts = 0, layers = 0, gpu = 0;
979 static int incode; // are we in code (or in a code block)?
980
981 static char * strip_path (char * s) {
982 char * s1 = s;
983 do {
984 while (*s1 != '/' && *s1 != '\0') s1++;
985 if (*s1 == '\0') return s;
986 } while (*(++s1) != '/');
987 while (*s1 == '/') s1++;
988 return s1;
989 }
990
991 static char * _stack[100]; int stack = -1;
992
993 static char * push (char * s) {
994 assert (stack + 1 < 100);
995 char * f = allocate (alloc, strlen (s) + 1);
996 strcpy (f, s);
997 _stack[++stack] = f;
998 return f;
999 }
1000
1001 static int strcmps (char * s1, char * s2) {
1002 while (*s1 != '\0' && *s2 != '\0') {
1003 if (*s1 != *s2)
1004 return 1;
1005 if (*s1 == '/') {
1006 while (*s1 == '/') s1++;
1007 while (*s2 == '/') s2++;
1008 }
1009 else
1010 s1++, s2++;
1011 }
1012 return !(*s1 == '\0' && *s2 == '\0');
1013 }
1014
1015 static void push_once (char * s) {
1016 static char * _processed[100];
1017 static int processed = 0;
1018 int i;
1019 char * s1 = strip_path (s);
1020 for (i = 0; i < processed; i++)
1021 if (!strcmps (s1, strip_path (_processed[i])))
1022 return; // already processed
1023 assert (processed < 100);
1024 _processed[processed++] = push (s);
1025 }
1026
1027 #define pop() _stack[stack--];
1028
1029 static void singleslash (char * path, FILE * fp)
1030 {
1031 char * s = path, slash = 0;
1032 while (*s != '\0') {
1033 if (*s == '/') {
1034 if (!slash)
1035 fputc (*s, fp);
1036 slash = 1;
1037 }
1038 else {
1039 slash = 0;
1040 fputc (*s, fp);
1041 }
1042 s++;
1043 }
1044 }
1045
1046 static FILE * openpath (const char * name, const char * mode, char ** path) {
1047 int i;
1048 for (i = npath; i >= 0; i--) {
1049 char * p = allocate (alloc, strlen (paths[i]) + strlen (name) + 3);
1050 strcpy (p, paths[i]); strcat (p, "//"); strcat (p, name);
1051 FILE * fp = fopen (p, mode);
1052 if (fp) {
1053 if (fdepend) {
1054 fputc ('\t', fdepend); singleslash (p, fdepend);
1055 fputs (" \\\n", fdepend);
1056 }
1057 *path = p;
1058 return fp;
1059 }
1060 }
1061 return NULL;
1062 }
1063
1064#define nonspace(s) { while (strchr(" \t\v\n\f", *s)) s++; }
1065#define space(s) { while (!strchr(" \t\v\n\f", *s)) s++; }
1066
1067 static char * shortpath (char * path) {
1068 char * file = strstr (path, LIBDIR);
1069 if (file == path)
1070 return file + strlen(LIBDIR) - strlen("src") - 1; // remove root
1071 else
1072 return path;
1073 }
1074
1075 static void check_tag (char * text) {
1076 if (ftags && keywords_only && incode) {
1077 Tag * t;
1078 if (target && (t = lookup_tag(text))) {
1079 switch (t->type) {
1080 case FUNCTION:
1081 if (debug)
1082 fprintf (stderr, "%s:%d: function call '%s'\n",
1083 fname, yylineno, text);
1084 break;
1085 case TYPEDEF:
1086 if (debug)
1087 fprintf (stderr, "%s:%d: typedef reference '%s'\n",
1088 fname, yylineno, text);
1089 break;
1090 }
1091 fprintf (ftags, "call %s %s %s\n",
1092 t->id, shortpath (t->file), t->id);
1093 }
1094 }
1095 }
1096
1097 static int yyerror(const char * s);
1098 static int comment(void);
1099 static void echo() {
1100 if (myout) {
1101 if (incode)
1102 fputs (yytext, myout);
1103 else { // only keep newlines
1104 char * s = yytext;
1105 while (*s != '\0') {
1106 if (*s == '\n')
1107 fputc ('\n', myout);
1108 s++;
1109 }
1110 }
1111 }
1112 }
1113
1114 static void echo_c (int c) {
1115 if (myout) {
1116 if (incode)
1117 fputc (c, myout);
1118 else if (c == '\n') // only keep newlines
1119 fputc ('\n', myout);
1120 }
1121 }
1122#line 1121 "include.c"
1123#line 1122 "include.c"
1124
1125#define INITIAL 0
1126
1127#ifndef YY_NO_UNISTD_H
1128/* Special case for "unistd.h", since it is non-ANSI. We include it way
1129 * down here because we want the user's section 1 to have been scanned first.
1130 * The user has a chance to override it with an option.
1131 */
1132#include <unistd.h>
1133#endif
1134
1135#ifndef YY_EXTRA_TYPE
1136#define YY_EXTRA_TYPE void *
1137#endif
1138
1139static int yy_init_globals ( void );
1140
1141/* Accessor methods to globals.
1142 These are made visible to non-reentrant scanners for convenience. */
1143
1144int yylex_destroy ( void );
1145
1146int yyget_debug ( void );
1147
1148void yyset_debug ( int debug_flag );
1149
1151
1153
1154FILE *yyget_in ( void );
1155
1156void yyset_in ( FILE * _in_str );
1157
1158FILE *yyget_out ( void );
1159
1160void yyset_out ( FILE * _out_str );
1161
1162 int yyget_leng ( void );
1163
1164char *yyget_text ( void );
1165
1166int yyget_lineno ( void );
1167
1168void yyset_lineno ( int _line_number );
1169
1170/* Macros after this point can all be overridden by user definitions in
1171 * section 1.
1172 */
1173
1174#ifndef YY_SKIP_YYWRAP
1175#ifdef __cplusplus
1176extern "C" int yywrap ( void );
1177#else
1178extern int yywrap ( void );
1179#endif
1180#endif
1181
1182#ifndef YY_NO_UNPUT
1183
1184 static void yyunput ( int c, char *buf_ptr );
1185
1186#endif
1187
1188#ifndef yytext_ptr
1189static void yy_flex_strncpy ( char *, const char *, int );
1190#endif
1191
1192#ifdef YY_NEED_STRLEN
1193static int yy_flex_strlen ( const char * );
1194#endif
1195
1196#ifndef YY_NO_INPUT
1197#ifdef __cplusplus
1198static int yyinput ( void );
1199#else
1200static int input ( void );
1201#endif
1202
1203#endif
1204
1205/* Amount of stuff to slurp up with each read. */
1206#ifndef YY_READ_BUF_SIZE
1207#ifdef __ia64__
1208/* On IA-64, the buffer size is 16k, not 8k */
1209#define YY_READ_BUF_SIZE 16384
1210#else
1211#define YY_READ_BUF_SIZE 8192
1212#endif /* __ia64__ */
1213#endif
1214
1215/* Copy whatever the last rule matched to the standard output. */
1216#ifndef ECHO
1217/* This used to be an fputs(), but since the string might contain NUL's,
1218 * we now use fwrite().
1219 */
1220#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
1221#endif
1222
1223/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1224 * is returned in "result".
1225 */
1226#ifndef YY_INPUT
1227#define YY_INPUT(buf,result,max_size) \
1228 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1229 { \
1230 int c = '*'; \
1231 int n; \
1232 for ( n = 0; n < max_size && \
1233 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1234 buf[n] = (char) c; \
1235 if ( c == '\n' ) \
1236 buf[n++] = (char) c; \
1237 if ( c == EOF && ferror( yyin ) ) \
1238 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1239 result = n; \
1240 } \
1241 else \
1242 { \
1243 errno=0; \
1244 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1245 { \
1246 if( errno != EINTR) \
1247 { \
1248 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1249 break; \
1250 } \
1251 errno=0; \
1252 clearerr(yyin); \
1253 } \
1254 }\
1255\
1256
1257#endif
1258
1259/* No semi-colon after return; correct usage is to write "yyterminate();" -
1260 * we don't want an extra ';' after the "return" because that will cause
1261 * some compilers to complain about unreachable statements.
1262 */
1263#ifndef yyterminate
1264#define yyterminate() return YY_NULL
1265#endif
1266
1267/* Number of entries by which start-condition stack grows. */
1268#ifndef YY_START_STACK_INCR
1269#define YY_START_STACK_INCR 25
1270#endif
1271
1272/* Report a fatal error. */
1273#ifndef YY_FATAL_ERROR
1274#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1275#endif
1276
1277/* end tables serialization structures and prototypes */
1278
1279/* Default declaration of generated scanner - a define so the user can
1280 * easily add parameters.
1281 */
1282#ifndef YY_DECL
1283#define YY_DECL_IS_OURS 1
1284
1285extern int yylex (void);
1286
1287#define YY_DECL int yylex (void)
1288#endif /* !YY_DECL */
1289
1290/* Code executed at the beginning of each rule, after yytext and yyleng
1291 * have been set up.
1292 */
1293#ifndef YY_USER_ACTION
1294#define YY_USER_ACTION
1295#endif
1296
1297/* Code executed at the end of each rule. */
1298#ifndef YY_BREAK
1299#define YY_BREAK /*LINTED*/break;
1300#endif
1301
1302#define YY_RULE_SETUP \
1303 if ( yyleng > 0 ) \
1304 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1305 (yytext[yyleng - 1] == '\n'); \
1306 YY_USER_ACTION
1307
1308/** The main scanner function which does all the work.
1309 */
1311{
1313 char *yy_cp, *yy_bp;
1314 int yy_act;
1315
1316 if ( !(yy_init) )
1317 {
1318 (yy_init) = 1;
1319
1320#ifdef YY_USER_INIT
1322#endif
1323
1324 /* Create the reject buffer large enough to save one state per allowed character. */
1325 if ( ! (yy_state_buf) )
1327 if ( ! (yy_state_buf) )
1328 YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
1329
1330 if ( ! (yy_start) )
1331 (yy_start) = 1; /* first start state */
1332
1333 if ( ! yyin )
1334 yyin = stdin;
1335
1336 if ( ! yyout )
1337 yyout = stdout;
1338
1339 if ( ! YY_CURRENT_BUFFER ) {
1343 }
1344
1346 }
1347
1348 {
1349#line 200 "include.lex"
1350
1351
1352#line 1351 "include.c"
1353
1354 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1355 {
1356 yy_cp = (yy_c_buf_p);
1357
1358 /* Support of yytext. */
1359 *yy_cp = (yy_hold_char);
1360
1361 /* yy_bp points to the position in yy_ch_buf of the start of
1362 * the current run.
1363 */
1364 yy_bp = yy_cp;
1365
1368
1371
1372yy_match:
1373 do
1374 {
1377 {
1379 if ( yy_current_state >= 157 )
1380 yy_c = yy_meta[yy_c];
1381 }
1384 ++yy_cp;
1385 }
1386 while ( yy_base[yy_current_state] != 546 );
1387
1391
1392find_rule: /* we branch to this label when backing up */
1393
1394 for ( ; ; ) /* until we find what rule we matched */
1395 {
1396 if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
1397 {
1398 yy_act = yy_acclist[(yy_lp)];
1399 {
1400 (yy_full_match) = yy_cp;
1401 break;
1402 }
1403 }
1404 --yy_cp;
1407 }
1408
1410
1412 {
1413 int yyl;
1414 for ( yyl = 0; yyl < yyleng; ++yyl )
1415 if ( yytext[yyl] == '\n' )
1416
1417 yylineno++;
1418;
1419 }
1420
1421do_action: /* This label is used only to access EOF actions. */
1422
1423 switch ( yy_act )
1424 { /* beginning of action switch */
1425case 1:
1426/* rule 1 can match eol */
1428#line 202 "include.lex"
1429{
1430 if (incode) {
1431 yylineno--;
1432 return yyerror ("code blocks cannot be nested");
1433 }
1434 incode = 1;
1435 if (myout) fputc ('\n', myout);
1436}
1437 YY_BREAK
1438case 2:
1439/* rule 2 can match eol */
1441#line 211 "include.lex"
1442{
1443 if (incode) {
1444 incode = 0;
1445 if (myout) fputc ('\n', myout);
1446 }
1447}
1448 YY_BREAK
1449case 3:
1451#line 218 "include.lex"
1452{
1453 echo(); // quoted character
1454}
1455 YY_BREAK
1456case 4:
1458#line 222 "include.lex"
1459{
1460 scope++;
1461}
1462 YY_BREAK
1463case 5:
1465#line 226 "include.lex"
1466{
1467 scope--;
1468 if (scope < 0) {
1469 if (warninclude)
1470 fprintf (stderr, "%s:%d: warning: mismatched '}'\n", fname, yylineno);
1471 else {
1472 fprintf (stderr, "%s:%d: error: mismatched '}'\n", fname, yylineno);
1473 exit (1);
1474 }
1475 scope = 0;
1476 }
1477}
1478 YY_BREAK
1479case 6:
1480/* rule 6 can match eol */
1482#line 239 "include.lex"
1483{
1484 // include "..."
1485 if (fdepend && strstr (yytext, "// nodep"))
1486 return 0;
1487 echo();
1488 if (!keywords_only) {
1489 char * s = strchr(yytext, '"');
1490 s++;
1491 char * e = &s[strlen(s) - 1];
1492 while (*e != '"') {
1493 *e = '\0'; e--;
1494 }
1495 *e = '\0';
1496 char * path;
1497 FILE * fp = openpath (s, "r", &path);
1498 if (fp != NULL) {
1499 push_once (path);
1500 if (ftags && target) {
1501 fputs ("incl ", ftags);
1503 fprintf (ftags, " %s %d\n", fname, yylineno - 1);
1504 }
1505 if (swigfp && target) {
1506 char * dot = strstr (path, ".h");
1507 if (dot) {
1508 strcpy (dot, ".i");
1509 fputs ("%include \"", swigfp);
1511 fputs ("\"\n", swigfp);
1512 }
1513 }
1514 fclose (fp);
1515 }
1516 else {
1517 fprintf (stderr, "%s:%d: %s: %s: No such file or directory\n",
1518 fname, yylineno - 1, warninclude ? "warning" : "error", s);
1519 if (!warninclude)
1520 return 1;
1521 }
1522 }
1523}
1524 YY_BREAK
1525case 7:
1526/* rule 7 can match eol */
1528#line 281 "include.lex"
1529{
1530 echo();
1531 if (grid[0] == '\0' && !hasgrid) {
1532 hasgrid = 1;
1533 char * s = fname;
1534 while (strchr (s, '/')) {
1535 s = strchr (s, '/') + 1;
1536 if (!strncmp (s, "grid/", 5)) {
1537 s += 5;
1538 break;
1539 }
1540 }
1541 strcpy (grid, s);
1542 if ((s = strchr (grid, '.'))) *s = '\0';
1543 }
1544}
1545 YY_BREAK
1546case 8:
1547/* rule 8 can match eol */
1548*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
1550(yy_c_buf_p) = yy_cp -= 1;
1551YY_DO_BEFORE_ACTION; /* set up yytext again */
1553#line 298 "include.lex"
1554{
1555 char * s = strstr (yytext, "dimension");
1556 space(s); nonspace(s);
1557 dimension = atoi(s);
1558}
1559 YY_BREAK
1560case 9:
1561/* rule 9 can match eol */
1562*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
1564(yy_c_buf_p) = yy_cp -= 1;
1565YY_DO_BEFORE_ACTION; /* set up yytext again */
1567#line 304 "include.lex"
1568{
1569 char * s = strstr (yytext, "BGHOSTS");
1570 space(s); nonspace(s);
1571 bghosts = atoi(s);
1572}
1573 YY_BREAK
1574case 10:
1575/* rule 10 can match eol */
1576*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
1578(yy_c_buf_p) = yy_cp -= 1;
1579YY_DO_BEFORE_ACTION; /* set up yytext again */
1581#line 310 "include.lex"
1582{
1583 gpu = 1;
1584}
1585 YY_BREAK
1586case 11:
1587/* rule 11 can match eol */
1588*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
1590(yy_c_buf_p) = yy_cp -= 1;
1591YY_DO_BEFORE_ACTION; /* set up yytext again */
1593#line 314 "include.lex"
1594{
1595 layers = 1;
1596}
1597 YY_BREAK
1598case 12:
1600#line 318 "include.lex"
1601{
1602 // function definition
1603 echo();
1604 if (ftags && scope == 0) {
1605 // fprintf (stderr, "'%s'\n", yytext);
1606 char * s = yytext; int nl = 0;
1607 int fstatic = 0;
1608 s = strtok (s, " \t\v\n\f(");
1609 char * id = s;
1610 while (s) {
1611#if 0 // ignore static functions
1612 if (!strcmp (s, "static"))
1613 fstatic = 1;
1614#endif
1615 id = s;
1616 s = strtok (NULL, " \t\v\n\f(");
1617 if (s)
1618 check_tag (id);
1619 }
1620 s = strdup (id);
1621 if (!fstatic && !keywords_only && strcmp(s, "if")) {
1622 // fprintf (stderr, "id: '%s'\n", s);
1623 Tag t = { s, fname, yylineno - nl, FUNCTION};
1624 int p = 0, para = 1, c;
1625 while (para > p && (c = input())) {
1626 echo_c (c);
1627 if (c == '(') para++;
1628 else if (c == ')') para--;
1629 }
1630 if (c == ')') {
1631 while ((c = input())) {
1632 echo_c (c);
1633 if (c == '{' || c == ';')
1634 break;
1635 if (!strchr(" \t\v\n\f", c))
1636 break;
1637 }
1638 if (c == '{') {
1639 scope++;
1640 append_tag (t);
1641 if (debug)
1642 fprintf (stderr, "%s:%d: function declaration '%s'\n",
1643 tagsa[ntags-1].file, tagsa[ntags-1].line,
1644 tagsa[ntags-1].id);
1645 if (target)
1646 fprintf (ftags, "decl %s %s %d\n",
1647 tagsa[ntags-1].id, tagsa[ntags-1].file,
1648 tagsa[ntags-1].line);
1649 }
1650 }
1651 }
1652 free (s);
1653 }
1654}
1655 YY_BREAK
1656case 13:
1657/* rule 13 can match eol */
1659#line 373 "include.lex"
1660{
1661 echo();
1662 if (ftags && !keywords_only)
1663 intypedef = scope + 1;
1664}
1665 YY_BREAK
1666case 14:
1667/* rule 14 can match eol */
1669#line 379 "include.lex"
1670{
1671 if (intypedef && scope == intypedef - 1) {
1672 echo();
1673 char * s = yytext; space(s); *s-- = '\0';
1674 if (*s == ';')
1675 *s = '\0';
1676 Tag t = { yytext, fname, yylineno, TYPEDEF};
1677 append_tag (t);
1678 if (debug)
1679 fprintf (stderr, "%s:%d: typedef '%s'\n",
1680 tagsa[ntags-1].file, tagsa[ntags-1].line, tagsa[ntags-1].id);
1681 if (target)
1682 fprintf (ftags, "decl %s %s %d\n",
1683 tagsa[ntags-1].id, tagsa[ntags-1].file, tagsa[ntags-1].line);
1684 intypedef = 0;
1685 }
1686 else
1687 REJECT;
1688}
1689 YY_BREAK
1690case 15:
1692#line 399 "include.lex"
1693{
1694 // keyword in target
1695 echo();
1696 check_tag (yytext);
1697}
1698 YY_BREAK
1699case 16:
1701#line 405 "include.lex"
1702{ echo(); if (incode && comment()) return 1; }
1703 YY_BREAK
1704case 17:
1706#line 406 "include.lex"
1707{
1708 if (!incode)
1709 REJECT;
1710 /* consume //-comment */
1711 echo();
1712}
1713 YY_BREAK
1714case 18:
1716#line 412 "include.lex"
1717echo();
1718 YY_BREAK
1719case 19:
1720/* rule 19 can match eol */
1722#line 413 "include.lex"
1723echo();
1724 YY_BREAK
1725case 20:
1726/* rule 20 can match eol */
1728#line 414 "include.lex"
1729echo(); /* STRING_LITERAL */
1730 YY_BREAK
1731case 21:
1733#line 416 "include.lex"
1734ECHO;
1735 YY_BREAK
1736#line 1735 "include.c"
1737 case YY_STATE_EOF(INITIAL):
1738 yyterminate();
1739
1740 case YY_END_OF_BUFFER:
1741 {
1742 /* Amount of text matched not including the EOB char. */
1744
1745 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1746 *yy_cp = (yy_hold_char);
1748
1749 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1750 {
1751 /* We're scanning a new file or input source. It's
1752 * possible that this happened because the user
1753 * just pointed yyin at a new source and called
1754 * yylex(). If so, then we have to assure
1755 * consistency between YY_CURRENT_BUFFER and our
1756 * globals. Here is the right place to do so, because
1757 * this is the first action (other than possibly a
1758 * back-up) that will match for the new input source.
1759 */
1760 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1761 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1762 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1763 }
1764
1765 /* Note that here we test for yy_c_buf_p "<=" to the position
1766 * of the first EOB in the buffer, since yy_c_buf_p will
1767 * already have been incremented past the NUL character
1768 * (since all states make transitions on EOB to the
1769 * end-of-buffer state). Contrast this with the test
1770 * in input().
1771 */
1772 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1773 { /* This was really a NUL. */
1775
1777
1779
1780 /* Okay, we're now positioned to make the NUL
1781 * transition. We couldn't have
1782 * yy_get_previous_state() go ahead and do it
1783 * for us because it doesn't know how to deal
1784 * with the possibility of jamming (and we don't
1785 * want to build jamming into it because then it
1786 * will run more slowly).
1787 */
1788
1790
1792
1793 if ( yy_next_state )
1794 {
1795 /* Consume the NUL. */
1796 yy_cp = ++(yy_c_buf_p);
1798 goto yy_match;
1799 }
1800
1801 else
1802 {
1803 yy_cp = (yy_c_buf_p);
1804 goto yy_find_action;
1805 }
1806 }
1807
1808 else switch ( yy_get_next_buffer( ) )
1809 {
1811 {
1813
1814 if ( yywrap( ) )
1815 {
1816 /* Note: because we've taken care in
1817 * yy_get_next_buffer() to have set up
1818 * yytext, we can now set up
1819 * yy_c_buf_p so that if some total
1820 * hoser (like flex itself) wants to
1821 * call the scanner after we return the
1822 * YY_NULL, it'll still work - another
1823 * YY_NULL will get returned.
1824 */
1826
1828 goto do_action;
1829 }
1830
1831 else
1832 {
1835 }
1836 break;
1837 }
1838
1840 (yy_c_buf_p) =
1842
1844
1845 yy_cp = (yy_c_buf_p);
1847 goto yy_match;
1848
1849 case EOB_ACT_LAST_MATCH:
1850 (yy_c_buf_p) =
1851 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1852
1854
1855 yy_cp = (yy_c_buf_p);
1857 goto yy_find_action;
1858 }
1859 break;
1860 }
1861
1862 default:
1864 "fatal flex scanner internal error--no action found" );
1865 } /* end of action switch */
1866 } /* end of scanning one token */
1867 } /* end of user's declarations */
1868} /* end of yylex */
1869
1870/* yy_get_next_buffer - try to read in a new buffer
1871 *
1872 * Returns a code representing an action:
1873 * EOB_ACT_LAST_MATCH -
1874 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1875 * EOB_ACT_END_OF_FILE - end of file
1876 */
1877static int yy_get_next_buffer (void)
1878{
1879 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1880 char *source = (yytext_ptr);
1881 int number_to_move, i;
1882 int ret_val;
1883
1884 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1886 "fatal flex scanner internal error--end of buffer missed" );
1887
1888 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1889 { /* Don't try to fill the buffer, so this is an EOF. */
1890 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1891 {
1892 /* We matched a single character, the EOB, so
1893 * treat this as a final EOF.
1894 */
1895 return EOB_ACT_END_OF_FILE;
1896 }
1897
1898 else
1899 {
1900 /* We matched some text prior to the EOB, first
1901 * process it.
1902 */
1903 return EOB_ACT_LAST_MATCH;
1904 }
1905 }
1906
1907 /* Try to read more data. */
1908
1909 /* First move last chars to start of buffer. */
1910 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1911
1912 for ( i = 0; i < number_to_move; ++i )
1913 *(dest++) = *(source++);
1914
1915 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1916 /* don't do the read, it's not guaranteed to return an EOF,
1917 * just force an EOF
1918 */
1919 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1920
1921 else
1922 {
1923 int num_to_read =
1924 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1925
1926 while ( num_to_read <= 0 )
1927 { /* Not enough room in the buffer - grow it. */
1928
1930"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1931
1932 }
1933
1936
1937 /* Read in more data. */
1940
1941 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1942 }
1943
1944 if ( (yy_n_chars) == 0 )
1945 {
1946 if ( number_to_move == YY_MORE_ADJ )
1947 {
1949 yyrestart( yyin );
1950 }
1951
1952 else
1953 {
1955 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1957 }
1958 }
1959
1960 else
1962
1963 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1964 /* Extend the array by 50%, plus the number we really need. */
1965 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1966 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1967 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1968 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1969 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1970 /* "- 2" to take care of EOB's */
1971 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1972 }
1973
1977
1978 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1979
1980 return ret_val;
1981}
1982
1983/* yy_get_previous_state - get the state just before the EOB char was reached */
1984
1986{
1988 char *yy_cp;
1989
1992
1995
1996 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1997 {
1998 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2000 {
2002 if ( yy_current_state >= 157 )
2003 yy_c = yy_meta[yy_c];
2004 }
2007 }
2008
2009 return yy_current_state;
2010}
2011
2012/* yy_try_NUL_trans - try to make a transition on the NUL character
2013 *
2014 * synopsis
2015 * next_state = yy_try_NUL_trans( current_state );
2016 */
2018{
2019 int yy_is_jam;
2020
2021 YY_CHAR yy_c = 1;
2023 {
2025 if ( yy_current_state >= 157 )
2026 yy_c = yy_meta[yy_c];
2027 }
2029 yy_is_jam = (yy_current_state == 156);
2030 if ( ! yy_is_jam )
2032
2033 return yy_is_jam ? 0 : yy_current_state;
2034}
2035
2036#ifndef YY_NO_UNPUT
2037
2038 static void yyunput (int c, char * yy_bp )
2039{
2040 char *yy_cp;
2041
2042 yy_cp = (yy_c_buf_p);
2043
2044 /* undo effects of setting up yytext */
2045 *yy_cp = (yy_hold_char);
2046
2047 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2048 { /* need to shift things up to make room */
2049 /* +2 for EOB chars. */
2050 int number_to_move = (yy_n_chars) + 2;
2051 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2052 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2053 char *source =
2055
2056 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2057 *--dest = *--source;
2058
2059 yy_cp += (int) (dest - source);
2060 yy_bp += (int) (dest - source);
2061 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2062 (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2063
2064 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2065 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2066 }
2067
2068 *--yy_cp = (char) c;
2069
2070 if ( c == '\n' ){
2071 --yylineno;
2072 }
2073
2074 (yytext_ptr) = yy_bp;
2075 (yy_hold_char) = *yy_cp;
2076 (yy_c_buf_p) = yy_cp;
2077}
2078
2079#endif
2080
2081#ifndef YY_NO_INPUT
2082#ifdef __cplusplus
2083 static int yyinput (void)
2084#else
2085 static int input (void)
2086#endif
2087
2088{
2089 int c;
2090
2091 *(yy_c_buf_p) = (yy_hold_char);
2092
2094 {
2095 /* yy_c_buf_p now points to the character we want to return.
2096 * If this occurs *before* the EOB characters, then it's a
2097 * valid NUL; if not, then we've hit the end of the buffer.
2098 */
2099 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2100 /* This was really a NUL. */
2101 *(yy_c_buf_p) = '\0';
2102
2103 else
2104 { /* need more input */
2105 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
2106 ++(yy_c_buf_p);
2107
2108 switch ( yy_get_next_buffer( ) )
2109 {
2110 case EOB_ACT_LAST_MATCH:
2111 /* This happens because yy_g_n_b()
2112 * sees that we've accumulated a
2113 * token and flags that we need to
2114 * try matching the token before
2115 * proceeding. But for input(),
2116 * there's no matching to consider.
2117 * So convert the EOB_ACT_LAST_MATCH
2118 * to EOB_ACT_END_OF_FILE.
2119 */
2120
2121 /* Reset buffer status. */
2122 yyrestart( yyin );
2123
2124 /*FALLTHROUGH*/
2125
2127 {
2128 if ( yywrap( ) )
2129 return 0;
2130
2133#ifdef __cplusplus
2134 return yyinput();
2135#else
2136 return input();
2137#endif
2138 }
2139
2141 (yy_c_buf_p) = (yytext_ptr) + offset;
2142 break;
2143 }
2144 }
2145 }
2146
2147 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2148 *(yy_c_buf_p) = '\0'; /* preserve yytext */
2149 (yy_hold_char) = *++(yy_c_buf_p);
2150
2151 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2152 if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol )
2153
2154 yylineno++;
2155;
2156
2157 return c;
2158}
2159#endif /* ifndef YY_NO_INPUT */
2160
2161/** Immediately switch to a different input stream.
2162 * @param input_file A readable stream.
2163 *
2164 * @note This function does not reset the start condition to @c INITIAL .
2165 */
2178
2179/** Switch to a different input buffer.
2180 * @param new_buffer The new input buffer.
2181 *
2182 */
2184{
2185
2186 /* TODO. We should be able to replace this entire function body
2187 * with
2188 * yypop_buffer_state();
2189 * yypush_buffer_state(new_buffer);
2190 */
2193 return;
2194
2195 if ( YY_CURRENT_BUFFER )
2196 {
2197 /* Flush out information for old buffer. */
2198 *(yy_c_buf_p) = (yy_hold_char);
2199 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2200 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2201 }
2202
2205
2206 /* We don't actually know whether we did this switch during
2207 * EOF (yywrap()) processing, but the only time this flag
2208 * is looked at is after yywrap() is called, so it's safe
2209 * to go ahead and always set it.
2210 */
2212}
2213
2214static void yy_load_buffer_state (void)
2215{
2216 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2218 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2219 (yy_hold_char) = *(yy_c_buf_p);
2220}
2221
2222/** Allocate and initialize an input buffer state.
2223 * @param file A readable stream.
2224 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2225 *
2226 * @return the allocated buffer state.
2227 */
2229{
2231
2232 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2233 if ( ! b )
2234 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2235
2236 b->yy_buf_size = size;
2237
2238 /* yy_ch_buf has to be 2 characters longer than the size given because
2239 * we need to put in 2 end-of-buffer characters.
2240 */
2241 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
2242 if ( ! b->yy_ch_buf )
2243 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2244
2245 b->yy_is_our_buffer = 1;
2246
2247 yy_init_buffer( b, file );
2248
2249 return b;
2250}
2251
2252/** Destroy the buffer.
2253 * @param b a buffer created with yy_create_buffer()
2254 *
2255 */
2257{
2258
2259 if ( ! b )
2260 return;
2261
2262 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2264
2265 if ( b->yy_is_our_buffer )
2266 yyfree( (void *) b->yy_ch_buf );
2267
2268 yyfree( (void *) b );
2269}
2270
2271/* Initializes or reinitializes a buffer.
2272 * This function is sometimes called more than once on the same buffer,
2273 * such as during a yyrestart() or at EOF.
2274 */
2276
2277{
2278 int oerrno = errno;
2279
2280 yy_flush_buffer( b );
2281
2282 b->yy_input_file = file;
2283 b->yy_fill_buffer = 1;
2284
2285 /* If b is the current buffer, then yy_init_buffer was _probably_
2286 * called from yyrestart() or through yy_get_next_buffer.
2287 * In that case, we don't want to reset the lineno or column.
2288 */
2289 if (b != YY_CURRENT_BUFFER){
2290 b->yy_bs_lineno = 1;
2291 b->yy_bs_column = 0;
2292 }
2293
2294 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2295
2296 errno = oerrno;
2297}
2298
2299/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2300 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2301 *
2302 */
2304{
2305 if ( ! b )
2306 return;
2307
2308 b->yy_n_chars = 0;
2309
2310 /* We always need two end-of-buffer characters. The first causes
2311 * a transition to the end-of-buffer state. The second causes
2312 * a jam in that state.
2313 */
2314 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2315 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2316
2317 b->yy_buf_pos = &b->yy_ch_buf[0];
2318
2319 b->yy_at_bol = 1;
2320 b->yy_buffer_status = YY_BUFFER_NEW;
2321
2322 if ( b == YY_CURRENT_BUFFER )
2324}
2325
2326/** Pushes the new state onto the stack. The new state becomes
2327 * the current state. This function will allocate the stack
2328 * if necessary.
2329 * @param new_buffer The new state.
2330 *
2331 */
2333{
2334 if (new_buffer == NULL)
2335 return;
2336
2338
2339 /* This block is copied from yy_switch_to_buffer. */
2340 if ( YY_CURRENT_BUFFER )
2341 {
2342 /* Flush out information for old buffer. */
2343 *(yy_c_buf_p) = (yy_hold_char);
2344 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2345 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2346 }
2347
2348 /* Only push if top exists. Otherwise, replace top. */
2352
2353 /* copied from yy_switch_to_buffer. */
2356}
2357
2358/** Removes and deletes the top of the stack, if present.
2359 * The next element becomes the new top.
2360 *
2361 */
2363{
2364 if (!YY_CURRENT_BUFFER)
2365 return;
2366
2369 if ((yy_buffer_stack_top) > 0)
2371
2372 if (YY_CURRENT_BUFFER) {
2375 }
2376}
2377
2378/* Allocates the stack if it does not exist.
2379 * Guarantees space for at least one push.
2380 */
2381static void yyensure_buffer_stack (void)
2382{
2384
2385 if (!(yy_buffer_stack)) {
2386
2387 /* First allocation is just for 2 elements, since we don't know if this
2388 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2389 * immediate realloc on the next call.
2390 */
2391 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2393 (num_to_alloc * sizeof(struct yy_buffer_state*)
2394 );
2395 if ( ! (yy_buffer_stack) )
2396 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2397
2398 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2399
2401 (yy_buffer_stack_top) = 0;
2402 return;
2403 }
2404
2405 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2406
2407 /* Increase the buffer to prepare for a possible push. */
2408 yy_size_t grow_size = 8 /* arbitrary grow size */;
2409
2412 ((yy_buffer_stack),
2413 num_to_alloc * sizeof(struct yy_buffer_state*)
2414 );
2415 if ( ! (yy_buffer_stack) )
2416 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2417
2418 /* zero only the new slots.*/
2421 }
2422}
2423
2424/** Setup the input buffer state to scan directly from a user-specified character buffer.
2425 * @param base the character buffer
2426 * @param size the size in bytes of the character buffer
2427 *
2428 * @return the newly allocated buffer state object.
2429 */
2431{
2433
2434 if ( size < 2 ||
2437 /* They forgot to leave room for the EOB's. */
2438 return NULL;
2439
2440 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2441 if ( ! b )
2442 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2443
2444 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2445 b->yy_buf_pos = b->yy_ch_buf = base;
2446 b->yy_is_our_buffer = 0;
2447 b->yy_input_file = NULL;
2448 b->yy_n_chars = b->yy_buf_size;
2449 b->yy_is_interactive = 0;
2450 b->yy_at_bol = 1;
2451 b->yy_fill_buffer = 0;
2452 b->yy_buffer_status = YY_BUFFER_NEW;
2453
2455
2456 return b;
2457}
2458
2459/** Setup the input buffer state to scan a string. The next call to yylex() will
2460 * scan from a @e copy of @a str.
2461 * @param yystr a NUL-terminated string to scan
2462 *
2463 * @return the newly allocated buffer state object.
2464 * @note If you want to scan bytes that may contain NUL values, then use
2465 * yy_scan_bytes() instead.
2466 */
2468{
2469
2470 return yy_scan_bytes( yystr, (int) strlen(yystr) );
2471}
2472
2473/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2474 * scan from a @e copy of @a bytes.
2475 * @param yybytes the byte buffer to scan
2476 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2477 *
2478 * @return the newly allocated buffer state object.
2479 */
2481{
2483 char *buf;
2484 yy_size_t n;
2485 int i;
2486
2487 /* Get memory for full buffer, including space for trailing EOB's. */
2488 n = (yy_size_t) (_yybytes_len + 2);
2489 buf = (char *) yyalloc( n );
2490 if ( ! buf )
2491 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2492
2493 for ( i = 0; i < _yybytes_len; ++i )
2494 buf[i] = yybytes[i];
2495
2497
2498 b = yy_scan_buffer( buf, n );
2499 if ( ! b )
2500 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2501
2502 /* It's okay to grow etc. this buffer, and we should throw it
2503 * away when we're done.
2504 */
2505 b->yy_is_our_buffer = 1;
2506
2507 return b;
2508}
2509
2510#ifndef YY_EXIT_FAILURE
2511#define YY_EXIT_FAILURE 2
2512#endif
2513
2514static void yynoreturn yy_fatal_error (const char* msg )
2515{
2516 fprintf( stderr, "%s\n", msg );
2518}
2519
2520/* Redefine yyless() so it works in section 3 code. */
2521
2522#undef yyless
2523#define yyless(n) \
2524 do \
2525 { \
2526 /* Undo effects of setting up yytext. */ \
2527 int yyless_macro_arg = (n); \
2528 YY_LESS_LINENO(yyless_macro_arg);\
2529 yytext[yyleng] = (yy_hold_char); \
2530 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2531 (yy_hold_char) = *(yy_c_buf_p); \
2532 *(yy_c_buf_p) = '\0'; \
2533 yyleng = yyless_macro_arg; \
2534 } \
2535 while ( 0 )
2536
2537/* Accessor methods (get/set functions) to struct members. */
2538
2539/** Get the current line number.
2540 *
2541 */
2543{
2544
2545 return yylineno;
2546}
2547
2548/** Get the input stream.
2549 *
2550 */
2552{
2553 return yyin;
2554}
2555
2556/** Get the output stream.
2557 *
2558 */
2560{
2561 return yyout;
2562}
2563
2564/** Get the length of the current token.
2565 *
2566 */
2567int yyget_leng (void)
2568{
2569 return yyleng;
2570}
2571
2572/** Get the current token.
2573 *
2574 */
2575
2576char *yyget_text (void)
2577{
2578 return yytext;
2579}
2580
2581/** Set the current line number.
2582 * @param _line_number line number
2583 *
2584 */
2586{
2587
2589}
2590
2591/** Set the input stream. This does not discard the current
2592 * input buffer.
2593 * @param _in_str A readable stream.
2594 *
2595 * @see yy_switch_to_buffer
2596 */
2598{
2599 yyin = _in_str ;
2600}
2601
2603{
2604 yyout = _out_str ;
2605}
2606
2607int yyget_debug (void)
2608{
2609 return yy_flex_debug;
2610}
2611
2613{
2615}
2616
2617static int yy_init_globals (void)
2618{
2619 /* Initialization is the same as for the non-reentrant scanner.
2620 * This function is called from yylex_destroy(), so don't allocate here.
2621 */
2622
2623 /* We do not touch yylineno unless the option is enabled. */
2624 yylineno = 1;
2625
2627 (yy_buffer_stack_top) = 0;
2628 (yy_buffer_stack_max) = 0;
2629 (yy_c_buf_p) = NULL;
2630 (yy_init) = 0;
2631 (yy_start) = 0;
2632
2633 (yy_state_buf) = 0;
2634 (yy_state_ptr) = 0;
2635 (yy_full_match) = 0;
2636 (yy_lp) = 0;
2637
2638/* Defined in main.c */
2639#ifdef YY_STDINIT
2640 yyin = stdin;
2641 yyout = stdout;
2642#else
2643 yyin = NULL;
2644 yyout = NULL;
2645#endif
2646
2647 /* For future reference: Set errno on error, since we are called by
2648 * yylex_init()
2649 */
2650 return 0;
2651}
2652
2653/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2655{
2656
2657 /* Pop the buffer stack, destroying each element. */
2658 while(YY_CURRENT_BUFFER){
2662 }
2663
2664 /* Destroy the stack itself. */
2667
2668 yyfree ( (yy_state_buf) );
2669 (yy_state_buf) = NULL;
2670
2671 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2672 * yylex() is called, initialization will occur. */
2673 yy_init_globals( );
2674
2675 return 0;
2676}
2677
2678/*
2679 * Internal utility routines.
2680 */
2681
2682#ifndef yytext_ptr
2683static void yy_flex_strncpy (char* s1, const char * s2, int n )
2684{
2685
2686 int i;
2687 for ( i = 0; i < n; ++i )
2688 s1[i] = s2[i];
2689}
2690#endif
2691
2692#ifdef YY_NEED_STRLEN
2693static int yy_flex_strlen (const char * s )
2694{
2695 int n;
2696 for ( n = 0; s[n]; ++n )
2697 ;
2698
2699 return n;
2700}
2701#endif
2702
2704{
2705 return malloc(size);
2706}
2707
2708void *yyrealloc (void * ptr, yy_size_t size )
2709{
2710
2711 /* The cast to (char *) in the following accommodates both
2712 * implementations that use char* generic pointers, and those
2713 * that use void* generic pointers. It works with the latter
2714 * because both ANSI C and C++ allow castless assignment from
2715 * any pointer type to void*, and deal with argument conversions
2716 * as though doing an assignment.
2717 */
2718 return realloc(ptr, size);
2719}
2720
2721void yyfree (void * ptr )
2722{
2723 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2724}
2725
2726#define YYTABLES_NAME "yytables"
2727
2728#line 416 "include.lex"
2729
2730
2731int yyerror (const char * s)
2732{
2733 if (0) yyunput (0, NULL); // just prevents 'yyunput unused' compiler warning
2734 fprintf (stderr, "%s:%d: error: %s\n", fname, yylineno, s);
2735 return 1;
2736}
2737
2738static int getput(void)
2739{
2740 int c = input();
2741 if (myout)
2742 fputc (c, myout);
2743 return c;
2744}
2745
2746static int comment(void)
2747{
2748 int c, lineno = yylineno;
2749 while ((c = getput())) {
2750 if (c == '*') {
2751 while ((c = getput()) == '*')
2752 ;
2753 if (c == '/')
2754 return 0;
2755 if (c == 0)
2756 break;
2757 }
2758 }
2759 fprintf (stderr, "%s:%d: warning: unterminated comment\n", fname, lineno);
2760 return 0;
2761}
2762
2763void stripname (char * path)
2764{
2765 char * s = &path[strlen(path)];
2766 while (s != path && *s != '/')
2767 *s-- = '\0';
2768 if (s == path)
2769 strcpy (path, ".");
2770 else
2771 *s = '\0';
2772}
2773
2774char * stripslash (char * path)
2775{
2776 char * strip = malloc (strlen (path) + 1), * s = path, * o = strip;
2777 int slash = 0;
2778 do {
2779 if (*s == '/') {
2780 if (!slash)
2781 *o++ = *s;
2782 slash = 1;
2783 }
2784 else {
2785 *o++ = *s;
2786 slash = 0;
2787 }
2788 } while (*s++ != '\0');
2789 return strip;
2790}
2791
2792static int is_code (const char * file)
2793{
2794 // check whether file has a .c or .h extension
2795 char * s = strstr (file, ".c");
2796 if (!s)
2797 s = strstr (file, ".h");
2798 return s && (s[2] == '\0' || s[2] == '.');
2799}
2800
2801static int include (char * file, FILE * fin, FILE * fout)
2802{
2803 fname = stripslash (file);
2804 paths[npath] = allocate (alloc, strlen (file) + 1);
2805 strcpy (paths[npath], file);
2807 yyin = fin;
2808 myout = fout;
2809 yylineno = 1;
2810 scope = intypedef = 0;
2811 long header = fout ? ftell (fout) : 0;
2812 incode = is_code (file);
2813 // yy_flex_debug = 1;
2814 int ret = yylex();
2815 yylex_destroy();
2816 if (fout && incode) {
2817 // Assume the entire file is pure code
2819 rewind (fin);
2820 char s[81];
2821 while (fgets (s, 81, fin))
2822 fputs (s, fout);
2823 }
2824 free (fname);
2825 return ret;
2826}
2827
2828FILE * writepath (char * path, const char * mode);
2829
2830static void compdir (char * file, const char * dir)
2831{
2832 push (file);
2833 while (stack >= 0) {
2834 char * path = pop();
2835 FILE * fin = fopen (path, "r");
2836 if (fin == NULL) {
2837 perror (path);
2838 exit (1);
2839 }
2840 FILE * fout = NULL;
2841 if (dir) {
2842 char * file = strstr (path, "//");
2843 if (file) file += 2; else file = path;
2844 char * out = malloc (strlen (dir) + strlen (file) + 2);
2845 strcpy (out, dir);
2846 strcat (out, "/");
2847 strcat (out, file);
2848 fout = writepath (out, "w");
2849 if (fout == NULL) {
2850 perror (out);
2851 exit (1);
2852 }
2853 free (out);
2854
2855 // all headers are included once only
2856 static int nf = 0;
2857 fprintf (fout,
2858 "#ifndef BASILISK_HEADER_%d\n"
2859 "#define BASILISK_HEADER_%d\n", nf, nf);
2860 nf++;
2861
2862 fputs ("#line 1 \"", fout);
2864 fputs ("\"\n", fout);
2865 }
2866 if (include (path, fin, fout))
2867 exit (1);
2868 fclose (fin);
2869 if (fout) {
2870 fputs ("\n#endif\n", fout);
2871 fclose (fout);
2872 }
2873 target = 0;
2874 }
2875}
2876
2877static void prepend_path (char * path)
2878{
2879 int j;
2880 for (j = npath; j > 0; j--)
2881 paths[j] = paths[j-1];
2882 paths[0] = path;
2883 npath++;
2884}
2885
2886void includes (int argc, char ** argv,
2887 char ** grid1, int * default_grid,
2888 int * dim, int * bg, int * lyrs, int * gpus,
2889 const char * dir)
2890{
2891 int depend = 0, tags = 0, swig = 0;
2892 char * file = NULL, * output = NULL;
2893 int i;
2894 warninclude = 0;
2895 alloc = new_allocator();
2896 char * basilisk_include_path = getenv ("BASILISK_INCLUDE_PATH");
2899 char * s = strtok (basilisk_include_path, ":");
2900 while (s) {
2901 prepend_path (s);
2902 s = strtok (NULL, ":");
2903 }
2904 }
2905 for (i = 1; i < argc; i++) {
2906 if (!strncmp (argv[i], "-grid=", 6))
2907 strcpy (grid, &argv[i][6]);
2908 else if (!strcmp (argv[i], "-MD"))
2909 depend = warninclude = 1;
2910 else if (!strcmp (argv[i], "-tags"))
2911 tags = warninclude = 1;
2912 else if (!strcmp (argv[i], "-python"))
2913 swig = 1;
2914 else if (!strcmp (argv[i], "-debug"))
2915 debug = 1;
2916 else if (!strcmp (argv[i], "-o"))
2917 output = argv[++i];
2918 else if (!strncmp (argv[i], "-I", 2))
2919 prepend_path (argv[i] + 2);
2920 else if (argv[i][0] != '-' && \
2921 (tags || !strcmp (&argv[i][strlen(argv[i]) - 2], ".c"))) {
2922 if (file) {
2923 fprintf (stderr, "usage: include [OPTIONS] FILE.c\n");
2924 exit (1);
2925 }
2926 file = argv[i];
2927 }
2928 }
2929 if (depend && file) {
2930 if (!output) output = file;
2931 char ndep[80], * s = &output[strlen(output)-1];
2932 while (*s != '.' && s != output) s--;
2933 if (output != file || s == output)
2934 /* generate dep files with suffixes included for -o option */
2935 strcpy (ndep, output);
2936 else {
2937 *s = '\0';
2938 strcpy (ndep, output);
2939 *s = '.';
2940 }
2941 if (strlen(ndep) < 2 || strcmp (&ndep[strlen(ndep)-2], ".d")) {
2942 if (tags)
2943 strcat (ndep, ".tags.d");
2944 else
2945 strcat (ndep, ".d");
2946 }
2947 else
2948 output[strlen(ndep)-2] = '\0'; // strip trailing ".d";
2949 fdepend = fopen (ndep, "w");
2950 if (!fdepend) {
2951 perror (ndep);
2952 exit (1);
2953 }
2954 char * page = strstr (output, ".page");
2955 if (tags && page) {
2956 *page = '\0';
2957 fprintf (fdepend, "%s.tags:\t\\\n", output);
2958 *page = '.';
2959 }
2960 else
2961 fprintf (fdepend, "%s:\t\\\n", output);
2962 }
2963 else if (tags && file) {
2964 if (!output) output = file;
2965 char ndep[80];
2966 // strip trailing .page
2967 strcpy (ndep, output);
2968 char * page = strstr (ndep, ".page");
2969 if (page)
2970 *page = '\0';
2971 strcat (ndep, ".tags");
2972 ftags = fopen (ndep, "w");
2973 if (!ftags) {
2974 perror (ndep);
2975 exit (1);
2976 }
2977 }
2978 if (file) {
2979 if (swig) {
2980 char swigname[80];
2981 strcpy (swigname, file);
2982 char * dot = strchr (swigname, '.');
2983 *dot = '\0'; strcat (swigname, ".i");
2984 swigfp = fopen (swigname, "w");
2985 if (!swigfp) {
2986 fprintf (stderr, "include: could not open '%s': ", swigname);
2987 perror ("");
2988 exit (1);
2989 }
2990 *dot = '\0';
2991 fprintf (swigfp, "%%module %s\n", swigname);
2992 fputs ("%include \"", swigfp);
2993 fputs (LIBDIR, swigfp);
2994 fputs ("/common.i\"\n", swigfp);
2995 }
2996 target = 1;
2997 compdir (file, dir);
2998 if (!hasgrid && is_code (file)) {
2999 char * path, gridpath[80] = "grid/";
3000 strcat (gridpath, grid[0] != '\0' ? grid : "quadtree"); strcat (gridpath, ".h");
3001 FILE * fp = openpath (gridpath, "r", &path);
3002 if (!fp) {
3003 fprintf (stderr, "include: invalid grid '%s': ", grid);
3004 perror ("");
3005 exit (1);
3006 }
3007 fclose (fp);
3008 target = 0;
3009 compdir (path, dir);
3010 hasgrid = 0;
3011 }
3012 if (swigfp) {
3013 char * path, pythonpath[80] = "python.h";
3014 FILE * fp = openpath (pythonpath, "r", &path);
3015 if (!fp) {
3017 exit (1);
3018 }
3019 fclose (fp);
3020 target = 0;
3021 compdir (path, dir);
3022 }
3023 if (ftags) {
3024 // reprocess the target file for keywords
3025 keywords_only = target = 1;
3026 compdir (file, dir);
3027 }
3028 char * path;
3029 FILE * fp = openpath ("common.h", "r", &path);
3030 assert (fp);
3031 fclose (fp);
3032 }
3033 if (fdepend) {
3034 fputc ('\n', fdepend);
3035 fclose (fdepend);
3036 }
3037 if (ftags)
3038 fclose (ftags);
3039 if (swigfp)
3040 fclose (swigfp);
3041 *grid1 = grid;
3043 if (dimension > 0)
3044 *dim = dimension;
3045 *bg = bghosts;
3046 *lyrs = layers;
3047 *gpus = gpu;
3050}
3051
#define dimension
Definition bitree.h:3
free(list1)
int x
Definition common.h:76
scalar f[]
The primary fields are:
Definition two-phase.h:56
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line line line type
Definition config.h:571
#define p
Definition tree.h:320
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define file
Definition config.h:120
#define assert(a)
Definition config.h:107
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line realloc(p, s) @ define pfree(p
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line line line strdup(s) @ define tracing(...) @ define end_tracing(...) @define tid() 0 @define pid() 0 @define npe() 1 @define mpi_all_reduce(v
coord o
Definition curvature.h:672
else return n
Definition curvature.h:101
scalar s
Definition embed-tree.h:56
*cs[i, 0, 0] a *[i -1, 0, 0] j
Definition embed.h:88
scalar int i
Definition embed.h:74
unsigned char flex_uint8_t
Definition errors.c:315
short int flex_int16_t
Definition errors.c:313
static int line
Definition errors.c:754
int flex_int32_t
Definition errors.c:314
int yy_state_type
Definition errors.c:613
flex_uint8_t YY_CHAR
Definition errors.c:609
size_t yy_size_t
Definition errors.c:416
double t
Definition events.h:24
#define yy_load_buffer_state
Definition include.c:18
#define YY_NEW_FILE
Definition include.c:389
#define yyset_extra
Definition include.c:167
@ TYPEDEF
Definition include.c:941
@ FUNCTION
Definition include.c:941
#define yytext
Definition include.c:30
unsigned char flex_uint8_t
Definition include.c:315
#define yyset_lineno
Definition include.c:215
static char yy_hold_char
Definition include.c:549
static int comment(void)
Definition include.c:2746
static int input(void)
Definition include.c:2085
static gpu
Definition include.c:978
static void compdir(char *file, const char *dir)
Definition include.c:2830
static bghosts
Definition include.c:978
static void append_tag(Tag t)
Definition include.c:954
#define yyrestart
Definition include.c:29
static Allocator * alloc
Definition include.c:952
#define yyset_debug
Definition include.c:155
static void yyunput(int c, char *buf_ptr)
Definition include.c:2038
#define YY_EXTRA_TYPE
Definition include.c:1136
static int keywords_only
Definition include.c:949
static int yy_start
Definition include.c:556
short int flex_int16_t
Definition include.c:313
#define yy_flex_debug
Definition include.c:23
#define yyget_out
Definition include.c:185
int stack
Definition include.c:991
static YY_BUFFER_STATE * yy_buffer_stack
Stack as an array.
Definition include.c:532
unsigned int flex_uint32_t
Definition include.c:317
static int intypedef
Definition include.c:949
static int yy_get_next_buffer(void)
Definition include.c:1877
#define yy_scan_bytes
Definition include.c:15
void includes(int argc, char **argv, char **grid1, int *default_grid, int *dim, int *bg, int *lyrs, int *gpus, const char *dir)
Definition include.c:2886
#define YY_BREAK
Definition include.c:1299
static char * push(char *s)
Definition include.c:993
static const flex_int16_t yy_chk[606]
Definition include.c:839
static size_t yy_buffer_stack_max
capacity of stack.
Definition include.c:531
#define yynoreturn
Definition include.c:364
static yy_state_type yy_try_NUL_trans(yy_state_type current_state)
Definition include.c:2017
#define yyget_debug
Definition include.c:149
static const flex_int16_t yy_base[172]
Definition include.c:722
static int ntags
Definition include.c:949
#define yypush_buffer_state
Definition include.c:20
static yy_state_type * yy_state_ptr
Definition include.c:919
struct yy_buffer_state * YY_BUFFER_STATE
Definition include.c:411
#define yyfree
Definition include.c:34
#define yyout
Definition include.c:28
#define YY_BUFFER_NEW
Definition include.c:512
#define yyget_lineno
Definition include.c:209
#define yylex
Definition include.c:26
#define YY_RESTORE_YY_MORE_OFFSET
Definition include.c:932
static int yy_did_buffer_switch_on_eof
Definition include.c:561
static void prepend_path(char *path)
Definition include.c:2877
static int yy_init_globals(void)
Definition include.c:2617
static int npath
Definition include.c:977
#define yywrap
Definition include.c:31
static void echo()
Definition include.c:1099
static char * yy_full_match
Definition include.c:920
#define yyget_text
Definition include.c:203
#define YY_BUFFER_NORMAL
Definition include.c:513
static int
Definition include.c:978
#define yyensure_buffer_stack
Definition include.c:22
static char * paths[100]
Definition include.c:976
#define yy_scan_buffer
Definition include.c:13
#define YY_MORE_ADJ
Definition include.c:931
#define YY_RULE_SETUP
Definition include.c:1302
static layers
Definition include.c:978
#define yy_scan_string
Definition include.c:14
static FILE * myout
Definition include.c:973
static int strcmps(char *s1, char *s2)
Definition include.c:1001
static FILE * openpath(const char *name, const char *mode, char **path)
Definition include.c:1046
#define YY_AT_BOL()
Definition include.c:603
static const YY_CHAR yy_meta[60]
Definition include.c:712
#define yytext_ptr
Definition include.c:622
signed char flex_int8_t
Definition include.c:312
#define yyget_leng
Definition include.c:197
#define EOB_ACT_END_OF_FILE
Definition include.c:424
#define yyalloc
Definition include.c:32
static void yy_fatal_error(const char *msg)
Definition include.c:2514
#define yypop_buffer_state
Definition include.c:21
#define YY_CURRENT_BUFFER_LVALUE
Definition include.c:546
static void push_once(char *s)
Definition include.c:1015
FILE * writepath(char *path, const char *mode)
Definition qcc.c:77
#define REJECT
Definition include.c:922
int flex_int32_t
Definition include.c:314
#define yylex_destroy
Definition include.c:143
#define space(s)
Definition include.c:1065
#define YY_START
Definition include.c:384
#define yy_switch_to_buffer
Definition include.c:19
static char * shortpath(char *path)
Definition include.c:1067
int yy_state_type
Definition include.c:613
static char * strip_path(char *s)
Definition include.c:981
static yy_state_type * yy_state_buf
Definition include.c:919
#define YY_CURRENT_BUFFER
Definition include.c:540
#define yy_init_buffer
Definition include.c:16
#define INITIAL
Definition include.c:1125
#define yyget_extra
Definition include.c:161
#define yyin
Definition include.c:24
static int include(char *file, FILE *fin, FILE *fout)
Definition include.c:2801
static int yy_n_chars
Definition include.c:550
#define YY_READ_BUF_SIZE
Definition include.c:1211
static int yy_lp
Definition include.c:921
#define YY_INPUT(buf, result, max_size)
Definition include.c:1227
#define ECHO
Definition include.c:1220
#define yy_flush_buffer
Definition include.c:17
static char grid[80]
Definition include.c:976
#define yyrealloc
Definition include.c:33
#define YY_END_OF_BUFFER
Definition include.c:639
#define YY_STATE_EOF(state)
Definition include.c:387
static void singleslash(char *path, FILE *fp)
Definition include.c:1029
static int is_code(const char *file)
Definition include.c:2792
static int getput(void)
Definition include.c:2738
#define YY_END_OF_BUFFER_CHAR
Definition include.c:390
static int warninclude
Definition include.c:950
#define pop()
Definition include.c:1027
#define YY_FATAL_ERROR(msg)
Definition include.c:1274
#define YY_LINENO_REWIND_TO(dst)
Definition include.c:441
#define YY_STATE_BUF_SIZE
Definition include.c:407
#define yyterminate()
Definition include.c:1264
static int debug
Definition include.c:977
static FILE * swigfp
Definition include.c:951
unsigned short int flex_uint16_t
Definition include.c:316
static const flex_int16_t yy_def[172]
Definition include.c:745
static const flex_int16_t yy_nxt[606]
Definition include.c:768
#define yy_create_buffer
Definition include.c:11
static FILE * ftags
Definition include.c:973
flex_uint8_t YY_CHAR
Definition include.c:609
#define YY_DO_BEFORE_ACTION
Definition include.c:632
static Tag * tagsa
Definition include.c:948
#define yy_delete_buffer
Definition include.c:12
#define EOB_ACT_LAST_MATCH
Definition include.c:425
#define nonspace(s)
Definition include.c:1064
#define yyget_in
Definition include.c:173
size_t yy_size_t
Definition include.c:416
static int incode
Definition include.c:979
#define YY_BUFFER_EOF_PENDING
Definition include.c:524
#define yylineno
Definition include.c:27
static yy_state_type yy_get_previous_state(void)
Definition include.c:1985
static char * _stack[100]
Definition include.c:991
static void check_tag(char *text)
Definition include.c:1075
static const YY_CHAR yy_ec[256]
Definition include.c:680
static void echo_c(int c)
Definition include.c:1114
#define yyset_out
Definition include.c:191
static char * yy_c_buf_p
Definition include.c:554
static FILE * fdepend
Definition include.c:973
#define EOB_ACT_CONTINUE_SCAN
Definition include.c:423
static int scope
Definition include.c:949
static const flex_int16_t yy_accept[158]
Definition include.c:659
static size_t yy_buffer_stack_top
index of top of stack.
Definition include.c:530
#define YY_DECL
Definition include.c:1287
void stripname(char *path)
Definition include.c:2763
#define YY_BUF_SIZE
Definition include.c:401
static int target
Definition include.c:949
#define YY_EXIT_FAILURE
Definition include.c:2511
static char * fname
Definition include.c:974
char * stripslash(char *path)
Definition include.c:2774
static const flex_int16_t yy_acclist[76]
Definition include.c:647
static int yy_init
Definition include.c:555
#define YY_SC_TO_UI(c)
Definition include.c:373
static int yyerror(const char *s)
Definition include.c:2731
static int hasgrid
Definition include.c:977
static const flex_int32_t yy_rule_can_match_eol[22]
Definition include.c:911
#define yyleng
Definition include.c:25
static Tag * lookup_tag(const char *id)
Definition include.c:965
#define yyset_in
Definition include.c:179
int nl
Definition layers.h:9
FILE * fp
Definition mtrace.h:7
size_t size
size *double * b
size *double * buf
int source
Definition qcc.c:67
char dir[]
Definition qcc.c:64
Definition include.c:943
char * id
Definition include.c:944
int type
Definition include.c:945
char * file
Definition include.c:944
int line
Definition include.c:945
char * yy_ch_buf
Definition errors.c:470
int yy_bs_column
The column count.
Definition errors.c:503
FILE * yy_input_file
Definition errors.c:468
int yy_fill_buffer
Definition errors.c:508
int yy_buffer_status
Definition errors.c:510
int yy_is_our_buffer
Definition errors.c:487
int yy_bs_lineno
The line count.
Definition errors.c:502
char * yy_buf_pos
Definition errors.c:471
int yy_is_interactive
Definition errors.c:494
flex_int32_t yy_verify
Definition errors.c:644
flex_int32_t yy_nxt
Definition errors.c:645
int dim
scalar c
Definition vof.h:57