Package macromedia.asc.parser

Examples of macromedia.asc.parser.Node


                                                StatementListNode statementList,
                                                Node lvalueBase)
    {
        LiteralNumberNode literalNumber = nodeFactory.literalNumber(index);
        ArgumentListNode expr = nodeFactory.argumentList(null, literalNumber);
        Node value = generateValueExpr(nodeFactory, configNamespaces, generateDocComments);
        ArgumentListNode argumentList = nodeFactory.argumentList(null, value);
        SetExpressionNode setExpression = nodeFactory.setExpression(expr, argumentList, false);
    setExpression.setMode(Tokens.LEFTBRACKET_TOKEN);
        MemberExpressionNode memberExpression = nodeFactory.memberExpression(lvalueBase, setExpression);
        ListNode list = nodeFactory.list(null, memberExpression);
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

    if (standardDefs.isRepeater(getLValueType()))
    {
      assert lvalueBase instanceof MemberExpressionNode : lvalueBase.getClass().getName();
      String name = extractName(lvalueBase);

            Node value = generateValueExpr(nodeFactory, configNamespaces, generateDocComments);
            VariableDefinitionNode variableDefinition =
                AbstractSyntaxTreeUtil.generateVariable(nodeFactory, REPEATER,
                                                        standardDefs.CLASS_REPEATER_DOT, true,
                                                        value);
            nodeFactory.statementList(statementList, variableDefinition);

            MemberExpressionNode repeaterBase =
                AbstractSyntaxTreeUtil.generateGetterSelector(nodeFactory, REPEATER, false);

            IdentifierNode initializeRepeaterIdentifier = nodeFactory.identifier(INITIALIZE_REPEATER, false);
            MemberExpressionNode lvalueBaseMemberExpression =
                AbstractSyntaxTreeUtil.generateGetterSelector(nodeFactory, name, true);
      ArgumentListNode initializeRepeaterArgumentList =
                nodeFactory.argumentList(null, lvalueBaseMemberExpression);
            LiteralBooleanNode literalBoolean = nodeFactory.literalBoolean(true);
            initializeRepeaterArgumentList = nodeFactory.argumentList(initializeRepeaterArgumentList,
                                                                      literalBoolean);
      CallExpressionNode initializeRepeaterCallExpression =
        (CallExpressionNode) nodeFactory.callExpression(initializeRepeaterIdentifier,
                                                                initializeRepeaterArgumentList);
      initializeRepeaterCallExpression.setRValue(false);
            MemberExpressionNode initializeRepeaterMemberExpression =
                nodeFactory.memberExpression(repeaterBase, initializeRepeaterCallExpression);
            ListNode initializeRepeaterList = nodeFactory.list(null, initializeRepeaterMemberExpression);
            ExpressionStatementNode initializeRepeaterExpressionStatement =
                nodeFactory.expressionStatement(initializeRepeaterList);
            nodeFactory.statementList(statementList, initializeRepeaterExpressionStatement);           

      MemberExpressionNode condition = generateChildRepeaters(nodeFactory, lvalueBase);
      MemberExpressionNode thenExpr = generateThen(nodeFactory, name);
      ListNode elseExpr = generateElse(nodeFactory, name);
      ConditionalExpressionNode conditionalExpression =
                nodeFactory.conditionalExpression(condition, thenExpr, elseExpr);
      ListNode base = nodeFactory.list(null, conditionalExpression);

      IdentifierNode pushIdentifier = nodeFactory.identifier(PUSH, false);
            MemberExpressionNode repeaterMemberExpression =
                AbstractSyntaxTreeUtil.generateGetterSelector(nodeFactory, REPEATER, false);
      ArgumentListNode pushArgumentList = nodeFactory.argumentList(null, repeaterMemberExpression);
      CallExpressionNode pushCallExpression =
        (CallExpressionNode) nodeFactory.callExpression(pushIdentifier, pushArgumentList);
      pushCallExpression.setRValue(false);

      MemberExpressionNode pushMemberExpression = nodeFactory.memberExpression(base, pushCallExpression);
      ListNode pushList = nodeFactory.list(null, pushMemberExpression);
            ExpressionStatementNode pushExpressionStatement = nodeFactory.expressionStatement(pushList);
            return nodeFactory.statementList(statementList, pushExpressionStatement);
    }
    else
    {
      IdentifierNode identifier = nodeFactory.identifier(ADD_CHILD, false);
      Node valueExpr = generateValueExpr(nodeFactory, configNamespaces, generateDocComments);
      ArgumentListNode argumentList = nodeFactory.argumentList(null, valueExpr);
      CallExpressionNode callExpression =
        (CallExpressionNode) nodeFactory.callExpression(identifier, argumentList);
      callExpression.setRValue(false);
      MemberExpressionNode memberExpression = nodeFactory.memberExpression(lvalueBase, callExpression);
View Full Code Here

    {
    String name = getName();

    if (TextParser.isValidIdentifier(name))
        {
            Node valueExpr = generateValueExpr(nodeFactory, configNamespaces, generateDocComments);
            ExpressionStatementNode expressionStatement =
                AbstractSyntaxTreeUtil.generateAssignment(nodeFactory, lvalueBase, name, valueExpr);
            return nodeFactory.statementList(statementList, expressionStatement);
        }
        else
View Full Code Here

            (CallExpressionNode) nodeFactory.callExpression(hasEventListenerIdentifier, nodeFactory.argumentList(null, propChangeLiteralString));
        hasEventListenerCallExpression.setRValue(false);
        MemberExpressionNode ifMemberExpression =
            nodeFactory.memberExpression(ifThisExpression, hasEventListenerCallExpression);
        ListNode iftest = nodeFactory.list(null, ifMemberExpression);
        Node ifStatement = nodeFactory.ifStatement(iftest, expressionStatement, null);
       
        return nodeFactory.statementList(then, ifStatement);
    }
View Full Code Here

            ListNode test = generateOldValueStrictlyNotEqualsValueText(nodeFactory);
            StatementListNode then =
                generateStaticSetterAssignment(nodeFactory, className, qualifiedBackingPropertyName);
            then = generateStaticDispatchEventCall(nodeFactory, then, className, accessorInfo.getQualifiedPropertyName());

            Node ifStatement = nodeFactory.ifStatement(test, then, null);
            functionStatementList = nodeFactory.statementList(functionStatementList, ifStatement);
        }
        else
        {
            VariableDefinitionNode variableDefinition = generateOldValueVariable(nodeFactory, setterAccessPropertyName);
            functionStatementList = nodeFactory.statementList(null, variableDefinition);

            ListNode test = generateOldValueStrictlyNotEqualsValueText(nodeFactory);
            StatementListNode then = generateSetterAssignment(nodeFactory, qualifiedBackingPropertyName);
            then = generateDispatchEventCall(nodeFactory, then, accessorInfo.getQualifiedPropertyName());

            Node ifStatement = nodeFactory.ifStatement(test, then, null);;
            functionStatementList = nodeFactory.statementList(functionStatementList, ifStatement);
        }

        FunctionCommonNode functionCommon = nodeFactory.functionCommon(context, null, functionSignature,
                                                                       functionStatementList);
View Full Code Here

        ListNode list = nodeFactory.list(null, memberExpression);
        ExpressionStatementNode expressionStatement =
            nodeFactory.expressionStatement(list);
        StatementListNode then = nodeFactory.statementList(null, expressionStatement);

        Node ifStatement = nodeFactory.ifStatement(test, then, null);
        return nodeFactory.statementList(outerThen, ifStatement);
    }
View Full Code Here

  {
    if ((lvalueBase instanceof ThisExpressionNode) &&
            hasDefinition() &&
            ((Model) value).isDeclared())
    {
      Node valueExpr = generateValueExpr(nodeFactory, configNamespaces, generateDocComments);
            ListNode list = nodeFactory.list(null, valueExpr);
            ExpressionStatementNode expressionStatement = nodeFactory.expressionStatement(list);
            return nodeFactory.statementList(statementList, expressionStatement);
    }
    else
View Full Code Here

                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)
                                    ||  mdi.getId().equals(StandardDefs.MD_EXPERIMENTAL))
                            {
                                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

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.