Пример #1
0
        public FunctionDecl(SourceUnit /*!*/ sourceUnit,
                            Position position, Position entireDeclarationPosition, ShortPosition headingEndPosition, ShortPosition declarationBodyPosition,
                            bool isConditional, Scope scope, PhpMemberAttributes memberAttributes, string /*!*/ name, NamespaceDecl ns,
                            bool aliasReturn, List <FormalParam> /*!*/ formalParams, List <FormalTypeParam> /*!*/ genericParams,
                            List <Statement> /*!*/ body, List <CustomAttribute> attributes)
            : base(position)
        {
            Debug.Assert(genericParams != null && name != null && formalParams != null && body != null);

            this.name                      = new Name(name);
            this.ns                        = ns;
            this.signature                 = new Signature(aliasReturn, formalParams);
            this.typeSignature             = new TypeSignature(genericParams);
            this.attributes                = new CustomAttributes(attributes);
            this.body                      = body;
            this.entireDeclarationPosition = entireDeclarationPosition;
            this.headingEndPosition        = headingEndPosition;
            this.declarationBodyPosition   = declarationBodyPosition;

            QualifiedName qn = (ns != null) ? new QualifiedName(this.name, ns.QualifiedName) : new QualifiedName(this.name);

            function = new PhpFunction(qn, memberAttributes, signature, typeSignature, isConditional, scope, sourceUnit, position);
            function.WriteUp(typeSignature.ToPhpRoutineSignature(function));

            function.Declaration.Node = this;
        }
Пример #2
0
		public FunctionDecl(SourceUnit/*!*/ sourceUnit,
            Position position, Position entireDeclarationPosition, ShortPosition headingEndPosition, ShortPosition declarationBodyPosition,
			bool isConditional, Scope scope, PhpMemberAttributes memberAttributes, string/*!*/ name, NamespaceDecl ns,
			bool aliasReturn, List<FormalParam>/*!*/ formalParams, List<FormalTypeParam>/*!*/ genericParams,
			List<Statement>/*!*/ body, List<CustomAttribute> attributes)
			: base(position)
		{
			Debug.Assert(genericParams != null && name != null && formalParams != null && body != null);

			this.name = new Name(name);
			this.ns = ns;
			this.signature = new Signature(aliasReturn, formalParams);
			this.typeSignature = new TypeSignature(genericParams);
			this.attributes = new CustomAttributes(attributes);
			this.body = body;
			this.entireDeclarationPosition = entireDeclarationPosition;
            this.headingEndPosition = headingEndPosition;
            this.declarationBodyPosition = declarationBodyPosition;

			QualifiedName qn = (ns != null) ? new QualifiedName(this.name, ns.QualifiedName) : new QualifiedName(this.name);
			function = new PhpFunction(qn, memberAttributes, signature, typeSignature, isConditional, scope, sourceUnit, position);
			function.WriteUp(typeSignature.ToPhpRoutineSignature(function));

			function.Declaration.Node = this;
		}