Наследование: MidContainerDecl
Пример #1
0
 public MidStructRef(
     MidStructDecl decl,
     MidMemberTerm memberTerm)
 {
     _decl       = decl;
     _memberTerm = memberTerm;
 }
Пример #2
0
        private MidMemberDecl EmitMemberDeclImpl(
            MidStructDecl midStruct,
            IResFieldDecl resField,
            MidEmitEnv env)
        {
            var midField = new MidFieldDecl(midStruct, resField.Name);

            midField.AddBuildAction(() =>
            {
                midField.Type = EmitTypeExp(resField.Type, env);
            });
            midField.DoneBuilding();

            midStruct.AddField(midField);
            return(midField);
        }
Пример #3
0
        private MidMemberDecl EmitMemberDeclImpl(
            IBuilder parent,
            IResStructDecl resStruct,
            MidEmitEnv env)
        {
            var midStruct = new MidStructDecl(parent, resStruct.Name, this, env);

            midStruct.AddBuildAction(() =>
            {
                foreach (var resDecl in resStruct.GetMembers())
                {
                    var midDecl = EmitMemberDecl(midStruct, resDecl, env);
                    midStruct.InsertMemberDecl(resDecl, midDecl);
                }
            });
            midStruct.DoneBuilding();
            return(midStruct);
        }
        public EmitTypeHLSL EmitType(MidStructDecl structDecl)
        {
            throw new NotImplementedException();
            /*
            EmitTypeHLSL result;
            if (_structs.TryGetValue(structDecl, out result))
                return result;

            // Actually emit the type, then...
            var name = structDecl.Name.ToString();
            var structType = new StructTypeHLSL(name, null);
            result = structType;
            _structs[structDecl] = result;

            foreach (var f in structDecl.Fields)
            {
                var fName = f.Name.ToString();

                structType.AddField(
                    fName,
                    EmitType(f.Type));
            }

            return result;
             * */
        }
Пример #5
0
 public MidStructRef(
     MidStructDecl decl,
     MidMemberTerm memberTerm)
 {
     _decl = decl;
     _memberTerm = memberTerm;
 }