Ejemplo n.º 1
0
void
bquote(fcode_env_t *env)
{
	char stringbuff[256];
	int len, count;
	char *strptr;

	count = len = next_bytecode(env);
	if (env->state) {
		COMPILE_TOKEN(&quote_ptr);
		strptr = (char *)HERE;
		*strptr++ = len;
		while (count--)
			*strptr++ = next_bytecode(env);
		*strptr++ = 0;
		set_here(env, (uchar_t *)strptr, "bquote");
		token_roundup(env, "bquote");
	} else {
		strptr = stringbuff;
		while (count--)
			*strptr++ = next_bytecode(env);
		*strptr = 0;
		push_string(env, stringbuff, len);
	}
}
Ejemplo n.º 2
0
ushort_t
get_next_token(fcode_env_t *env)
{
	ushort_t token = next_bytecode(env);
	if ((token) && (token < 0x10)) {
		token = (token << 8) | next_bytecode(env);
	}
	env->last_fcode = token;
	return (token);
}
Ejemplo n.º 3
0
ushort_t
get_short(fcode_env_t *env)
{
	ushort_t u;

	/*
	 * Logical or DOES NOT guarantee left to right evaluation...
	 */
	u = next_bytecode(env) << 8;
	return (u | next_bytecode(env));
}
Ejemplo n.º 4
0
void
token_common(fcode_env_t *env, int headered, int visible)
{
	char namebuff[32];
	int len, count, token;
	char *strptr, c;

	strptr = namebuff;
	if (headered) {
		len = next_bytecode(env);
		for (count = 0; count < len; count++) {
			c = next_bytecode(env);
			if (count < sizeof (namebuff))
				*strptr++ = c;
		}
	}

	if (!visible)
		len = 0;
	*strptr = 0;
	token = get_short(env);
	env->last_token = token;

	debug_msg(DEBUG_NEW_TOKEN, "Define %s token: '%s' (%x)\n",
	    (visible ? "named" : "headerless"), namebuff, token);

	header(env, namebuff, len, 0);
	env->table[token].flags = 0;
	if (len) {
		env->table[token].name = MALLOC(len+1);
		strncpy(env->table[token].name, namebuff, len);
	} else {
		env->table[token].name = NULL;
	}
	env->last_token = token;
}
Ejemplo n.º 5
0
 // 2-byte branch offset from next pc
 int next_get_dest() const {
   assert(_pc < _end, "");
   return next_bci() + next_bytecode()->get_offset_s2(Bytecodes::_ifeq);
 }