Example #1
0
void token_print(stream_t *s, tok_state_t *state)
{
	char buf[17];
	switch(state->type) {
	case TOK_SYM: 
		stream_put(s, "TOK_SYM(", state->u.sym, ")\n", NULL);
		break;
	case TOK_LIT:
		stream_put(s, "TOK_LIT(0x", fmt_u64(buf, state->u.lit), ")\n", NULL);
		break;
	default:
		stream_put(s, token_type_names[state->type], "\n", NULL);
		break;
	}
}
Example #2
0
unsigned int fmt_u32(char *str, uint32 ui)
{
  return fmt_u64(str, (uint64) ui);
}