<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#copied {background-color:#ccccff;}
tr.alt #copied {background-color:#bbbbf7;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="5">Commit in <b><tt>metaas/trunk/src</tt></b></td></tr>
<tr><td><tt>main/antlr/org/asdt/core/internal/antlr/<a href="#file1">AS3.g3</a></tt> </td><td></td><td align="right" id="added">+10</td><td align="right" id="removed">-9</td><td nowrap="nowrap" align="center">513 -> 514</td></tr>
<tr class="alt"><td><tt>main/java/uk/co/badgersinfoil/metaas/impl/<a href="#file2">ASTASPackage.java</a></tt> </td><td></td><td align="right" id="added">+1</td><td align="right" id="removed">-1</td><td nowrap="nowrap" align="center">513 -> 514</td></tr>
<tr><td><tt> /<a href="#file3">ASTUtils.java</a></tt> </td><td></td><td align="right" id="added">+27</td><td align="right" id="removed">-8</td><td nowrap="nowrap" align="center">513 -> 514</td></tr>
<tr class="alt"><td><tt>test/java/uk/co/badgersinfoil/metaas/<a href="#file4">InvocationExpressionTests.java</a></tt> </td><td></td><td align="right" id="added">+13</td><td></td><td nowrap="nowrap" align="center">513 -> 514</td></tr>
<tr><td></td><td></td><td align="right" id="added">+51</td><td align="right" id="removed">-18</td><td></td></tr>
</table>
<small id="info">4 modified files</small><br />
<pre class="comment">
Improve AST consistency. In particular, use PROP_OR_IDENT in the identifier rule of the grammar, the same as we do elsewhere.
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname">metaas/trunk/src/main/antlr/org/asdt/core/internal/antlr</span><br />
<div class="fileheader"><big><b>AS3.g3</b></big> <small id="info">513 -> 514</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/antlr/org/asdt/core/internal/antlr/AS3.g3        2007-08-19 23:43:27 UTC (rev 513)
+++ trunk/src/main/antlr/org/asdt/core/internal/antlr/AS3.g3        2007-08-31 07:54:12 UTC (rev 514)
@@ -62,7 +62,7 @@
</small></pre><pre class="diff" id="context">         FOR_INIT; FOR_CONDITION; FOR_ITERATOR;
        FOR_EACH; FOR_IN;
        SWITCH_STATEMENT_LIST;
</pre><pre class="diff" id="removed">-        IDENTIFIER;
</pre><pre class="diff" id="added">+        IDENTIFIER; IDENTIFIER_STAR;
</pre><pre class="diff" id="context">         DEFAULT_XML_NAMESPACE;
        
        VIRTUAL_PLACEHOLDER;
</pre><pre class="diff"><small id="info">@@ -661,11 +661,12 @@
</small></pre><pre class="diff" id="context">                 
identifier
</pre><pre class="diff" id="removed">-        :        qualifiedIdent
</pre><pre class="diff" id="added">+        :        (         qualifiedIdent -> qualifiedIdent
+                )
</pre><pre class="diff" id="context">                 (        options{greedy=true;}
</pre><pre class="diff" id="removed">-                :         DOT qualifiedIdent
</pre><pre class="diff" id="added">+                :         poi=propOrIdent[root_0, retval.start] -> $poi
</pre><pre class="diff" id="context">                 )*
</pre><pre class="diff" id="removed">-                -> ^(IDENTIFIER qualifiedIdent+)
</pre><pre class="diff" id="added">+                -> ^(IDENTIFIER $identifier)
</pre><pre class="diff" id="context">        
qualifiedIdent
</pre><pre class="diff"><small id="info">@@ -690,7 +691,7 @@
</small></pre><pre class="diff" id="context">                 )*
                (        DOT STAR
                )?
</pre><pre class="diff" id="removed">-                -> ^(IDENTIFIER ident+ STAR?)
</pre><pre class="diff" id="added">+                -> ^(IDENTIFIER<span id="addedchars">_STAR</span> ident+ STAR?)
</pre><pre class="diff" id="context">        
annotations
</pre><pre class="diff"><small id="info">@@ -821,7 +822,7 @@
</small></pre><pre class="diff" id="context"> // This is a list of expressions.
expressionList
        :        assignmentExpression (COMMA assignmentExpression)*
