You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by go...@apache.org on 2013/04/19 02:01:19 UTC

git commit: [flex-falcon] - Deleted obsolete MXML tokens related to databinding.

Updated Branches:
  refs/heads/develop 745dbf413 -> 8610968d9


Deleted obsolete MXML tokens related to databinding.

These were TOKEN_DATABINDING, TOKEN_DATABINDING_START,
and TOKEN_DATABINDING_END.

I also deleted MXMLDatabindingData and MXMLDatabindingValue
and their corresponding interfaces.

These were vestiges of an old Adobe attempt to unify
the parsing of MXML and the parsing of E4X in AS.
This turned out to be a bad idea because of the
peculiarities of E4X.

A databinding expresssion in MXML cannot be considered a
single "unit" of MXML (i.e., one MXMLUnitData).
For example, a databinding expression inside a property tag
can span multiple MXML units representing text, comments,
CDATA, etc.

As a result, databinding parsing is not part of the syntactic
parsing of MXML that creates the MXML tokens and the MXMLData.
It is part of the higher-level semantic analysis that builds
the MXML AST.

Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/8610968d
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/8610968d
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/8610968d

Branch: refs/heads/develop
Commit: 8610968d9bedac7304e61ffdee469abc4593c0b8
Parents: 745dbf4
Author: Gordon Smith <go...@apache.org>
Authored: Thu Apr 18 17:01:17 2013 -0700
Committer: Gordon Smith <go...@apache.org>
Committed: Thu Apr 18 17:01:17 2013 -0700

----------------------------------------------------------------------
 .../flex/compiler/internal/mxml/MXMLData.java      |   10 --
 .../internal/mxml/MXMLDatabindingData.java         |   58 --------
 .../internal/mxml/MXMLDatabindingValue.java        |  113 ---------------
 .../internal/mxml/MXMLTagAttributeData.java        |    6 +-
 .../flex/compiler/mxml/IMXMLDatabindingData.java   |   33 -----
 .../flex/compiler/mxml/IMXMLDatabindingValue.java  |   33 -----
 .../flex/compiler/parsing/MXMLTokenTypes.java      |    3 -
 .../problems/MXMLUnexpectedDatabindingProblem.java |    4 +-
 8 files changed, 3 insertions(+), 257 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8610968d/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLData.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLData.java b/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLData.java
index 9c4c093..1c88a84 100644
--- a/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLData.java
+++ b/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLData.java
@@ -584,16 +584,6 @@ public class MXMLData implements IMXMLData
                         unit.setLocation(data, index);
                     }
                     break;
-                case MXMLTokenTypes.TOKEN_DATABINDING_START:
-                    unit = new MXMLDatabindingData(token, tokenIterator);
-                    units.add(unit);
-                    index++;
-                    if (fullContent)
-                    {
-                        unit.setParentUnitDataIndex(depth.peek());
-                        unit.setLocation(data, index);
-                    }
-                    break;
                 case MXMLTokenTypes.TOKEN_PROCESSING_INSTRUCTION:
                     unit = new MXMLInstructionData(token);
                     units.add(unit);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8610968d/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLDatabindingData.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLDatabindingData.java b/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLDatabindingData.java
