Ejemplo n.º 1
0
static Node *
tl_level(int nr)
{	int i; Node *ptr = ZN;

	if (nr < 0)
		return tl_factor();

	ptr = tl_level(nr-1);
again:
	for (i = 0; i < 4; i++)
		if (tl_yychar == prec[nr][i])
		{	tl_yychar = tl_yylex();
			ptr = tl_nn(prec[nr][i],
				ptr, tl_level(nr-1));
			ptr = bin_simpler(ptr);
			goto again;
		}
	if (!ptr) tl_yyerror("syntax error");
#if 0
	printf("level %d:	", nr);
	tl_explain(ptr->ntyp);
	printf("\n");
#endif
	return ptr;
}
Ejemplo n.º 2
0
static Node *tl_level(int nr)
{	
	int i; Node *ptr = ZN;
	Interval LocInter;

	if (nr < 0)
		return tl_factor();

	ptr = tl_level(nr-1);
again:
	for (i = 0; i < 4; i++)
		if (tl_yychar == prec[nr][i])
		{	
			if (nr==0 && (i==0 || i==1))
				LocInter = TimeCon;
			tl_yychar = tl_yylex();
			ptr = tl_nn(prec[nr][i],ptr,tl_level(nr-1));
			if (nr==0 && (i==0 || i==1))
				ptr->time = LocInter;
			if(tl_simp_log) 
				ptr = bin_simpler(ptr);
			else 
				ptr = bin_minimal(ptr);
			goto again;
		}
	if (!ptr) tl_yyerror("syntax error");
#if 0
	printf("level %d:	", nr);
	tl_explain(ptr->ntyp);
	printf("\n");
#endif
	return ptr;
}
Ejemplo n.º 3
0
static Node *tl_level(int nr, int *cnt, size_t hasuform, char *uform, Miscellaneous *miscell, int *tl_yychar)
{	
	int i; Node *ptr = ZN;
	Interval LocInter;
	int tl_simp_log_p = 0;
	static int	prec[2][4] = {
	{ U_OPER,  V_OPER, 0, 0},  /* left associative */
	{ OR, AND, IMPLIES, EQUIV, },	/* left associative */
};


	if (nr < 0)
		return tl_factor(cnt, hasuform, uform, miscell, tl_yychar);

	ptr = tl_level(nr-1, cnt, hasuform, uform, miscell, tl_yychar);
again:
	for (i = 0; i < 4; i++)
		if ((*tl_yychar) == prec[nr][i])
		{	
			if (nr==0 && (i==0 || i==1))
				LocInter = miscell->TimeCon;
			(*tl_yychar) = tl_yylex(cnt, hasuform, uform, miscell, tl_yychar);
			ptr = tl_nn(prec[nr][i],ptr,tl_level(nr-1, cnt, hasuform, uform, miscell, tl_yychar), miscell);
			if (nr==0 && (i==0 || i==1))
				ptr->time = LocInter;
			if(tl_simp_log_p) 
				ptr = bin_simpler(ptr,miscell,cnt,uform, tl_yychar);
			else 
				ptr = bin_minimal(ptr,miscell,cnt,uform, tl_yychar);
			goto again;
		}
	if (!ptr) tl_yyerror("syntax error", cnt, uform, tl_yychar, miscell);
#if 0
	printf("level %d:	", nr);
	tl_explain(ptr->ntyp);
	printf("\n");
#endif
	return ptr;
}
Ejemplo n.º 4
0
static Node *
tl_formula(void)
{	tl_yychar = tl_yylex();
	return tl_level(1);	/* 2 precedence levels, 1 and 0 */	
}
Ejemplo n.º 5
0
static Node *
tl_formula(int *cnt, size_t hasuform, char *uform, Miscellaneous *miscell, int *tl_yychar)
{	(*tl_yychar) = tl_yylex(cnt, hasuform, uform, miscell, tl_yychar);
	return tl_level(1, cnt, hasuform, uform, miscell, tl_yychar);	/* 2 precedence levels, 1 and 0 */	
}