</pre><pre class="diff" id="removed">-                -> ^(ELIST assignmentExpression+)
</pre><pre class="diff" id="added">+                -> assignmentExpression+
</pre><pre class="diff" id="context">        
// assignment expression (level 13)
</pre><pre class="diff"><small id="info">@@ -1043,13 +1044,13 @@
</small></pre><pre class="diff" id="context"> propOrIdent[LinkedListTree identPrimary, Token startToken]
        :        
                { retval.start = startToken; }
</pre><pre class="diff" id="removed">-                DOT propId=qualifiedIdent
</pre><pre class="diff" id="added">+                <span id="addedchars">d=</span>DOT propId=qualifiedIdent
</pre><pre class="diff" id="context">                 /* without further semantic analysis, we can't
                 tell if a.b is an access of the property 'b'
                 from the var 'a' or a reference to the type
                 'b' in the package 'a'. (This could be
                 resolved in an AST post-processing step) */
</pre><pre class="diff" id="removed">-                -> ^(PROPERTY_OR_IDENTIFIER {$identPrimary} $propId)
</pre><pre class="diff" id="added">+                -> ^(PROPERTY_OR_IDENTIFIER<span id="addedchars">[$d]</span> {$identPrimary} $propId)
</pre><pre class="diff" id="context">        
constant
</pre><pre class="diff"><small id="info">@@ -1096,7 +1097,7 @@
</small></pre><pre class="diff" id="context"> fullNewSubexpression
        :        (        primaryExpression -> primaryExpression
                )
</pre><pre class="diff" id="removed">-                (        DOT qualifiedIdent -> ^(DOT $fullNewSubexpression qualifiedIdent)
</pre><pre class="diff" id="added">+                (        d=DOT qualifiedIdent -> ^(PROPERTY_OR_IDENTIFIER[$d] $fullNewSubexpression qualifiedIdent)
</pre><pre class="diff" id="context">                 |        brackets -> ^(ARRAY_ACC $fullNewSubexpression brackets)
                )*
       
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname">metaas/trunk/src/main/java/uk/co/badgersinfoil/metaas/impl</span><br />
<div class="fileheader"><big><b>ASTASPackage.java</b></big> <small id="info">513 -> 514</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/ASTASPackage.java        2007-08-19 23:43:27 UTC (rev 513)
+++ trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/ASTASPackage.java        2007-08-31 07:54:12 UTC (rev 514)
@@ -74,7 +74,7 @@
</small></pre><pre class="diff" id="context">         }
        private String importText(LinkedListTree imp) {
</pre><pre class="diff" id="removed">-                return ASTUtils.identText(imp.getFirstChild());
</pre><pre class="diff" id="added">+                return ASTUtils.ident<span id="addedchars">Star</span>Text(imp.getFirstChild());
</pre><pre class="diff" id="context">         }
        public boolean removeImport(String name) {
</pre></div>
<hr /><a name="file3" /><div class="file">
<span class="pathname">metaas/trunk/src/main/java/uk/co/badgersinfoil/metaas/impl</span><br />
<div class="fileheader"><big><b>ASTUtils.java</b></big> <small id="info">513 -> 514</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/ASTUtils.java        2007-08-19 23:43:27 UTC (rev 513)
+++ trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/ASTUtils.java        2007-08-31 07:54:12 UTC (rev 514)
@@ -67,23 +67,42 @@
</small></pre><pre class="diff" id="context">                 if (ast.getType() != AS3Parser.IDENTIFIER) {
                        throw new IllegalArgumentException("expected IDENTIFIER, but token was a " + tokenName(ast));
                }
</pre><pre class="diff" id="added">+                return stringifyIdentAux((LinkedListTree)ast.getChild(0));
+        }
+        
+        private static String stringifyIdentAux(LinkedListTree ast) {
</pre><pre class="diff" id="context">                 StringBuffer result = new StringBuffer();
</pre><pre class="diff" id="added">+                if (ast.getType()==AS3Parser.DBL_COLON) {
+                        result.append(ast.getFirstChild());
+                        result.append("::");
+                        result.append(ast.getLastChild());
+                } else if (ast.getType()==AS3Parser.PROPERTY_OR_IDENTIFIER
+                 || ast.getType()==AS3Parser.DOT)
+                {
+                        result.append(stringifyIdentAux(ast.getFirstChild()));
+                        result.append(".");
+                        result.append(stringifyIdentAux(ast.getLastChild()));
+                } else {
+                        result.append(ast.getText());
+                }
+                return result.toString();
+        }
+
+        public static String identStarText(LinkedListTree ast) {
+                if (ast.getType() != AS3Parser.IDENTIFIER_STAR) {
+                        throw new IllegalArgumentException("expected IDENTIFIER_STAR, but token was a " + tokenName(ast));
+                }
+                StringBuffer result = new StringBuffer();
</pre><pre class="diff" id="context">                 for (int i=0; i<ast.getChildCount(); i++) {
                        LinkedListTree part = (LinkedListTree)ast.getChild(i);
                        if (result.length() > 0) {
                                result.append(".");
                        }
</pre><pre class="diff" id="removed">-                        if (part.getType()==AS3Parser.DBL_COLON) {
-                                result.append(part.getFirstChild());
-                                result.append("::");
-                                result.append(part.getLastChild());
-                        } else {
-                                result.append(part.getText());
-                        }
</pre><pre class="diff" id="added">+                        result.append(part.getText());
</pre><pre class="diff" id="context">                 }
                return result.toString();
        }
