Exemplo n.º 1
0
Tr_level Tr_newLevel(Tr_level parent, Temp_label name, U_boolList formals){
	Tr_level level = (Tr_level)checked_malloc(sizeof(struct Tr_level_));
	level->parent = parent;
	level->frame = F_newFrame(name, U_BoolList(TRUE, formals));//Add a new formal used as static link
	level->depth = parent->depth + 1;
	return level;
}
Exemplo n.º 2
0
Tr_level Tr_outermost(){
	if(outermostLevel==NULL){
		outermostLevel = (Tr_level)checked_malloc(sizeof(struct Tr_level_));
		outermostLevel->parent = NULL;
		outermostLevel->frame = F_newFrame(Temp_namedlabel("main"), NULL);
		outermostLevel->depth = 0;
	}
	return outermostLevel;
}
Exemplo n.º 3
0
Tr_level Tr_newLevel(Tr_level p, Temp_label n, U_boolList f) {
	
	Tr_level l = checked_malloc(sizeof(*l));
	l->parent = p;
	l->name = n;
	l->frame = F_newFrame(n, U_BoolList(TRUE, f));
	l->formals = makeFormalAccessList(l);
	#ifdef F_P
	display_l(l);
	#endif
	return l;
}