Package org.apache.flex.compiler.internal.parsing

Examples of org.apache.flex.compiler.internal.parsing.ISourceFragment


            int n = sourceFragmentList.size();

            if (n == 0)
                return null;

            ISourceFragment firstFragment = sourceFragmentList.get(0);
            ISourceFragment lastFragment = sourceFragmentList.get(n - 1);

            int start = firstFragment.getPhysicalStart();
            int end = lastFragment.getPhysicalStart() + lastFragment.getPhysicalText().length();
            int line = firstFragment.getPhysicalLine();
            int column = firstFragment.getPhysicalColumn();

            return new SourceLocation(sourcePath, start, end, line, column);
        }
View Full Code Here


                                          MXMLDialect mxmlDialect,
                                          Collection<ICompilerProblem> problems)
    {
        List<ISourceFragment> fragmentList = new ArrayList<ISourceFragment>();
       
        ISourceFragment fragment;
       
        // If the input string doesn't contain an ampersand character,
        // then there are no entities to replace; just return a single
        // fragment corresponding to the input string.
        int ampersandIndex = s.indexOf(AMPERSAND);
View Full Code Here

            }

            case WHITESPACE:
            {
                // WHITESPACE creates only a single fragment.
                ISourceFragment fragment = new SourceFragment(text, location);
                return new ISourceFragment[] {fragment};
            }

            case CDATA:
            {
                // CDATA creates only a single fragment.
                ISourceFragment fragment = new SourceFragment(text, getContents(), getContentsStart(), getContentsLine(), getContentsColumn());
                return new ISourceFragment[] {fragment};
            }

            default:
            {
View Full Code Here

        // and decremented by each '}'.
        int nesting = 0;

        // These keep track of where we found a '{' that starts
        // a databinding, while we look for the matching '}'.
        ISourceFragment leftBraceFragment = null;
        int leftBraceCharIndex = -1;

        // This flag keeps track of whether we've seen a backslash,
        // which escapes the databinding meaning of '{'.
        boolean escape = false;
View Full Code Here

                // the '{' and '}' characters.
                // Add each subfragment to the appropriate list.
                int beginIndex = 0;
                for (int braceIndex : braceIndices)
                {
                    ISourceFragment subfragment =
                            ((SourceFragment)fragment).subfragment(beginIndex, braceIndex);
                    if (subfragment != null)
                    {
                        currentList = newFragmentList(result, inDataBinding);
                        currentList.add(subfragment);
View Full Code Here

        String text = SourceFragmentsReader.concatLogicalText(fragments);

        LiteralNode stringLiteralNode = new LiteralNode(LiteralType.STRING, text);
        stringLiteralNode.setParent(parent);

        ISourceFragment firstFragment = fragments[0];
        ISourceFragment lastFragment = fragments[fragments.length - 1];
        stringLiteralNode.setSourcePath(sourceLocation.getSourcePath());
        stringLiteralNode.setStart(firstFragment.getPhysicalStart());
        stringLiteralNode.setEnd(lastFragment.getPhysicalStart() + lastFragment.getPhysicalText().length());
        stringLiteralNode.setLine(firstFragment.getPhysicalLine());
        stringLiteralNode.setColumn(firstFragment.getPhysicalColumn());

        return stringLiteralNode;
    }
View Full Code Here

            ICompilerProject project)
    {
        MXMLSingleDataBindingNode result = new MXMLSingleDataBindingNode((NodeBase)parent);

        // Set location information for the MXMLDataBindingNode.
        ISourceFragment firstFragment = fragments.get(0);
        ISourceFragment lastFragment = fragments.get(fragments.size() - 1);
        result.setSourcePath(sourceLocation.getSourcePath());
        result.setStart(firstFragment.getPhysicalStart() - 1);
        result.setEnd(lastFragment.getPhysicalStart() + lastFragment.getPhysicalText().length() + 1);
        result.setLine(firstFragment.getPhysicalLine());
        result.setColumn(firstFragment.getPhysicalColumn() - 1);

        // Parse the fragments inside the databinding expression.
        Reader reader = new SourceFragmentsReader(sourceLocation.getSourcePath(), fragments.toArray(new ISourceFragment[0]));
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.internal.parsing.ISourceFragment

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.