Пример #1
0
 public MidFieldMemberRef(
     MidVal obj,
     MidFieldDecl decl)
 {
     _obj  = obj;
     _decl = decl;
 }
Пример #2
0
 public MidElementCtorArg(
     MidAttributeDecl attribute,
     MidVal val)
 {
     _attribute = attribute;
     _val       = val;
 }
Пример #3
0
        private MidExp EmitExpImpl(
            ResLetExp resLet,
            MidEmitEnv env)
        {
            var resLetType = resLet.Var.Type;

            MidVal midVal = null;

            if (resLetType is ResFreqQualType)
            {
                var resFreq = ((ResFreqQualType)resLetType).Freq;
                var midElem = ((MidElementType)EmitTypeExp(resFreq, env)).Decl;

                midVal = EmitValToElement(resLet.Value, midElem, env);
            }

            if (midVal == null)
            {
                midVal = EmitVal(resLet.Value, env);
            }

            env.Insert(
                resLet.Var,
                (SourceRange r) => midVal);

            return(EmitExpRaw(
                       resLet.Body,
                       env));
        }
Пример #4
0
        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));
        }
Пример #5
0
 public MidMemberBind(
     MidVal obj,
     MidMemberDecl decl)
 {
     _obj  = obj;
     _decl = decl;
 }
Пример #6
0
        public MidVal Transform(MidVal exp)
        {
            var e = (MidVal)PreTransform(exp);

            TransformChildren(e);
            e = (MidVal)PostTransform(e);
            return(e);
        }
Пример #7
0
 public MidSwitchExp(
     MidVal value,
     IEnumerable <MidCase> cases,
     SourceRange range)
     : base(range, new MidVoidType())
 {
     _value = value;
     _cases = cases.ToArray();
 }
Пример #8
0
 public MidCase(
     MidVal value,
     MidExp body,
     SourceRange range)
 {
     this.Value = value;
     this.Body  = body;
     _range     = range;
 }
Пример #9
0
 public MidAssignExp(
     SourceRange range,
     MidVal dest,
     MidVal src)
     : base(range, new MidVoidType())
 {
     _dest = dest;
     _src  = src;
 }
Пример #10
0
 public MidBreakExp(
     SourceRange range,
     MidLabel label,
     MidVal value)
     : base(range, new MidVoidType())
 {
     _label = label;
     _value = value;
 }
Пример #11
0
        private IMidMemberRef LookupMemberImpl(
            IMidMemberRef container,
            MidVal obj,
            IResMemberDecl resDecl,
            MidEmitEnv env)
        {
            var midDecl = container.LookupMemberDecl(resDecl);

            return(midDecl.CreateRef(new MidMemberBind(obj, midDecl)));
        }
Пример #12
0
 public MidIfExp(
     MidVal condition,
     MidExp thenExp,
     MidExp elseExp,
     SourceRange range)
     : base(range, new MidDummyType())
 {
     this.Condition = condition;
     this.Then      = thenExp;
     this.Else      = elseExp;
 }
Пример #13
0
 public MidForExp(
     SourceRange range,
     MidVar var,
     MidVal seq,
     MidExp body)
     : base(range, new MidVoidType())
 {
     _var  = var;
     _seq  = seq;
     _body = body;
 }
Пример #14
0
 public void Insert(MidVar var, MidVal val)
 {
     _vars[var] = val;
 }
Пример #15
0
 private void TransformChildrenImpl(
     MidVal val)
 {
 }
Пример #16
0
 private MidVal Replace(
     MidVal val)
 {
     return(ReplaceImpl((dynamic)val));
 }