-
Notifications
You must be signed in to change notification settings - Fork 0
/
include.c
3023 lines (2604 loc) · 77.6 KB
/
include.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#line 2 "include.c"
#line 4 "include.c"
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
#define yy_create_buffer inc_create_buffer
#define yy_delete_buffer inc_delete_buffer
#define yy_scan_buffer inc_scan_buffer
#define yy_scan_string inc_scan_string
#define yy_scan_bytes inc_scan_bytes
#define yy_init_buffer inc_init_buffer
#define yy_flush_buffer inc_flush_buffer
#define yy_load_buffer_state inc_load_buffer_state
#define yy_switch_to_buffer inc_switch_to_buffer
#define yypush_buffer_state incpush_buffer_state
#define yypop_buffer_state incpop_buffer_state
#define yyensure_buffer_stack incensure_buffer_stack
#define yy_flex_debug inc_flex_debug
#define yyin incin
#define yyleng incleng
#define yylex inclex
#define yylineno inclineno
#define yyout incout
#define yyrestart increstart
#define yytext inctext
#define yywrap incwrap
#define yyalloc incalloc
#define yyrealloc increalloc
#define yyfree incfree
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
#ifdef yy_create_buffer
#define inc_create_buffer_ALREADY_DEFINED
#else
#define yy_create_buffer inc_create_buffer
#endif
#ifdef yy_delete_buffer
#define inc_delete_buffer_ALREADY_DEFINED
#else
#define yy_delete_buffer inc_delete_buffer
#endif
#ifdef yy_scan_buffer
#define inc_scan_buffer_ALREADY_DEFINED
#else
#define yy_scan_buffer inc_scan_buffer
#endif
#ifdef yy_scan_string
#define inc_scan_string_ALREADY_DEFINED
#else
#define yy_scan_string inc_scan_string
#endif
#ifdef yy_scan_bytes
#define inc_scan_bytes_ALREADY_DEFINED
#else
#define yy_scan_bytes inc_scan_bytes
#endif
#ifdef yy_init_buffer
#define inc_init_buffer_ALREADY_DEFINED
#else
#define yy_init_buffer inc_init_buffer
#endif
#ifdef yy_flush_buffer
#define inc_flush_buffer_ALREADY_DEFINED
#else
#define yy_flush_buffer inc_flush_buffer
#endif
#ifdef yy_load_buffer_state
#define inc_load_buffer_state_ALREADY_DEFINED
#else
#define yy_load_buffer_state inc_load_buffer_state
#endif
#ifdef yy_switch_to_buffer
#define inc_switch_to_buffer_ALREADY_DEFINED
#else
#define yy_switch_to_buffer inc_switch_to_buffer
#endif
#ifdef yypush_buffer_state
#define incpush_buffer_state_ALREADY_DEFINED
#else
#define yypush_buffer_state incpush_buffer_state
#endif
#ifdef yypop_buffer_state
#define incpop_buffer_state_ALREADY_DEFINED
#else
#define yypop_buffer_state incpop_buffer_state
#endif
#ifdef yyensure_buffer_stack
#define incensure_buffer_stack_ALREADY_DEFINED
#else
#define yyensure_buffer_stack incensure_buffer_stack
#endif
#ifdef yylex
#define inclex_ALREADY_DEFINED
#else
#define yylex inclex
#endif
#ifdef yyrestart
#define increstart_ALREADY_DEFINED
#else
#define yyrestart increstart
#endif
#ifdef yylex_init
#define inclex_init_ALREADY_DEFINED
#else
#define yylex_init inclex_init
#endif
#ifdef yylex_init_extra
#define inclex_init_extra_ALREADY_DEFINED
#else
#define yylex_init_extra inclex_init_extra
#endif
#ifdef yylex_destroy
#define inclex_destroy_ALREADY_DEFINED
#else
#define yylex_destroy inclex_destroy
#endif
#ifdef yyget_debug
#define incget_debug_ALREADY_DEFINED
#else
#define yyget_debug incget_debug
#endif
#ifdef yyset_debug
#define incset_debug_ALREADY_DEFINED
#else
#define yyset_debug incset_debug
#endif
#ifdef yyget_extra
#define incget_extra_ALREADY_DEFINED
#else
#define yyget_extra incget_extra
#endif
#ifdef yyset_extra
#define incset_extra_ALREADY_DEFINED
#else
#define yyset_extra incset_extra
#endif
#ifdef yyget_in
#define incget_in_ALREADY_DEFINED
#else
#define yyget_in incget_in
#endif
#ifdef yyset_in
#define incset_in_ALREADY_DEFINED
#else
#define yyset_in incset_in
#endif
#ifdef yyget_out
#define incget_out_ALREADY_DEFINED
#else
#define yyget_out incget_out
#endif
#ifdef yyset_out
#define incset_out_ALREADY_DEFINED
#else
#define yyset_out incset_out
#endif
#ifdef yyget_leng
#define incget_leng_ALREADY_DEFINED
#else
#define yyget_leng incget_leng
#endif
#ifdef yyget_text
#define incget_text_ALREADY_DEFINED
#else
#define yyget_text incget_text
#endif
#ifdef yyget_lineno
#define incget_lineno_ALREADY_DEFINED
#else
#define yyget_lineno incget_lineno
#endif
#ifdef yyset_lineno
#define incset_lineno_ALREADY_DEFINED
#else
#define yyset_lineno incset_lineno
#endif
#ifdef yywrap
#define incwrap_ALREADY_DEFINED
#else
#define yywrap incwrap
#endif
#ifdef yyalloc
#define incalloc_ALREADY_DEFINED
#else
#define yyalloc incalloc
#endif
#ifdef yyrealloc
#define increalloc_ALREADY_DEFINED
#else
#define yyrealloc increalloc
#endif
#ifdef yyfree
#define incfree_ALREADY_DEFINED
#else
#define yyfree incfree
#endif
#ifdef yytext
#define inctext_ALREADY_DEFINED
#else
#define yytext inctext
#endif
#ifdef yyleng
#define incleng_ALREADY_DEFINED
#else
#define yyleng incleng
#endif
#ifdef yyin
#define incin_ALREADY_DEFINED
#else
#define yyin incin
#endif
#ifdef yyout
#define incout_ALREADY_DEFINED
#else
#define yyout incout
#endif
#ifdef yy_flex_debug
#define inc_flex_debug_ALREADY_DEFINED
#else
#define yy_flex_debug inc_flex_debug
#endif
#ifdef yylineno
#define inclineno_ALREADY_DEFINED
#else
#define yylineno inclineno
#endif
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
/* end standard C headers. */
/* flex integer type definitions */
#ifndef FLEXINT_H
#define FLEXINT_H
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
#endif
#include <inttypes.h>
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
/* Limits of integral types. */
#ifndef INT8_MIN
#define INT8_MIN (-128)
#endif
#ifndef INT16_MIN
#define INT16_MIN (-32767-1)
#endif
#ifndef INT32_MIN
#define INT32_MIN (-2147483647-1)
#endif
#ifndef INT8_MAX
#define INT8_MAX (127)
#endif
#ifndef INT16_MAX
#define INT16_MAX (32767)
#endif
#ifndef INT32_MAX
#define INT32_MAX (2147483647)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX (255U)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX (65535U)
#endif
#ifndef UINT32_MAX
#define UINT32_MAX (4294967295U)
#endif
#ifndef SIZE_MAX
#define SIZE_MAX (~(size_t)0)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
/* begin standard C++ headers. */
/* TODO: this is always defined, so inline it */
#define yyconst const
#if defined(__GNUC__) && __GNUC__ >= 3
#define yynoreturn __attribute__((__noreturn__))
#else
#define yynoreturn
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
/* Promotes a possibly negative, possibly signed char to an
* integer in range [0..255] for use as an array index.
*/
#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN (yy_start) = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE yyrestart( yyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
*/
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
extern int yyleng;
extern FILE *yyin, *yyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
/* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
* access to the local variable yy_act. Since yyless() is a macro, it would break
* existing scanners that call yyless() from OUTSIDE yylex.
* One obvious solution it to make yy_act a global. I tried that, and saw
* a 5% performance hit in a non-yylineno scanner, because yy_act is
* normally declared as a register variable-- so it is not worth it.
*/
#define YY_LESS_LINENO(n) \
do { \
int yyl;\
for ( yyl = n; yyl < yyleng; ++yyl )\
if ( yytext[yyl] == '\n' )\
--yylineno;\
}while(0)
#define YY_LINENO_REWIND_TO(dst) \
do {\
const char *p;\
for ( p = yy_cp-1; p >= (dst); --p)\
if ( *p == '\n' )\
--yylineno;\
}while(0)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
/* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \
(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
FILE *yy_input_file;
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
int yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
* shouldn't try reading from the input source any more. We might
* still have a bunch of tokens to match, though, because of
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
* (via yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
/* Stack of input buffers. */
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
*
* Returns the top of the stack, or NULL.
*/
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
? (yy_buffer_stack)[(yy_buffer_stack_top)] \
: NULL)
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
int yyleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = NULL;
static int yy_init = 0; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
/* Flag which is used to allow yywrap()'s to do buffer switches
* instead of setting up a fresh yyin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
void yyrestart ( FILE *input_file );
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
void yy_delete_buffer ( YY_BUFFER_STATE b );
void yy_flush_buffer ( YY_BUFFER_STATE b );
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
void yypop_buffer_state ( void );
static void yyensure_buffer_stack ( void );
static void yy_load_buffer_state ( void );
static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
void *yyalloc ( yy_size_t );
void *yyrealloc ( void *, yy_size_t );
void yyfree ( void * );
#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
yyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
yy_create_buffer( yyin, YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
yyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
yy_create_buffer( yyin, YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
#define incwrap() (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
typedef flex_uint8_t YY_CHAR;
FILE *yyin = NULL, *yyout = NULL;
typedef int yy_state_type;
extern int yylineno;
int yylineno = 1;
extern char *yytext;
#ifdef yytext_ptr
#undef yytext_ptr
#endif
#define yytext_ptr yytext
static yy_state_type yy_get_previous_state ( void );
static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
static int yy_get_next_buffer ( void );
static void yynoreturn yy_fatal_error ( const char* msg );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
yyleng = (int) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 20
#define YY_END_OF_BUFFER 21
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
{
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static const flex_int16_t yy_acclist[75] =
{ 0,
21, 17, 20, 17, 20, 18, 20, 17, 20, 17,
20, 17, 20, 14, 17, 20, 14, 17, 20, 4,
17, 20, 5, 17, 20, 17, 20, 17, 20, 14,
17, 20, 14, 17, 20, 14, 17, 20, 17, 20,
19, 15, 16, 14, 13, 14, 14, 14, 14, 19,
19, 3, 16, 14, 14, 14, 11, 14, 2, 14,
14, 1, 2, 14, 14, 14, 14, 12, 12, 6,
7, 10, 9, 8
} ;
static const flex_int16_t yy_accept[150] =
{ 0,
1, 1, 1, 2, 4, 6, 8, 10, 12, 14,
17, 20, 23, 26, 28, 30, 33, 36, 39, 41,
41, 41, 42, 42, 42, 43, 44, 44, 45, 46,
47, 47, 47, 47, 47, 47, 47, 47, 47, 48,
49, 49, 50, 50, 51, 52, 52, 52, 53, 54,
55, 55, 55, 55, 55, 55, 56, 56, 56, 56,
57, 57, 57, 57, 58, 58, 59, 59, 60, 60,
60, 60, 60, 60, 61, 61, 61, 62, 62, 64,
64, 65, 65, 65, 66, 66, 67, 67, 67, 68,
68, 69, 69, 69, 70, 70, 70, 70, 70, 70,
70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
71, 71, 71, 71, 71, 71, 71, 71, 72, 72,
73, 73, 73, 74, 74, 74, 74, 75, 75
} ;
static const YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
4, 4, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 1, 5, 6, 1, 1, 1, 7, 8,
1, 9, 1, 1, 1, 1, 10, 11, 12, 13,
14, 11, 11, 11, 11, 15, 15, 1, 16, 1,
1, 1, 17, 1, 18, 19, 15, 20, 21, 15,
22, 23, 24, 25, 25, 26, 27, 28, 29, 30,
25, 31, 32, 33, 25, 25, 25, 25, 34, 25,
1, 35, 1, 1, 25, 1, 36, 37, 38, 39,
40, 41, 25, 25, 42, 25, 25, 43, 44, 45,
46, 47, 25, 48, 49, 50, 51, 52, 25, 53,
54, 25, 55, 1, 56, 57, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;
static const YY_CHAR yy_meta[58] =
{ 0,
1, 2, 3, 4, 5, 6, 7, 1, 8, 1,
9, 9, 9, 9, 10, 4, 7, 10, 10, 10,
10, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 7, 9, 9, 10, 10, 10,
9, 2, 2, 2, 11, 2, 2, 11, 2, 11,
2, 11, 11, 2, 1, 1, 1
} ;
static const flex_int16_t yy_base[164] =
{ 0,
0, 57, 442, 535, 432, 535, 6, 0, 3, 16,
21, 535, 535, 24, 12, 36, 67, 75, 379, 37,
63, 44, 82, 428, 535, 0, 99, 102, 535, 106,
80, 78, 121, 86, 394, 377, 129, 13, 138, 146,
354, 154, 326, 162, 169, 170, 0, 535, 0, 183,
186, 341, 343, 204, 212, 215, 189, 224, 255, 194,
338, 336, 240, 535, 19, 248, 375, 535, 374, 97,
242, 76, 0, 237, 322, 315, 298, 355, 535, 40,
301, 316, 310, 306, 140, 309, 344, 300, 317, 113,
325, 329, 337, 341, 116, 315, 301, 312, 282, 29,
118, 300, 294, 282, 262, 293, 190, 268, 266, 263,
225, 253, 251, 131, 215, 206, 191, 166, 206, 535,
171, 182, 162, 142, 147, 150, 259, 109, 279, 125,
350, 98, 357, 332, 134, 8, 157, 361, 223, 535,
369, 269, 535, 372, 276, 286, 535, 535, 386, 397,
408, 419, 429, 439, 449, 456, 467, 477, 480, 490,
501, 512, 523
} ;
static const flex_int16_t yy_def[164] =
{ 0,
149, 150, 148, 148, 148, 148, 151, 152, 148, 153,
153, 148, 148, 154, 148, 155, 155, 155, 148, 151,
151, 148, 156, 148, 148, 157, 148, 153, 148, 153,
154, 148, 154, 148, 148, 148, 158, 148, 155, 155,
148, 155, 148, 148, 148, 151, 159, 148, 157, 153,
158, 148, 148, 158, 158, 155, 160, 151, 151, 153,
148, 148, 158, 148, 148, 155, 160, 148, 161, 160,
160, 151, 59, 153, 148, 148, 155, 161, 148, 160,
153, 148, 148, 155, 160, 153, 148, 148, 155, 160,
148, 148, 148, 158, 160, 148, 148, 148, 148, 148,
160, 148, 148, 148, 148, 162, 160, 148, 148, 148,
148, 162, 163, 160, 148, 148, 148, 148, 163, 148,
148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
148, 148, 148, 148, 148, 148, 148, 0, 148, 148,
148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
148, 148, 148
} ;
static const flex_int16_t yy_nxt[593] =
{ 0,
4, 5, 6, 4, 7, 4, 8, 4, 4, 9,
22, 25, 26, 34, 55, 4, 4, 27, 27, 27,
55, 38, 27, 27, 27, 31, 148, 65, 20, 32,
100, 29, 148, 106, 4, 148, 29, 37, 27, 27,
23, 22, 68, 148, 38, 44, 45, 45, 20, 11,
35, 29, 141, 36, 12, 13, 4, 4, 14, 6,
4, 7, 15, 8, 4, 4, 9, 22, 37, 27,
27, 23, 4, 4, 30, 38, 37, 27, 27, 34,
22, 31, 29, 38, 148, 32, 17, 34, 17, 85,
29, 4, 46, 46, 46, 46, 40, 23, 40, 68,
27, 27, 27, 27, 27, 27, 18, 27, 27, 27,
23, 12, 13, 19, 29, 68, 35, 29, 68, 36,
68, 29, 51, 41, 35, 148, 148, 36, 42, 38,
37, 27, 27, 68, 47, 139, 140, 38, 80, 37,
27, 27, 68, 136, 29, 134, 38, 37, 27, 27,
132, 101, 50, 29, 38, 37, 27, 27, 142, 143,
95, 29, 38, 44, 45, 45, 20, 107, 69, 29,
44, 45, 45, 20, 22, 40, 130, 40, 129, 90,
58, 58, 58, 58, 27, 27, 27, 51, 148, 148,
128, 68, 68, 127, 38, 27, 27, 27, 29, 126,
56, 148, 41, 125, 23, 63, 148, 148, 120, 29,
124, 64, 65, 55, 148, 148, 37, 27, 27, 148,
148, 123, 60, 38, 139, 140, 69, 148, 22, 114,
29, 70, 74, 122, 72, 72, 72, 72, 27, 27,
27, 63, 148, 148, 68, 71, 121, 64, 65, 37,
27, 27, 29, 120, 66, 148, 38, 113, 23, 22,
131, 131, 131, 29, 118, 73, 73, 73, 73, 73,
142, 143, 73, 73, 73, 73, 81, 146, 147, 69,
133, 133, 133, 117, 70, 116, 77, 146, 147, 23,
73, 73, 73, 73, 73, 73, 115, 113, 71, 37,
27, 27, 27, 27, 27, 111, 38, 37, 27, 27,
91, 91, 91, 29, 38, 110, 29, 109, 94, 91,
91, 29, 108, 105, 29, 38, 91, 91, 91, 104,
92, 103, 29, 138, 138, 138, 102, 84, 100, 93,
29, 86, 94, 91, 91, 92, 89, 96, 88, 38,
97, 131, 131, 131, 98, 87, 29, 79, 133, 133,
133, 135, 138, 138, 138, 83, 82, 99, 137, 137,
144, 144, 144, 144, 144, 144, 79, 68, 76, 75,
62, 61, 57, 145, 145, 145, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 21, 21,
43, 21, 21, 21, 21, 21, 21, 21, 21, 24,
24, 53, 24, 24, 24, 24, 24, 24, 24, 24,
28, 28, 28, 52, 48, 43, 20, 28, 28, 28,
33, 148, 148, 33, 33, 148, 148, 33, 33, 33,
39, 39, 39, 148, 148, 148, 39, 39, 39, 39,
21, 148, 21, 148, 21, 148, 21, 49, 49, 148,
49, 49, 49, 49, 49, 49, 49, 49, 54, 54,
54, 148, 148, 148, 54, 54, 54, 54, 59, 59,
67, 67, 67, 67, 67, 67, 67, 67, 67, 67,
67, 78, 78, 78, 78, 78, 78, 78, 78, 78,
78, 78, 112, 112, 112, 112, 112, 112, 112, 112,
112, 112, 112, 119, 119, 119, 119, 119, 119, 119,
119, 119, 119, 119, 3, 148, 148, 148, 148, 148,
148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
148, 148
} ;
static const flex_int16_t yy_chk[593] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
7, 9, 9, 15, 38, 1, 1, 10, 10, 10,
65, 38, 11, 11, 11, 14, 0, 65, 14, 14,
100, 10, 0, 100, 1, 0, 11, 16, 16, 16,
7, 20, 80, 0, 16, 22, 22, 22, 22, 1,
15, 16, 136, 15, 1, 1, 1, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 21, 17, 17,
17, 20, 2, 2, 11, 17, 18, 18, 18, 32,
72, 31, 17, 18, 31, 31, 2, 34, 2, 80,
18, 2, 23, 23, 23, 23, 17, 21, 17, 70,
27, 27, 27, 28, 28, 28, 2, 30, 30, 30,
72, 2, 2, 2, 27, 90, 32, 28, 95, 32,
101, 30, 33, 17, 34, 33, 33, 34, 18, 33,
37, 37, 37, 114, 23, 135, 135, 37, 70, 39,
39, 39, 85, 132, 37, 130, 39, 40, 40, 40,
128, 95, 30, 39, 40, 42, 42, 42, 137, 137,
90, 40, 42, 44, 44, 44, 44, 101, 114, 42,
45, 45, 45, 45, 46, 40, 126, 40, 125, 85,
46, 46, 46, 46, 50, 50, 50, 51, 51, 51,
124, 57, 107, 123, 51, 60, 60, 60, 50, 122,
42, 51, 40, 121, 46, 54, 54, 54, 119, 60,
118, 54, 54, 55, 55, 55, 56, 56, 56, 54,
55, 117, 50, 56, 139, 139, 57, 55, 58, 107,
56, 57, 60, 116, 58, 58, 58, 58, 74, 74,
74, 63, 63, 63, 71, 57, 115, 63, 63, 66,
66, 66, 74, 113, 56, 63, 66, 112, 58, 59,
127, 127, 127, 66, 111, 59, 59, 59, 59, 59,
142, 142, 59, 59, 59, 59, 74, 145, 145, 71,
129, 129, 129, 110, 71, 109, 66, 146, 146, 59,
59, 59, 59, 59, 59, 59, 108, 106, 71, 77,
77, 77, 81, 81, 81, 105, 77, 84, 84, 84,
86, 86, 86, 77, 84, 104, 81, 103, 89, 89,
89, 84, 102, 99, 86, 89, 91, 91, 91, 98,
92, 97, 89, 134, 134, 134, 96, 77, 93, 88,
91, 81, 94, 94, 94, 87, 84, 92, 83, 94,
92, 131, 131, 131, 92, 82, 94, 78, 133, 133,
133, 131, 138, 138, 138, 76, 75, 92, 133, 133,
141, 141, 141, 144, 144, 144, 69, 67, 62, 61,
53, 52, 43, 144, 144, 144, 149, 149, 149, 149,
149, 149, 149, 149, 149, 149, 149, 150, 150, 150,
150, 150, 150, 150, 150, 150, 150, 150, 151, 151,
41, 151, 151, 151, 151, 151, 151, 151, 151, 152,
152, 36, 152, 152, 152, 152, 152, 152, 152, 152,
153, 153, 153, 35, 24, 19, 5, 153, 153, 153,
154, 3, 0, 154, 154, 0, 0, 154, 154, 154,
155, 155, 155, 0, 0, 0, 155, 155, 155, 155,
156, 0, 156, 0, 156, 0, 156, 157, 157, 0,
157, 157, 157, 157, 157, 157, 157, 157, 158, 158,
158, 0, 0, 0, 158, 158, 158, 158, 159, 159,
160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
160, 161, 161, 161, 161, 161, 161, 161, 161, 161,
161, 161, 162, 162, 162, 162, 162, 162, 162, 162,
162, 162, 162, 163, 163, 163, 163, 163, 163, 163,
163, 163, 163, 163, 148, 148, 148, 148, 148, 148,
148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
148, 148, 148, 148, 148, 148, 148, 148, 148, 148,
148, 148
} ;
/* Table of booleans, true if rule could match eol. */
static const flex_int32_t yy_rule_can_match_eol[21] =
{ 0,
1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1,
0, };
extern int yy_flex_debug;
int yy_flex_debug = 0;
static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
static char *yy_full_match;
static int yy_lp;
#define REJECT \
{ \
*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \
yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
++(yy_lp); \
goto find_rule; \
}
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "include.lex"
#line 4 "include.lex"
#include <assert.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "ast/allocator.h"
enum { FUNCTION, TYPEDEF };
typedef struct {
char * id, * file;
int line, type;
} Tag;
static Tag * tagsa = NULL;
static int ntags = 0, target = 1, keywords_only = 0, scope = 0, intypedef = 0;
static int warninclude = 0;
static FILE * swigfp = NULL;
static Allocator * alloc = NULL;
static void append_tag (Tag t) {
ntags++;
tagsa = realloc (tagsa, ntags*sizeof(Tag));
tagsa[ntags-1] = t;
tagsa[ntags-1].id = strdup (t.id);
tagsa[ntags-1].file = strdup (t.file);
tagsa[ntags-1].type = t.type;
char * page = strstr (tagsa[ntags-1].file, ".page");
if (page) *page = '\0';
}
static Tag * lookup_tag (const char * id) {
int i;
for (i = 0; i < ntags; i++)
if (!strcmp(tagsa[i].id, id))
return &tagsa[i];
return NULL;
}
static FILE * fdepend = NULL, * ftags = NULL, * myout = NULL;
static char * fname;
static char * paths[100] = { LIBDIR }, grid[80] = "quadtree";
static int npath = 1, hasgrid = 0, debug = 0;
static int dimension = 0, bghosts = 0, layers = 0;
static int incode; // are we in code (or in a code block)?
static char * strip_path (char * s) {
char * s1 = s;
do {
while (*s1 != '/' && *s1 != '\0') s1++;
if (*s1 == '\0') return s;
} while (*(++s1) != '/');
while (*s1 == '/') s1++;
return s1;
}
static char * _stack[100]; int stack = -1;
static char * push (char * s) {
assert (stack + 1 < 100);
char * f = allocate (alloc, strlen (s) + 1);
strcpy (f, s);
_stack[++stack] = f;
return f;
}
static int strcmps (char * s1, char * s2) {
while (*s1 != '\0' && *s2 != '\0') {
if (*s1 != *s2)
return 1;
if (*s1 == '/') {
while (*s1 == '/') s1++;
while (*s2 == '/') s2++;