Esempio n. 1
0
        internal void AnalyzeMembers(Analyzer /*!*/ analyzer, PhpRoutine /*!*/ routine, int index)
        {
            this.routine = routine;
            this.index   = index;

            PhpType referring_type;
            Scope   referring_scope;

            if (routine.IsMethod)
            {
                referring_type  = routine.DeclaringPhpType;
                referring_scope = referring_type.Declaration.Scope;
            }
            else if (routine.IsLambdaFunction)
            {
                referring_type  = analyzer.CurrentType;
                referring_scope = analyzer.CurrentScope;
            }
            else
            {
                referring_type  = null;
                referring_scope = ((PhpFunction)routine).Declaration.Scope;
            }

            attributes.AnalyzeMembers(analyzer, referring_scope);

            resolvedTypeHint = analyzer.ResolveType(typeHint, referring_type, routine, position, false);
        }
Esempio n. 2
0
        void IDeclarationNode.AnalyzeMembers(Analyzer /*!*/ analyzer)
        {
            attributes.AnalyzeMembers(analyzer, function.Declaration.Scope);

            typeSignature.AnalyzeMembers(analyzer, function.Declaration.Scope);
            signature.AnalyzeMembers(analyzer, function);

            // member-analyze the other versions:
            if (function.Version.Next != null)
            {
                function.Version.Next.Declaration.Node.AnalyzeMembers(analyzer);
            }

            function.Declaration.Node = null;
        }
Esempio n. 3
0
        internal override Statement /*!*/ Analyze(Analyzer /*!*/ analyzer)
        {
            attributes.AnalyzeMembers(analyzer, analyzer.CurrentScope);
            attributes.Analyze(analyzer, this);

            bool is_unreachable = analyzer.IsThisCodeUnreachable();

            foreach (GlobalConstantDecl cd in constants)
            {
                cd.GlobalConstant.Declaration.IsUnreachable = is_unreachable;
                // cd.Constant.CustomAttributes = attributes;
                cd.Analyze(analyzer);
            }

            if (is_unreachable)
            {
                analyzer.ReportUnreachableCode(position);
                return(EmptyStmt.Unreachable);
            }
            else
            {
                return(this);
            }
        }