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

Examples of org.apache.flex.compiler.internal.tree.as.ExpressionNodeBase


        SourceFragmentsReader reader = new SourceFragmentsReader(location.getSourcePath(), fragments);

        IProjectConfigVariables projectConfigVariables =
                getProject().getProjectConfigVariables();

        ExpressionNodeBase expressionNode = ASParser.parseExpression(getWorkspace(),
                reader, problems, projectConfigVariables, location);

        if (expressionNode == null)
            return null;

        // We found an expression.
        // Temporarily make it a child of the class node so that
        // we can run post-process.
        expressionNode.setParent(classNode);
        //((MXMLExpressionNodeBase)parent).setExpressionNode(expressionNode);

        // Post-process the expression nodes.
        if (postProcess)
            postProcess(expressionNode, classNode);
View Full Code Here


        {
            return currentScope.resolveName((IdentifierNode)iNode);
        }
        else if ( iNode instanceof ExpressionNodeBase )
        {
            ExpressionNodeBase expr = (ExpressionNodeBase) iNode;
            Name n = expr.getMName(currentScope.getProject());

            if ( n == null )
            {
                currentScope.addProblem(new CodegenInternalProblem(iNode, "Unable to resove member name: " + iNode.toString()));
                n = new Name(CONSTANT_Qname, new Nsset(new Namespace(CONSTANT_PackageNs, qualifiers)), base_name);
            }

            return currentScope.getBinding(iNode, n, expr.resolve(currentScope.getProject()));
        }

        //else
            currentScope.addProblem(new CodegenInternalProblem(iNode, "Unable to resove to a dotted name: " + iNode.toString()));
            return new Binding(iNode, new Name(CONSTANT_Qname, new Nsset(new Namespace(CONSTANT_PackageNs, qualifiers)), base_name), null);
View Full Code Here

        IASNode node = binding.getNode();

        if ( node instanceof ExpressionNodeBase )
        {
            //  Ensure we're not in a with scope or part of a filter expression.
            final ExpressionNodeBase expressionNode = (ExpressionNodeBase)node;
            if (expressionNode.inWith() || expressionNode.inFilter())
                return false;
        }

        //  Attribute names aren't statically knowable.
        if ( binding.getName() != null && binding.getName().isAttributeName() )
View Full Code Here

     @param project - an ICompilerProject for the current project.
     *  @return true if node's base expression is dynamic.
     */
    public static boolean hasDynamicBase(Binding binding, ICompilerProject project)
    {
        ExpressionNodeBase base = getBaseNode(binding);
        return base != null && base.isDynamicExpression(project);
    }
View Full Code Here

    public static String getTypeOfBase(IASNode node, ICompilerProject project)
    {
        if (!(node instanceof ExpressionNodeBase))
            return null;
       
        ExpressionNodeBase base = ((ExpressionNodeBase)node).getBaseExpression();
        if (base == null)
            return null;
       
        IDefinition def = base.resolve(project);
        if (def == null)
            return null;
       
        return def.getTypeAsDisplayString();
    }
View Full Code Here

    private void process(String key, String value, SourceLocation keySource,
            SourceLocation valueSource, Collection<ICompilerProblem> problems)
    {
        LiteralNode keyNode = new LiteralNode(LiteralType.STRING, key, keySource);
       
        ExpressionNodeBase valueNode = null;
        Matcher matcher;
        if ((matcher = CLASS_REFERENCE_REGEX.matcher(value)).matches())
        {
            valueNode = processClassReference(matcher, valueSource, problems);
        }
View Full Code Here

                //push key
                bodyInstructionList.addInstruction(ABCConstants.OP_pushstring, entryNode.getKeyNode().getValue());

                //push value
                ExpressionNodeBase valueNode = entryNode.getValueNode();
                switch (valueNode.getNodeID())
                {

                    case LiteralStringID:
                        bodyInstructionList.addInstruction(ABCConstants.OP_pushstring,
                                ((LiteralNode)valueNode).getValue());
View Full Code Here

        final IRepairingTokenBuffer buffer = new StreamingTokenBuffer(tokenizer);

        // create parser
        final ASParser parser = new ASParser(workspace, buffer);

        ExpressionNodeBase expressionNode = null;
        try
        {
            // parse script
            parser.setFilename(sourcePath);
            parser.setProjectConfigVariables(variables);
View Full Code Here

     */
    protected final ExpressionNodeBase transformToNSAccessExpression(ExpressionNodeBase left, ASToken op, ExpressionNodeBase right)
    {
        checkForChainedNamespaceQualifierProblem(op, right);

        final ExpressionNodeBase result;

        if (left instanceof FullNameNode)
        {
            // Left-hand side is a "full name", for example: "ns1::ns2::member".
            // Then convert the "full name" node into a namespace qualifier,
View Full Code Here

     */
    protected ExpressionNodeBase handleMissingIdentifier(RecognitionException ex, ExpressionNodeBase n)
    {
        if (n instanceof FullNameNode)
        {
            ExpressionNodeBase temp = handleMissingIdentifier(ex);
            if (temp != null)
            {
                ((FullNameNode)n).setRightOperandNode(temp);
            }
            return n;
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.internal.tree.as.ExpressionNodeBase

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.