Lines Matching refs:tokp

71 scan(tok_kind expect, token *tokp)
73 get_token(tokp);
74 if (tokp->kind != expect)
82 scan2(tok_kind expect1, tok_kind expect2, token *tokp)
84 get_token(tokp);
85 if (tokp->kind != expect1 && tokp->kind != expect2)
93 scan3(tok_kind expect1, tok_kind expect2, tok_kind expect3, token *tokp)
95 get_token(tokp);
96 if (tokp->kind != expect1 && tokp->kind != expect2 &&
97 tokp->kind != expect3)
105 scan_num(token *tokp)
107 get_token(tokp);
108 switch (tokp->kind) {
120 peek(token *tokp)
122 get_token(tokp);
123 unget_token(tokp);
130 peekscan(tok_kind expect, token *tokp)
132 peek(tokp);
133 if (tokp->kind == expect) {
134 get_token(tokp);
144 get_token(token *tokp)
151 *tokp = lasttok;
159 tokp->kind = TOK_EOF;
211 tokp->kind = TOK_COLON;
215 tokp->kind = TOK_SEMICOLON;
219 tokp->kind = TOK_COMMA;
223 tokp->kind = TOK_EQUAL;
227 tokp->kind = TOK_STAR;
231 tokp->kind = TOK_LBRACKET;
235 tokp->kind = TOK_RBRACKET;
239 tokp->kind = TOK_LBRACE;
243 tokp->kind = TOK_RBRACE;
247 tokp->kind = TOK_LPAREN;
251 tokp->kind = TOK_RPAREN;
255 tokp->kind = TOK_LANGLE;
259 tokp->kind = TOK_RANGLE;
264 tokp->kind = TOK_STRCONST;
265 findstrconst(&where, &tokp->str);
268 tokp->kind = TOK_CHARCONST;
269 findchrconst(&where, &tokp->str);
283 tokp->kind = TOK_IDENT;
284 findconst(&where, &tokp->str);
306 findkind(&where, tokp);
312 unget_token(token *tokp)
314 lasttok = *tokp;
414 findkind(char **mark, token *tokp)
425 tokp->kind = s->kind;
426 tokp->str = s->str;
432 tokp->kind = TOK_IDENT;
435 tokp->str = malloc(len + 1);
436 (void) strncpy(tokp->str, str, len);
437 tokp->str[len] = 0;