Lines Matching defs:tokens

348 	struct token *tokens;
352 /* Assume we're going to have half as many tokens as we have
355 token_list = tokens = calloc((end - buffer) / 2, sizeof(struct token));
356 if (!tokens) {
407 tokens[tix].line = lineno;
410 /* Handle string tokens */
420 tokens[tix].size = q - p;
423 tokens[tix].content = malloc(tokens[tix].size + 1);
424 if (!tokens[tix].content) {
428 memcpy(tokens[tix].content, start, tokens[tix].size);
429 tokens[tix].content[tokens[tix].size] = 0;
434 if (islower(tokens[tix].content[0])) {
435 tokens[tix++].token_type = TOKEN_ELEMENT_NAME;
442 dir = bsearch(&tokens[tix], directives,
447 tokens[tix++].token_type = dir - directives;
451 tokens[tix++].token_type = TOKEN_TYPE_NAME;
461 tokens[tix].size = q - p;
463 tokens[tix].content = malloc(tokens[tix].size + 1);
464 if (!tokens[tix].content) {
468 memcpy(tokens[tix].content, start, tokens[tix].size);
469 tokens[tix].content[tokens[tix].size] = 0;
470 tokens[tix++].token_type = TOKEN_NUMBER;
477 tokens[tix].size = 3;
478 tokens[tix].content = "::=";
479 tokens[tix++].token_type = TOKEN_ASSIGNMENT;
487 tokens[tix].size = 2;
488 tokens[tix].content = "({";
489 tokens[tix++].token_type = TOKEN_OPEN_ACTION;
494 tokens[tix].size = 2;
495 tokens[tix].content = "})";
496 tokens[tix++].token_type = TOKEN_CLOSE_ACTION;
502 tokens[tix].size = 1;
506 tokens[tix].content = "{";
507 tokens[tix++].token_type = TOKEN_OPEN_CURLY;
511 tokens[tix].content = "}";
512 tokens[tix++].token_type = TOKEN_CLOSE_CURLY;
516 tokens[tix].content = "[";
517 tokens[tix++].token_type = TOKEN_OPEN_SQUARE;
521 tokens[tix].content = "]";
522 tokens[tix++].token_type = TOKEN_CLOSE_SQUARE;
526 tokens[tix].content = ",";
527 tokens[tix++].token_type = TOKEN_COMMA;
541 verbose("Extracted %u tokens\n", nr_tokens);