private MidExp EmitExpImpl(ResBreakExp exp, MidEmitEnv env) { MidLabel label = env.Lookup(exp.Label); MidVal val = EmitVal(exp.Value, env); return(new MidBreakExp(exp.Range, label, val)); }
public MidBreakExp( SourceRange range, MidLabel label, MidVal value) : base(range, new MidVoidType()) { _label = label; _value = value; }
public MidLabelExp( SourceRange range, MidLabel label, MidExp body, MidType type) : base(range, type) { _label = label; _body = body; }
private MidExp EmitExpImpl(ResLabelExp exp, MidEmitEnv env) { var midType = EmitTypeExp(exp.Type, env); var localEnv = new MidLocalEmitEnv(env, _identifiers, null, _exps); var midLabel = new MidLabel(); localEnv.Insert(exp.Label, midLabel); var midBody = EmitLocalExp(exp.Body, localEnv); midBody = localEnv.Wrap(midBody); return(new MidLabelExp( exp.Range, midLabel, midBody, midType)); }
private bool UsesLabel( MidExp exp, MidLabel label) { bool result = false; var transform = new MidTransform( (e) => { if (e is MidBreakExp && (e as MidBreakExp).Label == label) { result = true; } return(e); }); transform.Transform(exp); return(result); }
void ReleaseDesignerOutlets() { if (KeyLabel != null) { KeyLabel.Dispose(); KeyLabel = null; } if (MidLabel != null) { MidLabel.Dispose(); MidLabel = null; } if (ValueLabel != null) { ValueLabel.Dispose(); ValueLabel = null; } }
public BreakLabel( MidLabel midLabel, EmitContextHLSL context, EmitValHLSL resultVar) { _midLabel = midLabel; _context = context; _resultVar = resultVar; }
private bool UsesLabel( MidExp exp, MidLabel label) { bool result = false; var transform = new MidTransform( (e) => { if (e is MidBreakExp && (e as MidBreakExp).Label == label) result = true; return e; }); transform.Transform(exp); return result; }
public void Insert(ResLabel key, MidLabel value) { _labels[key] = value; }