</pre><pre class="diff" id="removed">-        
</pre><pre class="diff" id="added">+
</pre><pre class="diff" id="context">         /**
         * Stringifies the type name from the given TYPE_SPEC node.
         */
</pre></div>
<hr /><a name="file4" /><div class="file">
<span class="pathname">metaas/trunk/src/test/java/uk/co/badgersinfoil/metaas</span><br />
<div class="fileheader"><big><b>InvocationExpressionTests.java</b></big> <small id="info">513 -> 514</small></div>
<pre class="diff"><small id="info">--- trunk/src/test/java/uk/co/badgersinfoil/metaas/InvocationExpressionTests.java        2007-08-19 23:43:27 UTC (rev 513)
+++ trunk/src/test/java/uk/co/badgersinfoil/metaas/InvocationExpressionTests.java        2007-08-31 07:54:12 UTC (rev 514)
@@ -1,10 +1,15 @@
</small></pre><pre class="diff" id="context"> package uk.co.badgersinfoil.metaas;
</pre><pre class="diff" id="added">+import java.io.StringWriter;
</pre><pre class="diff" id="context"> import java.util.ArrayList;
import java.util.List;
import uk.co.badgersinfoil.metaas.dom.ASExpression;
import uk.co.badgersinfoil.metaas.dom.ASIntegerLiteral;
import uk.co.badgersinfoil.metaas.dom.ASInvocationExpression;
</pre><pre class="diff" id="added">+import uk.co.badgersinfoil.metaas.impl.AS3FragmentParser;
+import uk.co.badgersinfoil.metaas.impl.ASTASInvocationExpression;
+import uk.co.badgersinfoil.metaas.impl.ASTPrinter;
+import uk.co.badgersinfoil.metaas.impl.antlr.LinkedListTree;
</pre><pre class="diff" id="context"> import junit.framework.TestCase;
public class InvocationExpressionTests extends TestCase {
</pre><pre class="diff"><small id="info">@@ -18,6 +23,14 @@
</small></pre><pre class="diff" id="context">                 sub = fact.newExpression("com.example.MyClass");
        }
</pre><pre class="diff" id="added">+        public void tearDown() {
+                StringWriter buff = new StringWriter();
+                LinkedListTree ast = ((ASTASInvocationExpression)expr).getAST();
+                new ASTPrinter(buff).print(ast);
+                LinkedListTree parsed = AS3FragmentParser.parseExpr(buff.toString());
+                CodeMirror.assertASTMatch(ast, parsed);
+        }
+
</pre><pre class="diff" id="context">         public void testBasic() {
                args.add(fact.newIntegerLiteral(1));
                expr = fact.newInvocationExpression(sub, args);
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.12</small></center>
</body></html>