deleted file mode 100644
index da7f720..0000000
--- a/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLDatabindingData.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-
-package org.apache.flex.compiler.internal.mxml;
-
-import java.util.ListIterator;
-
-import org.apache.flex.compiler.internal.parsing.mxml.MXMLToken;
-import org.apache.flex.compiler.mxml.IMXMLDatabindingData;
-import org.apache.flex.compiler.mxml.IMXMLDatabindingValue;
-import org.apache.flex.compiler.parsing.IASToken;
-
-/**
- * Represents a databinding expression found within content of MXML
- */
-public class MXMLDatabindingData extends MXMLUnitData implements
-        IMXMLDatabindingData
-{
-    /**
-     * Constructor.
-     */
-    MXMLDatabindingData(MXMLToken start, ListIterator<MXMLToken> iterator)
-    {
-        bindingValue = new MXMLDatabindingValue(start, iterator);
-
-        setOffsets(bindingValue.getAbsoluteStart(), bindingValue.getAbsoluteEnd());
-        setLine(start.getLine());
-        setColumn(start.getColumn());
-    }
-
-    private IMXMLDatabindingValue bindingValue;
-
-    //
-    // IMXMLDatabindingData implementations
-    //
-
-    @Override
-    public IASToken[] getDatabindingContent()
-    {
-        return bindingValue.getDatabindingContent();
-    }
-}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8610968d/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLDatabindingValue.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLDatabindingValue.java b/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLDatabindingValue.java
deleted file mode 100644
index 2eee4d1..0000000
--- a/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLDatabindingValue.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-
-package org.apache.flex.compiler.internal.mxml;
-
-import java.util.ArrayList;
-import java.util.ListIterator;
-
-import org.apache.flex.compiler.internal.parsing.mxml.MXMLToken;
-import org.apache.flex.compiler.mxml.IMXMLDatabindingValue;
-import org.apache.flex.compiler.mxml.IMXMLTagAttributeData;
-import org.apache.flex.compiler.mxml.IMXMLTextData.TextType;
-import org.apache.flex.compiler.parsing.IASToken;
-
-/**
- * Represents a databinding expression found within an attribute value
- */
-public class MXMLDatabindingValue extends MXMLTagAttributeValue implements
-        IMXMLDatabindingValue
-{
-    /**
-     * Constructor.
-     */
-    MXMLDatabindingValue(MXMLToken start, ListIterator<MXMLToken> iterator, IMXMLTagAttributeData parent)
-    {
-        super(parent);
-
-        setStart(start.getStart());
-        setColumn(start.getColumn());
-        setLine(start.getLine());
-
-        while (iterator.hasNext())
-        {
-            MXMLToken token = iterator.next();
-
-            setEnd(token.getEnd());
-
-            if (token.isASToken())
-                tokens.add(token);
-            else
-                break;
-        }
-    }
-
-    /**
-     * Constructor.
-     */
-    MXMLDatabindingValue(MXMLToken start, ListIterator<MXMLToken> iterator)
-    {
-        this(start, iterator, null);
-    }
-
-    private ArrayList<IASToken> tokens = new ArrayList<IASToken>(5);
-
-    //
-    // IMXMLTextData implementations
-    //
-
-    @Override
-    public String getContent()
-    {
-        StringBuilder builder = new StringBuilder();
-
-        final int size = tokens.size();
-        IASToken lastToken = null;
-        for (int i = 0; i < size; i++)
-        {
-            IASToken currentToken = tokens.get(i);
-            if (lastToken != null)
-            {
-                int spaces = currentToken.getStart() - lastToken.getEnd();
-                for (int s = 0; s < spaces; s++)
-                    builder.append(" ");
-            }
-            builder.append(currentToken.getText());
-            lastToken = currentToken;
-        }
-
-        return builder.toString();
-    }
-
-    @Override
-    public TextType getTextType()
-    {
-        return TextType.DATABINDING;
-    }
-
-    //
-    // IMXMLDatabindingData implementations
-    //
-
-    @Override
-    public IASToken[] getDatabindingContent()
-    {
-        return tokens.toArray(new IASToken[0]);
-    }
-}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8610968d/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLTagAttributeData.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLTagAttributeData.java b/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLTagAttributeData.java
index b921919..9a58a9a 100644
--- a/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLTagAttributeData.java
+++ b/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLTagAttributeData.java
@@ -91,11 +91,7 @@ public class MXMLTagAttributeData extends SourceLocation implements
         while (tokenIterator.hasNext())
         {
             token = tokenIterator.next();
-            if (token.getType() == MXMLTokenTypes.TOKEN_DATABINDING_START)
-            {
-                values.add(new MXMLDatabindingValue(token, tokenIterator, this));
-            }
-            else if (token.getType() == MXMLTokenTypes.TOKEN_STRING)
+            if (token.getType() == MXMLTokenTypes.TOKEN_STRING)
             {
                 values.add(new MXMLTextValue(token, this));
             }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8610968d/compiler/src/org/apache/flex/compiler/mxml/IMXMLDatabindingData.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/mxml/IMXMLDatabindingData.java b/compiler/src/org/apache/flex/compiler/mxml/IMXMLDatabindingData.java
deleted file mode 100644
index c9f96a7..0000000
--- a/compiler/src/org/apache/flex/compiler/mxml/IMXMLDatabindingData.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-
-package org.apache.flex.compiler.mxml;
-
-import org.apache.flex.compiler.parsing.IASToken;
-
-/**
- * Represents a text unit which is an MXML databinding expression.
- */
-public interface IMXMLDatabindingData extends IMXMLUnitData
-{
-    /**
-     * Returns the tokens that are contained within this databinding expression.
-     */
-    IASToken[] getDatabindingContent();
-}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8610968d/compiler/src/org/apache/flex/compiler/mxml/IMXMLDatabindingValue.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/mxml/IMXMLDatabindingValue.java b/compiler/src/org/apache/flex/compiler/mxml/IMXMLDatabindingValue.java
deleted file mode 100644
index cf17b98..0000000
--- a/compiler/src/org/apache/flex/compiler/mxml/IMXMLDatabindingValue.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- */
-
-package org.apache.flex.compiler.mxml;
-
-import org.apache.flex.compiler.parsing.IASToken;
-
-/**
- * Represents an attribute value which is an MXML databinding expression.
- */
-public interface IMXMLDatabindingValue extends IMXMLTagAttributeValue
-{
-    /**
-     * Returns the tokens that are contained within this databinding expression.
-     */
-    IASToken[] getDatabindingContent();
-}

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8610968d/compiler/src/org/apache/flex/compiler/parsing/MXMLTokenTypes.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/parsing/MXMLTokenTypes.java b/compiler/src/org/apache/flex/compiler/parsing/MXMLTokenTypes.java
index 0cf4173..969e38e 100644
--- a/compiler/src/org/apache/flex/compiler/parsing/MXMLTokenTypes.java
+++ b/compiler/src/org/apache/flex/compiler/parsing/MXMLTokenTypes.java
@@ -32,9 +32,6 @@ public interface MXMLTokenTypes
     public static final int TOKEN_CDATA = ASTokenTypes.TOKEN_E4X_CDATA;
     public static final int TOKEN_CLOSE_TAG_START = ASTokenTypes.TOKEN_E4X_CLOSE_TAG_START;
     public static final int TOKEN_COMMENT = ASTokenTypes.TOKEN_E4X_COMMENT;
-    public static final int TOKEN_DATABINDING = 1128;
-    public static final int TOKEN_DATABINDING_END = ASTokenTypes.TOKEN_E4X_BINDING_CLOSE;
-    public static final int TOKEN_DATABINDING_START = ASTokenTypes.TOKEN_E4X_BINDING_OPEN;
     public static final int TOKEN_DECIMAL_ENTITY = ASTokenTypes.TOKEN_E4X_DECIMAL_ENTITY;
     public static final int TOKEN_EMPTY_TAG_END = ASTokenTypes.TOKEN_E4X_EMPTY_TAG_END;
     public static final int TOKEN_ENTITY = ASTokenTypes.TOKEN_E4X_ENTITY;

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/8610968d/compiler/src/org/apache/flex/compiler/problems/MXMLUnexpectedDatabindingProblem.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/problems/MXMLUnexpectedDatabindingProblem.java b/compiler/src/org/apache/flex/compiler/problems/MXMLUnexpectedDatabindingProblem.java
index 4397ab9..13add76 100644
--- a/compiler/src/org/apache/flex/compiler/problems/MXMLUnexpectedDatabindingProblem.java
+++ b/compiler/src/org/apache/flex/compiler/problems/MXMLUnexpectedDatabindingProblem.java
@@ -19,7 +19,7 @@
 
 package org.apache.flex.compiler.problems;
 
-import org.apache.flex.compiler.mxml.IMXMLDatabindingData;
+import org.apache.flex.compiler.common.ISourceLocation;
 
 /**
  * Problem generated for an unexpected data binding expression.
@@ -31,7 +31,7 @@ public final class MXMLUnexpectedDatabindingProblem extends MXMLSemanticProblem
 
     public static final int errorCode = 1442;
     
-    public MXMLUnexpectedDatabindingProblem(IMXMLDatabindingData site)
+    public MXMLUnexpectedDatabindingProblem(ISourceLocation site)
     {
         super(site);
     }