예제 #1
0
파일: typecheck.cs 프로젝트: ydunk/masters
 public void DoCondExp(DoCondExp e)
 {
     e.Cond.Visit(this);
     CheckBool(e.Cond);
     e.Ret.Visit(this);
     e.ExpType = e.Ret.ExpType;
 }
예제 #2
0
파일: codegen.cs 프로젝트: ydunk/masters
    public void DoCondExp(DoCondExp e)
    {
        Label FalseLabel;

        FalseLabel = il.DefineLabel();

        e.Cond.Visit(this);
        il.Emit(OpCodes.Brfalse, FalseLabel);
        e.Ret.Visit(this);
        il.Emit(OpCodes.Br, e.EndLabel);

        il.MarkLabel(FalseLabel);
    }