Examples of IMXMLUnitData


Examples of org.apache.flex.compiler.mxml.IMXMLUnitData

     * @return An InstructionList that contains the instructions to set the
     * target expression
     */
    private InstructionList getTargetInstructions(IMXMLUnitData data, IMXMLTagAttributeData attr)
    {
        IMXMLUnitData d = data;
        Stack<IMXMLUnitData> parentStack = new Stack<IMXMLUnitData>();

        if (isOnlyTextChild(d))
        {
            // If we are the only text child of a TagData, then start with the TagData,
            // as that is what we'll be setting
            d = d.getParentUnitData();
        }
        IMXMLUnitData target = d;

        // push parents onto a stack, so we can walk down from the parent later
        while (d != null)
        {
            parentStack.add(d);
            d = d == rootTag ? null : d.getParentUnitData();
        }

        InstructionList il = new InstructionList();
        // we're always going to start with "this"
        il.addInstruction(ABCConstants.OP_getlocal0);

        // Walk down the parent stack, and emit get instructions for each tag
        // except for the last one, which is the one we're targeting
        while (parentStack.size() > 1)
        {
            IMXMLUnitData unitData = parentStack.pop();
            if (unitData instanceof IMXMLTagData)
            {
                generateGetInstructions(il, (IMXMLTagData)unitData);
            }
        }
View Full Code Here

Examples of org.apache.flex.compiler.mxml.IMXMLUnitData

     * Get the index of a text data. Grabs the parent, and iterates it's
     * children to find out what the index of the text data passed in should be
     */
    private int getIndexOfText(IMXMLTextData text)
    {
        IMXMLUnitData parent = text.getParentUnitData();

        IMXMLTagData parentTag = parent instanceof IMXMLTagData ? (IMXMLTagData)parent : null;
        int index = 0;

        if (parentTag != null)
View Full Code Here

Examples of org.apache.flex.compiler.mxml.IMXMLUnitData

     */
    private boolean isOnlyTextChild(IMXMLUnitData child)
    {
        if (child instanceof IMXMLTextData && ((IMXMLTextData)child).getTextType() == TextType.TEXT)
        {
            IMXMLUnitData p = child.getParentUnitData();
            IMXMLTagData parent = p instanceof IMXMLTagData ? (IMXMLTagData)p : null;
            if (parent != null)
            {
                return parent.getFirstChildUnit() == child && child.getNextSiblingUnit() == null;
            }
View Full Code Here

Examples of org.apache.flex.compiler.mxml.IMXMLUnitData

     */
    protected void setLocation(MXMLTreeBuilder builder, List<IMXMLUnitData> units)
    {
        int n = units.size();

        IMXMLUnitData firstUnit = units.get(0);
        IMXMLUnitData lastUnit = units.get(n - 1);

        // we only store the open tags in the units
        // and the end offset should be the end of the last close tag
        // check this here and fetch the end tag if the last tag is an open and non-empty tag
        if (lastUnit instanceof IMXMLTagData && lastUnit.isOpenAndNotEmptyTag())
        {
            IMXMLUnitData endTag = (IMXMLUnitData)((IMXMLTagData)lastUnit).findMatchingEndTag();
            if (endTag != null)
                lastUnit = endTag;
        }

        String sourcePath = firstUnit.getSourcePath();
View Full Code Here

Examples of org.apache.flex.compiler.mxml.IMXMLUnitData

                    return true;
                //if we are not zero, scan backwards to see if there is a tag before us
                index--;
                while (index >= 0)
                {
                    IMXMLUnitData unit = getParent().getUnit(index);
                    if (unit == null || unit.isTag())
                        return false;
                    index--;
                }
                return true;
            }
View Full Code Here

Examples of org.apache.flex.compiler.mxml.IMXMLUnitData

        {
            IMXMLUnitData[] list = getParent().getUnits();
            int index = getIndex() + 1;
            for (int i = index; i < list.length; i++)
            {
                IMXMLUnitData next = list[i];
                if (next instanceof IMXMLTextData && ((IMXMLTextData)next).getTextType() == TextType.WHITESPACE)
                    continue;
                if (next.isText())
                {
                    startOffset = startOffset == -1 ? next.getAbsoluteStart() : startOffset;
                    endOffset = next.getAbsoluteEnd();
                }
                else
                {
                    if (startOffset == -1 && endOffset == -1)
                    {
                        startOffset = getAbsoluteEnd();
                        endOffset = next.getAbsoluteStart();
                    }
                    break;
                }
            }
        }
View Full Code Here

Examples of org.apache.flex.compiler.mxml.IMXMLUnitData

        IMXMLUnitData[] list = getParent().getUnits();
        FastStack<IMXMLTagData> tagStack = new FastStack<IMXMLTagData>();
        IMXMLTagData result = null;
        for (int i = startTag.getIndex(); i < list.length; i++)
        {
            IMXMLUnitData curUnit = list[i];
            if (curUnit.isTag())
            {
                IMXMLTagData curTag = (IMXMLTagData)curUnit;
                if (curTag.isEmptyTag())
                {
                    // do nothing for empty tags.
View Full Code Here

Examples of org.apache.flex.compiler.mxml.IMXMLUnitData

    {
        // If this tag is <foo/> then it has no child units.
        if (!isOpenAndNotEmptyTag())
            return null;

        IMXMLUnitData next = getNext();

        // If this tag is followed immediately by its end tag,
        // as in <foo></foo>, then it has no child units.
        if (next == findMatchingEndTag())
            return null;
View Full Code Here

Examples of org.apache.flex.compiler.mxml.IMXMLUnitData

     * Return the parent tag of this tag. If the document is not balanced before
     * this tag, returns null.
     */
    public IMXMLTagData getParentTag()
    {
        IMXMLUnitData data = getParentUnitData();
        if (data instanceof IMXMLTagData)
            return (IMXMLTagData)data;
        return null;
    }
View Full Code Here

Examples of org.apache.flex.compiler.mxml.IMXMLUnitData

          parent.addOpenTag(openTag);
        } else {
          int pos = openTag.getIndex();
          int tokenSize = data.length;
          while(pos < tokenSize) {
            IMXMLUnitData currToken = data[pos];
            if(currToken instanceof MXMLTagData && !((MXMLTagData)currToken).hasExplicitCloseTag()) {
                problems.add(new SyntaxProblem(currToken, ((MXMLTagData)currToken).getName()));
                FakeMXMLTagData fakeMXMLTagData = new FakeMXMLTagData((MXMLTagData)currToken, true);
                            data[pos] = fakeMXMLTagData;
                            prefixMap.remove((MXMLTagData)currToken);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.