Exemple #1
0
        public ImportIntrinsic(IDependencySystem system)
            : base(system)
        {
            var paramSymbol = new Symbol.Var(null, "path", Symbol.VarKind.Param);
            var stringType  = System.ReferToConstType("@c", "str");

            Type = new Type.Proc(true, new List <Type.Proc.Param> {
                new Type.Proc.Param(paramSymbol, stringType)
            }, Type.Type_);
            ReturnType = Lir.Types.Type.User_;
        }
            public Impl(IDependencySystem system, Type returnType)
                : base(system)
            {
                var paramSymbol = new Symbol.Var(null, "path", Symbol.VarKind.Param);
                var stringType  = System.ReferToConstType("@c", "str");

                Type = new Type.Proc(true, new List <Type.Proc.Param> {
                    new Type.Proc.Param(paramSymbol, stringType)
                }, returnType);
                ReturnType = System.TypeTranslator.ToLirType(returnType);
            }
            public Undependent(IDependencySystem system)
                : base(system)
            {
                // TODO: Ease building these?
                var typeParamSymbol = new Symbol.Var(null, "T", Symbol.VarKind.Param);

                Type = new Type.Proc(
                    true,
                    new List <Type.Proc.Param> {
                    new Type.Proc.Param(typeParamSymbol, Type.Type_),
                },
                    Type.Type_);
            }
        public ExternIntrinsic(IDependencySystem system)
            : base(system)
        {
            // TODO: Ease building these?
            var nameParamSymbol = new Symbol.Var(null, "name", Symbol.VarKind.Param);
            var typeParamSymbol = new Symbol.Var(null, "T", Symbol.VarKind.Param);
            var stringType      = System.ReferToConstType("@c", "str");
            var typeType        = Type.Type_;

            Type = new Type.Proc(
                true,
                new List <Type.Proc.Param> {
                new Type.Proc.Param(nameParamSymbol, stringType),
                new Type.Proc.Param(typeParamSymbol, typeType),
            },
                new Type.Dependent(typeParamSymbol));
        }
Exemple #5
0
 /// <summary>
 /// Initializes a new <see cref="Dependent"/>.
 /// </summary>
 /// <param name="symbol">The <see cref="Symbol.Var"/> the dependency is caused by.</param>
 public Dependent(Symbol.Var symbol)
     : base(new Scope(ScopeKind.Struct, null))
 {
     Symbol = symbol;
 }