Package org.apache.flex.compiler.tree.as

Examples of org.apache.flex.compiler.tree.as.IExpressionNode


       
        if ( func_def != null )
        {
            try
            {
                IExpressionNode returnExpression = ((IReturnNode)iNode).getReturnValueNode();
                IDefinition return_type = func_def.resolveReturnType(project);

                //  void has its own special type logic.
                if ( ClassDefinition.getVoidClassDefinition().equals(return_type) )
                {
View Full Code Here


            // don't check things that didn't come from source. They tend to give false negatives
            if (var.getStart() != var.getEnd())
            {
                // get a node that has the best display location for problem
                IASNode location = var;
                IExpressionNode nameExpression = var.getNameExpressionNode();
                if (nameExpression != null)
                    location = nameExpression;
                this.currentScope.addProblem( new VariableHasNoTypeDeclarationProblem(location, var.getShortName()));
            }
        }
View Full Code Here

            if (iNode instanceof BaseDefinitionNode)
                checkForNamespaceInFunction((BaseDefinitionNode)iNode, currentScope);
        }
       
        // Check whether the namespace is being initialized to a deprecated namespace.
        IExpressionNode namespaceInitialValueNode = nsNode.getNamespaceURINode();
        if (namespaceInitialValueNode != null)
        {
            IDefinition namespaceInitialvalueDefinition = namespaceInitialValueNode.resolve(project);
            checkDeprecated(namespaceInitialValueNode, namespaceInitialvalueDefinition);
        }
    }
View Full Code Here

        if (scope instanceof WithScope)
        {
            // If this expression is part of the target expression of a with node
            // then we want the scope containing the with scope, not the with scope itself.
            IExpressionNode baseExpr = this.getDecorationNode();
            IASNode parent = baseExpr.getParent();
            if (parent instanceof WithNode)
            {
                WithNode withParent = (WithNode)parent;
                if (withParent.getTargetNode() == baseExpr)
                {
View Full Code Here

        // Parse the fragments inside the databinding expression.
        Reader reader = new SourceFragmentsReader(sourceLocation.getSourcePath(), fragments.toArray(new ISourceFragment[0]));
        // IExpressionNode expressionNode = ASParser.parseDataBinding(workspace, reader, problems);
        IProjectConfigVariables projectConfigVariables =
            ((FlexProject)project).getProjectConfigVariables();
        IExpressionNode expressionNode = ASParser.parseExpression(workspace, reader, problems,
                            projectConfigVariables, sourceLocation);

        // If the parse of the databinding expression failed,
        // substitute an empty string literal node
        // (which is the result of the empty databinding expression {}).
View Full Code Here

        // Since we are empty, we can't set our source location based on our children.
        // But in the special case we can set our location to the same thing as our parent.
        result.setSourceLocation((NodeBase)parent);

        IExpressionNode expressionNode = new LiteralNode(LiteralType.STRING, "");
        ((ExpressionNodeBase)expressionNode).setParent(result);
        result.setExpressionNode(expressionNode);
        return result;
    }
View Full Code Here

    @Override
    public IFunctionDefinition getValue(ICompilerProject project)
    {
        assert getExpressionNode() instanceof IExpressionNode : "getValue() shouldn't be getting called on a non-expression MXMLFunctionNode";

        IExpressionNode expressionNode = (IExpressionNode)getExpressionNode();

        if (expressionNode != null)
        {
            IDefinition d = expressionNode.resolve(project);
            if (d instanceof IFunctionDefinition)
                return (IFunctionDefinition)d;
        }

        return null;
View Full Code Here

                type, fragments, location, FLAGS, defaultValue, classNode, true);
    }

    protected void checkExpressionType(MXMLTreeBuilder builder, IDefinition expectedType)
    {
        IExpressionNode expressionNode = (IExpressionNode)getExpressionNode();
        if (expressionNode != null)
        {
            ICompilerProject project = builder.getProject();
            IDefinition exprType = expressionNode.resolveType(project);
            if (exprType != null)
            {
                if (!SemanticUtils.isValidTypeConversion(expectedType, exprType, project, builder.getCompilationUnit().isInvisible()))
                {
                    ICompilerProblem problem = new ImplicitCoercionToUnrelatedTypeProblem(
View Full Code Here

    @Override
    public ITypeDefinition getValue(ICompilerProject project)
    {
        assert getExpressionNode() instanceof IExpressionNode : "getValue() shouldn't be getting called on a non-expression MXMLClassNode";

        IExpressionNode expressionNode = (IExpressionNode)getExpressionNode();

        if (expressionNode != null)
        {
            IDefinition d = expressionNode.resolve(project);
            if (d instanceof ITypeDefinition)
                return (ITypeDefinition)d;
        }

        return null;
View Full Code Here

            MXMLClassDirectiveProcessor host,
            boolean reverseSourceAndDest)
    {
        this.index = index;

        IExpressionNode destinationNode = null;
        expressionNodesForGetter = new LinkedList<IExpressionNode>();
        // look at the node we are passed, and expand it out to all
        // of its expression children
       
        if (!reverseSourceAndDest)
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.tree.as.IExpressionNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.