Lines Matching refs:tok

72 	token tok;  in get_definition()  local
75 get_token(&tok); in get_definition()
76 switch (tok.kind) { in get_definition()
100 scan(TOK_SEMICOLON, &tok); in get_definition()
247 token tok; in def_struct() local
254 scan(TOK_IDENT, &tok); in def_struct()
255 defp->def_name = tok.str; in def_struct()
256 scan(TOK_LBRACE, &tok); in def_struct()
269 scan(TOK_SEMICOLON, &tok); in def_struct()
270 peek(&tok); in def_struct()
271 } while (tok.kind != TOK_RBRACE); in def_struct()
279 get_token(&tok); in def_struct()
286 token tok; in def_program() local
297 scan(TOK_IDENT, &tok); in def_program()
298 defp->def_name = tok.str; in def_program()
299 scan(TOK_LBRACE, &tok); in def_program()
302 scan(TOK_VERSION, &tok); in def_program()
304 scan(TOK_IDENT, &tok); in def_program()
306 vlist->vers_name = tok.str; in def_program()
307 scan(TOK_LBRACE, &tok); in def_program()
317 scan(TOK_IDENT, &tok); in def_program()
318 plist->proc_name = tok.str; in def_program()
319 scan(TOK_LPAREN, &tok); in def_program()
336 while (peekscan(TOK_COMMA, &tok)) { in def_program()
356 scan(TOK_RPAREN, &tok); in def_program()
357 scan(TOK_EQUAL, &tok); in def_program()
358 scan_num(&tok); in def_program()
359 scan(TOK_SEMICOLON, &tok); in def_program()
360 plist->proc_num = tok.str; in def_program()
364 peek(&tok); in def_program()
365 } while (tok.kind != TOK_RBRACE); in def_program()
369 scan(TOK_RBRACE, &tok); in def_program()
370 scan(TOK_EQUAL, &tok); in def_program()
371 scan_num(&tok); in def_program()
372 vlist->vers_num = tok.str; in def_program()
379 scan(TOK_SEMICOLON, &tok); in def_program()
380 scan2(TOK_VERSION, TOK_RBRACE, &tok); in def_program()
381 } while (tok.kind == TOK_VERSION); in def_program()
382 scan(TOK_EQUAL, &tok); in def_program()
383 scan_num(&tok); in def_program()
384 defp->def.pr.prog_num = tok.str; in def_program()
391 token tok; in def_enum() local
396 scan(TOK_IDENT, &tok); in def_enum()
397 defp->def_name = tok.str; in def_enum()
398 scan(TOK_LBRACE, &tok); in def_enum()
401 scan(TOK_IDENT, &tok); in def_enum()
403 elist->name = tok.str; in def_enum()
405 scan3(TOK_COMMA, TOK_RBRACE, TOK_EQUAL, &tok); in def_enum()
406 if (tok.kind == TOK_EQUAL) { in def_enum()
407 scan_num(&tok); in def_enum()
408 elist->assignment = tok.str; in def_enum()
409 scan2(TOK_COMMA, TOK_RBRACE, &tok); in def_enum()
413 } while (tok.kind != TOK_RBRACE); in def_enum()
420 token tok; in def_const() local
423 scan(TOK_IDENT, &tok); in def_const()
424 defp->def_name = tok.str; in def_const()
425 scan(TOK_EQUAL, &tok); in def_const()
426 scan2(TOK_IDENT, TOK_STRCONST, &tok); in def_const()
427 defp->def.co = tok.str; in def_const()
433 token tok; in def_union() local
440 scan(TOK_IDENT, &tok); in def_union()
441 defp->def_name = tok.str; in def_union()
442 scan(TOK_SWITCH, &tok); in def_union()
443 scan(TOK_LPAREN, &tok); in def_union()
447 scan(TOK_RPAREN, &tok); in def_union()
448 scan(TOK_LBRACE, &tok); in def_union()
449 scan(TOK_CASE, &tok); in def_union()
450 while (tok.kind == TOK_CASE) { in def_union()
451 scan2(TOK_IDENT, TOK_CHARCONST, &tok); in def_union()
453 cases->case_name = tok.str; in def_union()
454 scan(TOK_COLON, &tok); in def_union()
457 if (peekscan(TOK_CASE, &tok)) { in def_union()
459 scan2(TOK_IDENT, TOK_CHARCONST, &tok); in def_union()
465 cases->case_name = tok.str; in def_union()
466 scan(TOK_COLON, &tok); in def_union()
467 } while (peekscan(TOK_CASE, &tok)); in def_union()
479 scan(TOK_SEMICOLON, &tok); in def_union()
481 scan3(TOK_CASE, TOK_DEFAULT, TOK_RBRACE, &tok); in def_union()
484 if (tok.kind == TOK_DEFAULT) { in def_union()
485 scan(TOK_COLON, &tok); in def_union()
489 scan(TOK_SEMICOLON, &tok); in def_union()
490 scan(TOK_RBRACE, &tok); in def_union()
568 token tok; in get_declaration() local
576 scan2(TOK_STAR, TOK_IDENT, &tok); in get_declaration()
577 if (tok.kind == TOK_STAR) { in get_declaration()
579 scan(TOK_IDENT, &tok); in get_declaration()
581 dec->name = tok.str; in get_declaration()
582 if (peekscan(TOK_LBRACKET, &tok)) { in get_declaration()
587 scan_num(&tok); in get_declaration()
588 dec->array_max = tok.str; in get_declaration()
589 scan(TOK_RBRACKET, &tok); in get_declaration()
590 } else if (peekscan(TOK_LANGLE, &tok)) { in get_declaration()
595 if (peekscan(TOK_RANGLE, &tok)) { in get_declaration()
598 scan_num(&tok); in get_declaration()
599 dec->array_max = tok.str; in get_declaration()
600 scan(TOK_RANGLE, &tok); in get_declaration()
617 token tok; in get_prog_declaration() local
621 peek(&tok); in get_prog_declaration()
622 if (tok.kind == TOK_RPAREN) { /* no arguments */ in get_prog_declaration()
632 if (peekscan(TOK_IDENT, &tok)) /* optional name of argument */ in get_prog_declaration()
633 dec->name = strdup(tok.str); in get_prog_declaration()
647 if (peekscan(TOK_STAR, &tok)) { in get_prog_declaration()
653 if (peekscan(TOK_IDENT, &tok)) in get_prog_declaration()
655 dec->name = strdup(tok.str); in get_prog_declaration()
657 if (peekscan(TOK_LANGLE, &tok)) { in get_prog_declaration()
663 if (peekscan(TOK_RANGLE, &tok)) { in get_prog_declaration()
667 scan_num(&tok); in get_prog_declaration()
668 dec->array_max = tok.str; in get_prog_declaration()
669 scan(TOK_RANGLE, &tok); in get_prog_declaration()
688 token tok; in get_type() local
691 get_token(&tok); in get_type()
692 switch (tok.kind) { in get_type()
694 *typep = tok.str; in get_type()
699 *prefixp = tok.str; in get_type()
700 scan(TOK_IDENT, &tok); in get_type()
701 *typep = tok.str; in get_type()
708 (void) peekscan(TOK_INT, &tok); in get_type()
712 (void) peekscan(TOK_INT, &tok); in get_type()
716 (void) peekscan(TOK_INT, &tok); in get_type()
725 *typep = tok.str; in get_type()
731 *typep = tok.str; in get_type()
741 *typep = tok.str; in get_type()
751 token tok; in unsigned_dec() local
753 peek(&tok); in unsigned_dec()
754 switch (tok.kind) { in unsigned_dec()
756 get_token(&tok); in unsigned_dec()
760 get_token(&tok); in unsigned_dec()
762 (void) peekscan(TOK_INT, &tok); in unsigned_dec()
765 get_token(&tok); in unsigned_dec()
767 (void) peekscan(TOK_INT, &tok); in unsigned_dec()
770 get_token(&tok); in unsigned_dec()
772 (void) peekscan(TOK_INT, &tok); in unsigned_dec()
775 get_token(&tok); in unsigned_dec()