2 * This is a really stupid C tokenizer. It doesn't do any include
3 * files or anything complex at all. That's the preprocessor.
5 * Copyright (C) 2003 Transmeta Corp.
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
42 int input_stream_nr
= 0;
43 struct stream
*input_streams
;
44 static int input_streams_allocated
;
45 unsigned int tabstop
= 8;
48 #define BUFSIZE (8192)
53 int newline
, whitespace
;
54 struct token
**tokenlist
;
56 unsigned char *buffer
;
59 const char *stream_name(int stream
)
61 if (stream
< 0 || stream
> input_stream_nr
)
62 return "<bad stream>";
63 return input_streams
[stream
].name
;
66 int stream_prev(int stream
)
68 if (stream
< 0 || stream
> input_stream_nr
)
70 stream
= input_streams
[stream
].pos
.stream
;
71 if (stream
> input_stream_nr
)
76 static struct position
stream_pos(stream_t
*stream
)
80 pos
.stream
= stream
->nr
;
81 pos
.newline
= stream
->newline
;
82 pos
.whitespace
= stream
->whitespace
;
83 pos
.pos
= stream
->pos
;
85 pos
.line
= stream
->line
;
93 const char *show_special(int val
)
95 static char buffer
[4];
99 if (val
>= SPECIAL_BASE
)
100 strcpy(buffer
, (char *) combinations
[val
- SPECIAL_BASE
]);
104 const char *show_ident(const struct ident
*ident
)
106 static char buff
[4][256];
112 buffer
= buff
[3 & ++n
];
113 sprintf(buffer
, "%.*s", ident
->len
, ident
->name
);
117 static char *charstr(char *ptr
, unsigned char c
, unsigned char escape
, unsigned char next
)
120 if (c
== escape
|| c
== '\\')
135 return ptr
+ sprintf(ptr
, "%o", c
);
137 return ptr
+ sprintf(ptr
, "%03o", c
);
140 const char *show_string(const struct string
*string
)
142 static char buffer
[4 * MAX_STRING
+ 3];
146 if (!string
|| !string
->length
)
147 return "<bad_string>";
150 for (i
= 0; i
< string
->length
-1; i
++) {
151 const char *p
= string
->data
+ i
;
152 ptr
= charstr(ptr
, p
[0], '"', p
[1]);
159 static const char *show_char(const char *s
, size_t len
, char prefix
, char delim
)
161 static char buffer
[MAX_STRING
+ 4];
173 static const char *quote_char(const char *s
, size_t len
, char prefix
, char delim
)
175 static char buffer
[2*MAX_STRING
+ 6];
183 for (i
= 0; i
< len
; i
++) {
184 if (s
[i
] == '"' || s
[i
] == '\\')
195 const char *show_token(const struct token
*token
)
197 static char buffer
[256];
201 switch (token_type(token
)) {
203 return "syntax error";
206 return "end-of-input";
209 return show_ident(token
->ident
);
212 return token
->number
;
215 return show_special(token
->special
);
218 return show_char(token
->string
->data
,
219 token
->string
->length
- 1, 0, '\'');
220 case TOKEN_CHAR_EMBEDDED_0
... TOKEN_CHAR_EMBEDDED_3
:
221 return show_char(token
->embedded
,
222 token_type(token
) - TOKEN_CHAR
, 0, '\'');
223 case TOKEN_WIDE_CHAR
:
224 return show_char(token
->string
->data
,
225 token
->string
->length
- 1, 'L', '\'');
226 case TOKEN_WIDE_CHAR_EMBEDDED_0
... TOKEN_WIDE_CHAR_EMBEDDED_3
:
227 return show_char(token
->embedded
,
228 token_type(token
) - TOKEN_WIDE_CHAR
, 'L', '\'');
230 return show_char(token
->string
->data
,
231 token
->string
->length
- 1, 0, '"');
232 case TOKEN_WIDE_STRING
:
233 return show_char(token
->string
->data
,
234 token
->string
->length
- 1, 'L', '"');
236 case TOKEN_STREAMBEGIN
:
237 sprintf(buffer
, "<beginning of '%s'>", stream_name(token
->pos
.stream
));
240 case TOKEN_STREAMEND
:
241 sprintf(buffer
, "<end of '%s'>", stream_name(token
->pos
.stream
));
245 sprintf(buffer
, "<untaint>");
248 case TOKEN_ARG_COUNT
:
249 sprintf(buffer
, "<argcnt>");
253 sprintf(buffer
, "unhandled token type '%d' ", token_type(token
));
258 const char *quote_token(const struct token
*token
)
260 static char buffer
[256];
262 switch (token_type(token
)) {
264 return "syntax error";
267 return show_ident(token
->ident
);
270 return token
->number
;
273 return show_special(token
->special
);
276 return quote_char(token
->string
->data
,
277 token
->string
->length
- 1, 0, '\'');
278 case TOKEN_CHAR_EMBEDDED_0
... TOKEN_CHAR_EMBEDDED_3
:
279 return quote_char(token
->embedded
,
280 token_type(token
) - TOKEN_CHAR
, 0, '\'');
281 case TOKEN_WIDE_CHAR
:
282 return quote_char(token
->string
->data
,
283 token
->string
->length
- 1, 'L', '\'');
284 case TOKEN_WIDE_CHAR_EMBEDDED_0
... TOKEN_WIDE_CHAR_EMBEDDED_3
:
285 return quote_char(token
->embedded
,
286 token_type(token
) - TOKEN_WIDE_CHAR
, 'L', '\'');
288 return quote_char(token
->string
->data
,
289 token
->string
->length
- 1, 0, '"');
290 case TOKEN_WIDE_STRING
:
291 return quote_char(token
->string
->data
,
292 token
->string
->length
- 1, 'L', '"');
294 sprintf(buffer
, "unhandled token type '%d' ", token_type(token
));
299 #define HASHED_INPUT_BITS (6)
300 #define HASHED_INPUT (1 << HASHED_INPUT_BITS)
301 #define HASH_PRIME 0x9e370001UL
303 static int input_stream_hashes
[HASHED_INPUT
] = { [0 ... HASHED_INPUT
-1] = -1 };
305 int *hash_stream(const char *name
)
310 while ((c
= *name
++) != 0)
311 hash
= (hash
+ (c
<< 4) + (c
>> 4)) * 11;
314 hash
>>= 32 - HASHED_INPUT_BITS
;
315 return input_stream_hashes
+ hash
;
318 int init_stream(const struct position
*pos
, const char *name
, int fd
, const char **next_path
)
320 int stream
= input_stream_nr
, *hash
;
321 struct stream
*current
;
323 if (stream
>= input_streams_allocated
) {
324 int newalloc
= stream
* 4 / 3 + 10;
325 input_streams
= realloc(input_streams
, newalloc
* sizeof(struct stream
));
327 die("Unable to allocate more streams space");
328 input_streams_allocated
= newalloc
;
330 current
= input_streams
+ stream
;
331 memset(current
, 0, sizeof(*current
));
332 current
->name
= name
;
334 current
->next_path
= next_path
;
335 current
->path
= NULL
;
336 current
->constant
= CONSTANT_FILE_MAYBE
;
340 current
->pos
.stream
= -1;
341 input_stream_nr
= stream
+1;
342 hash
= hash_stream(name
);
343 current
->next_stream
= *hash
;
348 static struct token
* alloc_token(stream_t
*stream
)
350 struct token
*token
= __alloc_token(0);
351 token
->pos
= stream_pos(stream
);
356 * Argh... That was surprisingly messy - handling '\r' complicates the
359 static int nextchar_slow(stream_t
*stream
)
361 int offset
= stream
->offset
;
362 int size
= stream
->size
;
364 int spliced
= 0, had_cr
, had_backslash
;
367 had_cr
= had_backslash
= 0;
370 if (offset
>= size
) {
373 size
= read(stream
->fd
, stream
->buffer
, BUFSIZE
);
377 stream
->offset
= offset
= 0;
380 c
= stream
->buffer
[offset
++];
390 if (!had_backslash
) {
393 stream
->pos
+= tabstop
- stream
->pos
% tabstop
;
418 stream
->offset
= offset
;
433 if (stream
->pos
& Wnewline_eof
)
434 warning(stream_pos(stream
), "no newline at end of file");
436 warning(stream_pos(stream
), "backslash-newline at end of file");
441 * We want that as light as possible while covering all normal cases.
442 * Slow path (including the logics with line-splicing and EOF sanity
443 * checks) is in nextchar_slow().
445 static inline int nextchar(stream_t
*stream
)
447 int offset
= stream
->offset
;
449 if (offset
< stream
->size
) {
450 int c
= stream
->buffer
[offset
++];
451 static const char special
[256] = {
452 ['\t'] = 1, ['\r'] = 1, ['\n'] = 1, ['\\'] = 1
455 stream
->offset
= offset
;
460 return nextchar_slow(stream
);
463 struct token eof_token_entry
;
465 static struct token
*mark_eof(stream_t
*stream
)
469 end
= alloc_token(stream
);
470 eof_token_entry
.pos
= end
->pos
;
471 token_type(end
) = TOKEN_STREAMEND
;
472 end
->pos
.newline
= 1;
474 eof_token_entry
.next
= &eof_token_entry
;
475 eof_token_entry
.pos
.newline
= 1;
477 end
->next
= &eof_token_entry
;
478 *stream
->tokenlist
= end
;
479 stream
->tokenlist
= NULL
;
483 static void add_token(stream_t
*stream
)
485 struct token
*token
= stream
->token
;
487 stream
->token
= NULL
;
489 *stream
->tokenlist
= token
;
490 stream
->tokenlist
= &token
->next
;
493 static void drop_token(stream_t
*stream
)
495 stream
->newline
|= stream
->token
->pos
.newline
;
496 stream
->whitespace
|= stream
->token
->pos
.whitespace
;
497 stream
->token
= NULL
;
510 static const char cclass
[257] = {
511 ['0' + 1 ... '9' + 1] = Digit
| Hex
,
512 ['A' + 1 ... 'D' + 1] = Letter
| Hex
,
513 ['E' + 1] = Letter
| Hex
| Exp
, /* E<exp> */
514 ['F' + 1] = Letter
| Hex
,
515 ['G' + 1 ... 'O' + 1] = Letter
,
516 ['P' + 1] = Letter
| Exp
, /* P<exp> */
517 ['Q' + 1 ... 'Z' + 1] = Letter
,
518 ['a' + 1 ... 'd' + 1] = Letter
| Hex
,
519 ['e' + 1] = Letter
| Hex
| Exp
, /* e<exp> */
520 ['f' + 1] = Letter
| Hex
,
521 ['g' + 1 ... 'o' + 1] = Letter
,
522 ['p' + 1] = Letter
| Exp
, /* p<exp> */
523 ['q' + 1 ... 'z' + 1] = Letter
,
525 ['.' + 1] = Dot
| ValidSecond
,
526 ['=' + 1] = ValidSecond
,
527 ['+' + 1] = ValidSecond
,
528 ['-' + 1] = ValidSecond
,
529 ['>' + 1] = ValidSecond
,
530 ['<' + 1] = ValidSecond
,
531 ['&' + 1] = ValidSecond
,
532 ['|' + 1] = ValidSecond
,
533 ['#' + 1] = ValidSecond
,
543 * pp-number identifier-nodigit
550 static int get_one_number(int c
, int next
, stream_t
*stream
)
553 static char buffer
[4095];
554 char *p
= buffer
, *buffer_end
= buffer
+ sizeof (buffer
);
558 long class = cclass
[next
+ 1];
559 if (!(class & (Dot
| Digit
| Letter
)))
563 next
= nextchar(stream
);
565 if (next
== '-' || next
== '+') {
568 next
= nextchar(stream
);
573 if (p
== buffer_end
) {
574 sparse_error(stream_pos(stream
), "number token exceeds %td characters",
575 buffer_end
- buffer
);
576 // Pretend we saw just "1".
582 token
= stream
->token
;
583 token_type(token
) = TOKEN_NUMBER
;
584 token
->number
= xmemdup(buffer
, p
- buffer
);
590 static int eat_string(int next
, stream_t
*stream
, enum token_type type
)
592 static char buffer
[MAX_STRING
];
593 struct string
*string
;
594 struct token
*token
= stream
->token
;
598 char delim
= type
< TOKEN_STRING
? '\'' : '"';
600 for (escape
= 0; escape
|| next
!= delim
; next
= nextchar(stream
)) {
601 if (len
< MAX_STRING
)
605 warning(stream_pos(stream
),
606 "missing terminating %c character", delim
);
607 /* assume delimiter is lost */
611 warning(stream_pos(stream
),
612 "End of file in middle of string");
616 if (want_hex
&& !(cclass
[next
+ 1] & Hex
))
617 warning(stream_pos(stream
),
618 "\\x used with no following hex digits");
620 escape
= next
== '\\';
623 want_hex
= next
== 'x';
627 warning(stream_pos(stream
),
628 "\\x used with no following hex digits");
629 if (len
> MAX_STRING
) {
630 warning(stream_pos(stream
), "string too long (%d bytes, %d bytes max)", len
, MAX_STRING
);
633 if (delim
== '\'' && len
&& len
<= 4) {
634 token_type(token
) = type
+ len
;
635 memset(buffer
+ len
, '\0', 4 - len
);
636 memcpy(token
->embedded
, buffer
, 4);
638 token_type(token
) = type
;
639 string
= __alloc_string(len
+1);
640 memcpy(string
->data
, buffer
, len
);
641 string
->data
[len
] = '\0';
642 string
->length
= len
+1;
643 token
->string
= string
;
647 token
= stream
->token
;
649 return nextchar(stream
);
652 static int drop_stream_eoln(stream_t
*stream
)
656 switch (nextchar(stream
)) {
660 return nextchar(stream
);
665 static int drop_stream_comment(stream_t
*stream
)
670 newline
= stream
->newline
;
672 next
= nextchar(stream
);
676 warning(stream_pos(stream
), "End of file in the middle of a comment");
679 next
= nextchar(stream
);
680 if (curr
== '*' && next
== '/')
683 stream
->newline
= newline
;
684 return nextchar(stream
);
687 unsigned char combinations
[][4] = COMBINATION_STRINGS
;
689 #define NR_COMBINATIONS (SPECIAL_ARG_SEPARATOR - SPECIAL_BASE)
691 /* hash function for two-character punctuators - all give unique values */
692 #define special_hash(c0, c1) (((c0*8+c1*2)+((c0*8+c1*2)>>5))&31)
695 * note that we won't get false positives - special_hash(0,0) is 0 and
696 * entry 0 is filled (by +=), so all the missing ones are OK.
698 static unsigned char hash_results
[32][2] = {
699 #define RES(c0, c1) [special_hash(c0, c1)] = {c0, c1}
700 RES('+', '='), /* 00 */
701 RES('/', '='), /* 01 */
702 RES('^', '='), /* 05 */
703 RES('&', '&'), /* 07 */
704 RES('#', '#'), /* 08 */
705 RES('<', '<'), /* 0a */
706 RES('<', '='), /* 0c */
707 RES('!', '='), /* 0e */
708 RES('%', '='), /* 0f */
709 RES('-', '-'), /* 10 */
710 RES('-', '='), /* 11 */
711 RES('-', '>'), /* 13 */
712 RES('=', '='), /* 15 */
713 RES('&', '='), /* 17 */
714 RES('*', '='), /* 18 */
715 RES('.', '.'), /* 1a */
716 RES('+', '+'), /* 1b */
717 RES('|', '='), /* 1c */
718 RES('>', '='), /* 1d */
719 RES('|', '|'), /* 1e */
720 RES('>', '>') /* 1f */
723 static int code
[32] = {
724 #define CODE(c0, c1, value) [special_hash(c0, c1)] = value
725 CODE('+', '=', SPECIAL_ADD_ASSIGN
), /* 00 */
726 CODE('/', '=', SPECIAL_DIV_ASSIGN
), /* 01 */
727 CODE('^', '=', SPECIAL_XOR_ASSIGN
), /* 05 */
728 CODE('&', '&', SPECIAL_LOGICAL_AND
), /* 07 */
729 CODE('#', '#', SPECIAL_HASHHASH
), /* 08 */
730 CODE('<', '<', SPECIAL_LEFTSHIFT
), /* 0a */
731 CODE('<', '=', SPECIAL_LTE
), /* 0c */
732 CODE('!', '=', SPECIAL_NOTEQUAL
), /* 0e */
733 CODE('%', '=', SPECIAL_MOD_ASSIGN
), /* 0f */
734 CODE('-', '-', SPECIAL_DECREMENT
), /* 10 */
735 CODE('-', '=', SPECIAL_SUB_ASSIGN
), /* 11 */
736 CODE('-', '>', SPECIAL_DEREFERENCE
), /* 13 */
737 CODE('=', '=', SPECIAL_EQUAL
), /* 15 */
738 CODE('&', '=', SPECIAL_AND_ASSIGN
), /* 17 */
739 CODE('*', '=', SPECIAL_MUL_ASSIGN
), /* 18 */
740 CODE('.', '.', SPECIAL_DOTDOT
), /* 1a */
741 CODE('+', '+', SPECIAL_INCREMENT
), /* 1b */
742 CODE('|', '=', SPECIAL_OR_ASSIGN
), /* 1c */
743 CODE('>', '=', SPECIAL_GTE
), /* 1d */
744 CODE('|', '|', SPECIAL_LOGICAL_OR
), /* 1e */
745 CODE('>', '>', SPECIAL_RIGHTSHIFT
) /* 1f */
749 static int get_one_special(int c
, stream_t
*stream
)
754 next
= nextchar(stream
);
757 * Check for numbers, strings, character constants, and comments
761 if (next
>= '0' && next
<= '9')
762 return get_one_number(c
, next
, stream
);
765 return eat_string(next
, stream
, TOKEN_STRING
);
767 return eat_string(next
, stream
, TOKEN_CHAR
);
770 return drop_stream_eoln(stream
);
772 return drop_stream_comment(stream
);
776 * Check for combinations
779 if (cclass
[next
+ 1] & ValidSecond
) {
780 i
= special_hash(c
, next
);
781 if (hash_results
[i
][0] == c
&& hash_results
[i
][1] == next
) {
783 next
= nextchar(stream
);
784 if (value
>= SPECIAL_LEFTSHIFT
&&
785 next
== "==."[value
- SPECIAL_LEFTSHIFT
]) {
787 next
= nextchar(stream
);
793 token
= stream
->token
;
794 token_type(token
) = TOKEN_SPECIAL
;
795 token
->special
= value
;
800 #define IDENT_HASH_BITS (13)
801 #define IDENT_HASH_SIZE (1<<IDENT_HASH_BITS)
802 #define IDENT_HASH_MASK (IDENT_HASH_SIZE-1)
804 #define ident_hash_init(c) (c)
805 #define ident_hash_add(oldhash,c) ((oldhash)*11 + (c))
806 #define ident_hash_end(hash) ((((hash) >> IDENT_HASH_BITS) + (hash)) & IDENT_HASH_MASK)
808 static struct ident
*hash_table
[IDENT_HASH_SIZE
];
809 static int ident_hit
, ident_miss
, idents
;
811 void show_identifier_stats(void)
814 int distribution
[100];
816 fprintf(stderr
, "identifiers: %d hits, %d misses\n",
817 ident_hit
, ident_miss
);
819 for (i
= 0; i
< 100; i
++)
822 for (i
= 0; i
< IDENT_HASH_SIZE
; i
++) {
823 struct ident
* ident
= hash_table
[i
];
832 distribution
[count
]++;
835 for (i
= 0; i
< 100; i
++) {
837 fprintf(stderr
, "%2d: %d buckets\n", i
, distribution
[i
]);
841 struct ident
*alloc_ident(const char *name
, int len
)
843 struct ident
*ident
= __alloc_ident(len
);
844 ident
->symbols
= NULL
;
847 memcpy(ident
->name
, name
, len
);
851 static struct ident
* insert_hash(struct ident
*ident
, unsigned long hash
)
853 ident
->next
= hash_table
[hash
];
854 hash_table
[hash
] = ident
;
859 static struct ident
*create_hashed_ident(const char *name
, int len
, unsigned long hash
)
864 p
= &hash_table
[hash
];
865 while ((ident
= *p
) != NULL
) {
866 if (ident
->len
== (unsigned char) len
) {
867 if (strncmp(name
, ident
->name
, len
) != 0)
877 ident
= alloc_ident(name
, len
);
885 static unsigned long hash_name(const char *name
, int len
)
888 const unsigned char *p
= (const unsigned char *)name
;
890 hash
= ident_hash_init(*p
++);
892 unsigned int i
= *p
++;
893 hash
= ident_hash_add(hash
, i
);
895 return ident_hash_end(hash
);
898 struct ident
*hash_ident(struct ident
*ident
)
900 return insert_hash(ident
, hash_name(ident
->name
, ident
->len
));
903 struct ident
*built_in_ident(const char *name
)
905 int len
= strlen(name
);
906 return create_hashed_ident(name
, len
, hash_name(name
, len
));
909 struct token
*built_in_token(int stream
, struct ident
*ident
)
913 token
= __alloc_token(0);
914 token
->pos
.stream
= stream
;
915 token_type(token
) = TOKEN_IDENT
;
916 token
->ident
= ident
;
920 static int get_one_identifier(int c
, stream_t
*stream
)
929 hash
= ident_hash_init(c
);
932 next
= nextchar(stream
);
933 if (!(cclass
[next
+ 1] & (Letter
| Digit
)))
935 if (len
>= sizeof(buf
))
937 hash
= ident_hash_add(hash
, next
);
941 if (cclass
[next
+ 1] & Quote
) {
942 if (len
== 1 && buf
[0] == 'L') {
944 return eat_string(nextchar(stream
), stream
,
947 return eat_string(nextchar(stream
), stream
,
951 hash
= ident_hash_end(hash
);
952 ident
= create_hashed_ident(buf
, len
, hash
);
955 token
= stream
->token
;
956 token_type(token
) = TOKEN_IDENT
;
957 token
->ident
= ident
;
962 static int get_one_token(int c
, stream_t
*stream
)
964 long class = cclass
[c
+ 1];
966 return get_one_number(c
, nextchar(stream
), stream
);
968 return get_one_identifier(c
, stream
);
969 return get_one_special(c
, stream
);
972 static struct token
*setup_stream(stream_t
*stream
, int idx
, int fd
,
973 unsigned char *buf
, unsigned int buf_size
)
980 stream
->whitespace
= 0;
983 stream
->token
= NULL
;
986 stream
->size
= buf_size
;
987 stream
->buffer
= buf
;
989 begin
= alloc_token(stream
);
990 token_type(begin
) = TOKEN_STREAMBEGIN
;
991 stream
->tokenlist
= &begin
->next
;
995 static struct token
*tokenize_stream(stream_t
*stream
)
997 int c
= nextchar(stream
);
1000 struct token
*token
= alloc_token(stream
);
1001 stream
->token
= token
;
1002 stream
->newline
= 0;
1003 stream
->whitespace
= 0;
1004 c
= get_one_token(c
, stream
);
1007 stream
->whitespace
= 1;
1008 c
= nextchar(stream
);
1010 return mark_eof(stream
);
1013 struct token
* tokenize_buffer(void *buffer
, unsigned long size
, struct token
**endtoken
)
1016 struct token
*begin
;
1018 begin
= setup_stream(&stream
, 0, -1, buffer
, size
);
1019 *endtoken
= tokenize_stream(&stream
);
1023 struct token
* tokenize(const struct position
*pos
, const char *name
, int fd
, struct token
*endtoken
, const char **next_path
)
1025 struct token
*begin
, *end
;
1027 unsigned char buffer
[BUFSIZE
];
1030 idx
= init_stream(pos
, name
, fd
, next_path
);
1032 // info(endtoken->pos, "File %s is const", name);
1036 begin
= setup_stream(&stream
, idx
, fd
, buffer
, 0);
1037 end
= tokenize_stream(&stream
);
1039 end
->next
= endtoken
;