Beispiel #1
0
 private void TransformChildrenImpl(
     MidElementCtorApp app)
 {
     app.Args = (from a in app.Args
                 let ta = Transform(a.Val)
                          select new MidElementCtorArg(a.Attribute, ta)).ToArray();
 }
        private EmitValHLSL EmitExpImpl(MidElementCtorApp val, Span span)
        {
            var ctorInfo = GetElementCtor(val.Element);

            var elemType = EmitType(val.Element);
            var elemVal = elemType.CreateVal(_shared.GenerateName("e_"));

            DeclareLocal(elemVal, span);

            var sb = new Span();
            sb.Write("{0}(", ctorInfo.Name);
            bool first = true;

            AddArgs(elemVal, ref first, sb);

            foreach (var param in ctorInfo.InputAttributes)
            {
                var arg = (from a in val.Args
                           where a.Attribute == param
                           select a.Val).First();

                AddArgs(
                    EmitVal(arg, span),
                    ref first,
                    sb);
            }
            sb.WriteLine(");");

            span.Add(sb);

            return elemVal;
        }
 public void PreEmitExpImpl(
     MidElementCtorApp app,
     Span span)
 {
     foreach (var a in app.Args)
         PreEmitExp(a.Val, span);
 }
 private void TransformChildrenImpl(
     MidElementCtorApp app)
 {
     app.Args = (from a in app.Args
                 let ta = Transform(a.Val)
                 select new MidElementCtorArg(a.Attribute, ta)).ToArray();
 }