示例#1
0
static int expr_add(State_t* state, Node_t *np)
{
	register int	tok = expr_mult(state, np);

	while ((tok&~T_OP)==T_ADD)
	{
		Node_t rp;
		int op = (tok&T_OP);
		tok = expr_mult(state, &rp);
		if (!numeric(np) || !numeric(&rp))
			error(ERROR_exit(2),"non-numeric argument");
		if (op)
			np->num -= rp.num;
		else
			np->num += rp.num;
		np->type = T_NUM;
	}
	return tok;
}
示例#2
0
int main()
{
r__t__n = (void *)(void *)5;
r__t__expr = (void *)expr_app(expr_lambda(expr_app(expr_app(expr_var((void *)0),expr_var((void *)0)),expr_const((void *)5))),expr_lambda(expr_lambda(expr_if(expr_zero(expr_var((void *)0)),expr_const((void *)1),expr_mult(expr_var((void *)0),expr_app(expr_app(expr_var((void *)1),expr_var((void *)1)),expr_subr1(expr_var((void *)0))))))));
r__t__env = (void *)envrr_empty();
r__t__pc = ⅇ
mount_tram();
printf("Fact Test Yields: %d\n", (int)r__t__a);r__t__n = (void *)(void *)5;
r__t__expr = (void *)expr_letcc(expr_mult(expr_const((void *)5),expr_throw(expr_var((void *)0),expr_mult(expr_const((void *)2),expr_const((void *)6)))));
r__t__env = (void *)envrr_empty();
r__t__pc = ⅇ
mount_tram();
printf("Let/CC Test Yields: %d\n", (int)r__t__a);}