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

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


    {
        int childCount = getChildCount();
        if (childCount < 1)
            return null;

        IASNode child = getChild(childCount - 1);

        if (child instanceof TerminalNode && ((TerminalNode)child).kind == TerminalKind.FINALLY)
            return (ITerminalNode)child;

        return null;
View Full Code Here


        ASFileScope fileScope = containingScope.getFileScope();
        if (fileScope == null)
            return null;

        IASNode node = nodeRef.getNode(fileScope.getWorkspace(), getContainingASScope());
        if (!(node instanceof IDefinitionNode))
            return null;

        return (IDefinitionNode)node;
    }
View Full Code Here

        final List<String> astDump = new ArrayList<String>();
        final Collection<ICompilerProblem> problems = new ArrayList<ICompilerProblem>();
        final ImmutableList<ICompilationUnit> compilationUnits = target.getReachableCompilationUnits(problems);
        for (final ICompilationUnit compilationUnit : compilationUnits)
        {
            final IASNode ast = compilationUnit.getSyntaxTreeRequest().get().getAST();
            if (ast != null)
            {
                ((IFileNode)ast).populateFunctionNodes();
                astDump.add(ast.toString());
            }
        }

        println(Joiner.on("\n\n").join(astDump));
    }
View Full Code Here

    {
        ArrayList<IASNode> ret = new ArrayList<IASNode>();
        int childrenSize = parent.getChildCount();
        for (int i = 0; i < childrenSize; i++)
        {
            IASNode child = parent.getChild(i);
            if (child instanceof ConfigConditionBlockNode)
            {
                ret.addAll( getDescendantStatements(child));
            }
            else
View Full Code Here

            ClassNode classNode = null;
            IMetaInfo[] metaInfos = null;
            final FileNode ast = createFileNode(getRootFileSpecification());
            if (this.getProject() instanceof FlexProject)
            {
                IASNode child = ast.getChild(0);
                if (child instanceof PackageNode)
                {
                    pkg = (PackageNode)child;
                    IDefinitionNode[] memberNodes = pkg.getAllMemberDefinitionNodes();
                    if (memberNodes.length > 0 && memberNodes[0] instanceof ClassNode)
View Full Code Here

    @Override
    protected IABCBytesRequestResult handleABCBytesRequest() throws InterruptedException
    {
        final ISyntaxTreeRequestResult fsr = getSyntaxTreeRequest().get();
        final IASNode rootNode = fsr.getAST();
        final CompilerProject project = getProject();

        startProfile(Operation.GET_ABC_BYTES);
        IABCBytesRequestResult result = CodeGeneratorManager.getCodeGenerator().generate(project.getWorkspace().getExecutorService(),
                project.getUseParallelCodeGeneration(),
View Full Code Here

     *
     * @return root class name
     */
    public String getRootClassName() throws InterruptedException
    {
        final IASNode fileNode = getSyntaxTreeRequest().get().getAST();
        final ClassNode classNode = findFirstClassNode(fileNode);
        final String rootClassName = classNode.getName();
        return rootClassName;
    }
View Full Code Here

            //
            // Since we might have allowed the syntax tree
            // to be GC'd we may have to repase the file.
           
            // First see if we still have the AST..
            IASNode result = astRef.get();
            if (result != null)
                return result;
           
            // We allowed the syntax tree to be gc'd.
            // Now we have to get hold of our owning
View Full Code Here

        }
       
        @Override
        public Set<String> getRequiredResourceBundles() throws InterruptedException
        {
            IASNode tree = getAST();
           
            if(tree instanceof IFileNodeAccumulator)
            {
                return ((IFileNodeAccumulator)tree).getRequiredResourceBundles();
            }
View Full Code Here

    public IDefinitionNode getDecoratedDefinition()
    {
        if (decoratedNode == null)
        {
            IASNode parent = getParent();
            if (parent instanceof BlockNode)
            {
                IASNode node = parent.getParent();
                if (node instanceof MemberedNode)
                {
                    BlockNode contents = ((MemberedNode)node).getScopedNode();
                    int childCount = contents.getChildCount();
                    boolean found = false;
                    for (int i = 0; i < childCount; i++)
                    {
                        IASNode child = contents.getChild(i);
                        if (found)
                        {
                            if (child instanceof IDefinitionNode)
                            {
                                decoratedNode = (IDefinitionNode)child;
                                if (child instanceof ClassNode)
                                {
                                    analyze(EnumSet.of(PostProcessStep.POPULATE_SCOPE), ((ClassNode)child).getScopedNode().getASScope(), new ArrayList<ICompilerProblem>(0));
                                }
                                if (child instanceof BaseDefinitionNode)
                                {
                                    ((BaseDefinitionNode)child).setMetaTags(this);
                                }
                                break;
                            }
                        }
                        else
                        {
                            if (child == this)
                            {
                                found = true;
                            }
                        }
                    }
                    //we're still null, so let's loop through backwards to see if we can find the node we are decorating
                    //this could happen in MXML land when the mx:MetaData block comes after a script/event block
                    if (decoratedNode == null && found)
                    {
                        for (int i = childCount - 1; i >= 0; i--)
                        {
                            IASNode child = contents.getChild(i);
                            if (child instanceof IDefinitionNode)
                            {
                                decoratedNode = (IDefinitionNode)child;
                                if (child instanceof ClassNode)
                                {
View Full Code Here

TOP

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

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.