Package macromedia.asc.parser

Examples of macromedia.asc.parser.Node


                if (comment.def != null && comment.def.metaData != null)
                {
                    int numItems = comment.def.metaData.items.size();
                    for (int x = 0; x < numItems; x++)
                    {
                        Node md = comment.def.metaData.items.at(x);
                        MetaDataNode mdi = (md instanceof MetaDataNode) ? (MetaDataNode)(md) : null;
                       
                        // cn: why not just dump all the metaData ???
                        if (mdi != null && mdi.getId() != null)
                        {
                            // these metaData types can have their own DocComment associated with them, though they might also have no comment.
                            if (mdi.getId().equals(StandardDefs.MD_STYLE) || mdi.getId().equals(StandardDefs.MD_EVENT) || mdi.getId().equals(StandardDefs.MD_EFFECT)
                                    || mdi.getId().equals(StandardDefs.MD_SKINSTATE) || mdi.getId().equals(StandardDefs.MD_ALTERNATIVE)
                                    || mdi.getId().equals(StandardDefs.MD_DISCOURAGEDFORPROFILE))
                            {
                                if (x+1 < numItems// if it has a comment, it will be the sequentially next DocCommentNode
                                {
                                    Node next = comment.def.metaData.items.at(x+1);
                                    DocCommentNode metaDataComment = (next instanceof DocCommentNode) ? (DocCommentNode)next : null;

                                    if (metaDataComment != null)
                                    {
                                        createMetaDataComment(fullname, mdi, false, metaDataComment);
View Full Code Here


    {
        if (expr instanceof ListNode)
        {
            // compound expression.  Only coerce the final expr in the list.
            ListNode list = (ListNode) expr;
            Node lastExpr = list.items.back();
            lastExpr = coerce(lastExpr, actual, expected, isExplicit, force);
            list.items.pop_back();
            list.items.push_back(lastExpr);
            return expr;
        }
View Full Code Here

{
    public void parse2(CompilationUnit unit, TypeTable typeTable)
    {
        SkinPartEvaluator spEvaluator = new SkinPartEvaluator(typeTable.getSymbolTable());
        spEvaluator.setLocalizationManager(ThreadLocalToolkit.getLocalizationManager());
        Node node = (Node) unit.getSyntaxTree();
        CompilerContext context = unit.getContext();
        Context cx = (Context) context.getAscContext();
        node.evaluate(cx, spEvaluator);
    }
View Full Code Here

  {
    if (unit.metadata.size() > 0 && unit.styles.size() == 0)
    {
      StyleEvaluator styleEvaluator = new StyleEvaluator(unit);
      styleEvaluator.setLocalizationManager(ThreadLocalToolkit.getLocalizationManager());
      Node node = (Node) unit.getSyntaxTree();
      CompilerContext context = unit.getContext();
      Context cx = context.getAscContext();
      node.evaluate(cx, styleEvaluator);
    }
  }
View Full Code Here

    /**
     *
     */
    public void parse1(CompilationUnit unit, TypeTable typeTable)
    {
        Node node = (Node) unit.getSyntaxTree();
        Context cx = unit.getContext().getAscContext();
        GenerativeFirstPassEvaluator firstPassEvaluator = getFirstPassEvaluator(unit, typeTable);

        node.evaluate(cx, firstPassEvaluator);

        if ( firstPassEvaluator.makeSecondPass() )
        {
            addInheritance(unit);
        }
View Full Code Here

        GenerativeFirstPassEvaluator firstPassEvaluator =
            (GenerativeFirstPassEvaluator) unit.getContext().removeAttribute(getFirstPassEvaluatorKey());

        if (firstPassEvaluator != null && firstPassEvaluator.makeSecondPass())
        {
            Node node = (Node) unit.getSyntaxTree();
            Context cx = unit.getContext().getAscContext();
            TypeAnalyzer typeAnalyzer = typeTable.getSymbolTable().getTypeAnalyzer();

            node.evaluate(cx, typeAnalyzer);

            Iterator iterator = firstPassEvaluator.getClassMap().entrySet().iterator();

            while ( iterator.hasNext() )
            {
                Entry entry = (Entry) iterator.next();
                String className = (String) entry.getKey();
                GenerativeClassInfo generativeClassInfo = (GenerativeClassInfo) entry.getValue();
                ClassInfo classInfo = typeAnalyzer.getClassInfo(className);
                generativeClassInfo.setClassInfo(classInfo);
            }

            Evaluator secondPassEvaluator = getSecondPassEvaluator(unit, typeAnalyzer, firstPassEvaluator);

            node.evaluate(cx, secondPassEvaluator);
        }
    }
View Full Code Here

    public void parse1(CompilationUnit unit, TypeTable typeTable)
    {
        if (unit.metadata.size() > 0)
        {
            Node node = (Node) unit.getSyntaxTree();
            CompilerContext context = unit.getContext();
            Context cx = context.getAscContext();
            EmbedSkinClassEvaluator embedSkinClassEvaluator = new EmbedSkinClassEvaluator(unit);
            node.evaluate(cx, embedSkinClassEvaluator);
        }
    }
View Full Code Here

        {
            EmbedEvaluator embedEvaluator = new EmbedEvaluator(unit, typeTable.getSymbolTable(),
                                                               transcoders, generatedOutputDir,
                                                               checkDeprecation);
            embedEvaluator.setLocalizationManager(ThreadLocalToolkit.getLocalizationManager());
            Node node = (Node) unit.getSyntaxTree();
            CompilerContext context = unit.getContext();
            Context cx = context.getAscContext();
            node.evaluate(cx, embedEvaluator);
        }
    }
View Full Code Here

    {
        MetaDataNode node = unit.hostComponentMetaData;

        if (node.count() == 1)
        {
            Node def = node.def;

            if (def instanceof ClassDefinitionNode)
            {
                unit.expressions.add(NameFormatter.toMultiName(node.getValue(0)));
                ClassDefinitionNode classDef = (ClassDefinitionNode) def;

                if (!classDeclaresIdentifier(cx, classDef, typeAnalyzer, SKINHOSTCOMPONENT))
                {
                    NodeFactory nodeFactory = cx.getNodeFactory();
                    MetaDataNode bindingMetaData = AbstractSyntaxTreeUtil.generateMetaData(nodeFactory, BINDABLE);
                    bindingMetaData.setId(BINDABLE);
                    StatementListNode statementList = nodeFactory.statementList(classDef.statements, bindingMetaData);

                    int listSize = node.def.metaData.items.size();
                    // if the HostComponent metadata node has more than one items.
                    // then look for the associated comment and stick it to the variable.
                    if (listSize > 1)
                    {
                        for (int ix = 0; ix < listSize; ix++)
                        {
                            // check if the node is of type MetaDataNode.
                            Node tempMeta = node.def.metaData.items.get(ix);

                            if (tempMeta instanceof MetaDataNode)
                            {
                                MetaDataNode tempMetaData = (MetaDataNode) tempMeta;

                                if ("HostComponent".equals(tempMetaData.getId()) && (ix < listSize - 1))
                                {
                                    // if the node has the comment, it would be the next one.
                                    Node temp = node.def.metaData.items.get(ix + 1);

                                    // if the last one is a DocCommentnode, we can run it through the evaluator.
                                    if (temp instanceof DocCommentNode)
                                    {
                                        DocCommentNode tempDoc = ((DocCommentNode)temp);
View Full Code Here

                                                Node lvalueBase)
    {
        IdentifierNode identifier = nodeFactory.identifier(SET_STYLE, false);
        LiteralStringNode literalString = nodeFactory.literalString(getName());
        ArgumentListNode argumentList = nodeFactory.argumentList(null, literalString);
        Node valueExpr = generateValueExpr(nodeFactory, configNamespaces, generateDocComments);
        argumentList = nodeFactory.argumentList(argumentList, valueExpr);
        CallExpressionNode callExpression =
            (CallExpressionNode) nodeFactory.callExpression(identifier, argumentList);
        callExpression.setRValue(false);
        MemberExpressionNode memberExpression = nodeFactory.memberExpression(lvalueBase, callExpression);
View Full Code Here

TOP

Related Classes of macromedia.asc.parser.Node

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.