Lines Matching refs:token

394 print_token (struct token_s token, char *buf, int bufsz)
396 for (int i = 0; i < token.end - token.begin && i < bufsz; ++i)
397 buf[i] = token.insn[token.begin + i];
398 for (int i = token.end - token.begin ; i < bufsz; ++i)
442 is_insn (const struct token_s *token, struct token_class *classes)
446 int tok_sz = token->end - token->begin;
447 char *tok = token->insn + token->begin;
458 get_token_class (struct token_s *token, struct token_classes *classes, int insn_p, int modifier_p)
462 int tok_sz = token->end - token->begin;
463 char *tok = token->insn + token->begin;
466 token->val = 0;
473 token->category = CAT_REGISTER;
478 token->category = CAT_MODIFIER;
483 token->category = CAT_IMMEDIATE;
487 token->val = exp.X_add_number;
494 token->category = CAT_SEPARATOR;
496 else if (insn_p && is_insn (token, classes->insn_classes))
499 token->category = CAT_INSTRUCTION;
505 token->category = CAT_IMMEDIATE;
516 token->val = exp.X_add_number;
527 ? token->val
548 token->val = uval;
550 // token->val = (uintptr_t) !kvx_get_pseudo_func2 (exp.X_op_symbol, str_hash_find (env.reloc_hash, TOKEN_NAME (class[cur].class_id)));
561 token->val = i;
571 token->category = CAT_IMMEDIATE;
572 return token->class_id = classes->imm_classes[0].class_id;
577 return token->class_id = unset (class[cur].class_id, env.sys_reg);
580 return token->class_id = class[cur].class_id;
621 /* Stop when reaching the start of the new token. */
775 /* Unknown token */
783 /* 1. Find a rule that can be used with the current token. */
809 /* We matched a token */
825 /* While parsing fails but there is hope since the current token can be
969 const char * msg = "Unexpected token when parsing %s.";
985 const char * msg = "Extra token when parsing %s.";