Пример #1
0
    public void DoExp(DoExp e)
    {
	Label l1 = il.DefineLabel();
	Label l2 = il.DefineLabel();
	Label EndLabel = il.DefineLabel();
	
	for (ExpList el = e.Vars; el != null; el = el.Tail){
	    el.Head.Visit(this);
	}
	il.Emit(OpCodes.Br, l1);
	il.MarkLabel(l2);
	for (ExpList el = e.Vars; el != null; el = el.Tail){
	    DoVarIter((DoVarDef)el.Head);
	}
	il.MarkLabel(l1);
	
	for (ExpList el = e.Conds; el != null; el = el.Tail){
	    ((DoCondExp)el.Head).EndLabel = EndLabel;
	    el.Head.Visit(this);
	}
	il.Emit(OpCodes.Br, l2);
	
	il.MarkLabel(EndLabel);
	
    }
Пример #2
0
    public void DoExp(DoExp e)
    {
	Type RetType;
	
	for (ExpList el = e.Vars; el != null; el = el.Tail){
	    el.Head.Visit(this);
	}
	
	for (ExpList el = e.Conds; el != null; el = el.Tail){
	    el.Head.Visit(this);
	}

	RetType = e.Conds.Head.ExpType;
	
	for (ExpList el = e.Conds; el != null; el = el.Tail){
	    if (RetType != el.Head.ExpType){
		Console.WriteLine("Error 104: Return Type from Do Conditionals should be same");
		success = false;
	    }
	}
	
	e.ExpType = RetType;
    }