public IntrinsicTypeModuleInstance(ITypeModuleIntrinsic typeIntrinsic) : base(typeIntrinsic.Name)
 {
     FromLiteral = typeIntrinsic.FromLiteral;
     NetType     = typeIntrinsic.NetType;
     ToNetType   = typeIntrinsic.ToNetType;
     FromNetType = typeIntrinsic.FromNetType;
 }
Exemplo n.º 2
0
        IInstance DeclareIntrinsic(ITypeModuleIntrinsic typeIntrinsic, IParentedIdentifierScope scope)
        {
            var module = new IntrinsicTypeModuleInstance(typeIntrinsic);

            DeclareIntrinsics(typeIntrinsic.Children, new ParentedIdentifierScope(module.Identifiers)
            {
                Parent = scope
            });

            AddTypeSizeDeclaration(typeIntrinsic.TypeSize, module, scope);
            // TODO: add Construct/Destruct
            // TODO: add conversions

            if (typeIntrinsic.NetType != null)
            {
                _netTypes[typeIntrinsic.NetType] = module;
            }
            scope.Add(module);
            return(module);
        }