Exemplo n.º 1
0
        /// <summary>
        /// Creates a prototype for this function, overriding
        /// any existing prototype property value. Creates arguments.
        /// </summary>
        public Prototype CreatePrototype()
        {
            // Default the return type to void.
            ITypeEmitter returnType = PrimitiveTypeFactory.Void();

            // Create a new prototype instance.
            this.Prototype = new Prototype(NameRegister.GetAnonymous(), null, returnType);

            // Create formal arguments after assigning prototype to avoid infinite loop.
            FormalArgs args = this.CreateArgs();

            // Assign the formal arguments.
            this.Prototype.Args = args;

            // Return the prototype.
            return(this.Prototype);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Creates a prototype for this function, overriding
        ///     any existing prototype property value. Creates arguments.
        /// </summary>
        public Prototype CreatePrototype()
        {
            // Default the return type to void.
            Type returnType = TypeFactory.Void();

            // Create a new prototype instance.
            Prototype = new Prototype(Name, null, returnType);

            // Create formal arguments after assigning prototype to avoid infinite loop.
            FormalArgs args = CreateArgs();

            // Assign the formal arguments.
            Prototype.Args = args;

            // Return the prototype.
            return(Prototype);
        }
Exemplo n.º 3
0
 public Prototype(string name, FormalArgs args, ITypeEmitter returnType)
 {
     this.SetName(name);
     this.Args       = args;
     this.ReturnType = returnType;
 }