<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/main/java/uk/co/badgersinfoil/metaas/impl</tt></b></td></tr>
<tr><td><tt><a href="#file1">TokenBuilder.java</a></tt> </td><td></td><td align="right" id="added">+9</td><td align="right" id="removed">-5</td><td nowrap="nowrap" align="center">501 -&gt; 502</td></tr>
<tr class="alt"><td><tt>antlr/<a href="#file2">BasicListUpdateDelegate.java</a></tt> </td><td></td><td align="right" id="added">+15</td><td align="right" id="removed">-10</td><td nowrap="nowrap" align="center">501 -&gt; 502</td></tr>
<tr><td><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/<a href="#file3"><span id="added">PlaceholderLinkedListToken.java</span></a></tt> </td><td></td><td align="right" id="added">+19</td><td></td><td nowrap="nowrap" align="right">added 502</td></tr>
<tr><td></td><td></td><td align="right" id="added">+43</td><td align="right" id="removed">-15</td><td></td></tr>
</table>
<small id="info">1 added + 2 modified, total 3 files</small><br />
<pre class="comment">
Improve VIRTUAL_PLACEHOLDER token infrastructure.
Previously, if an imaginary token (without children, and therefore with null start/stop tokens)
had a PLACEHOLDER node added as a child, there would subsequently be no easy way to know
that the parent is not itself a PLACEHOLDER node (since its start/stop tokens would now
point to the PLACEHOLDER token from the child).
By having a new token subclass specifically identify which node in the tree it is acting as
a placeholder for, we don't have this ambiguity any more.
The end result of all this is we can now create a METHOD_DEF imaginary node, and then
immidiately add an ANNOTATIONS placeholder node, without subsequent manipulation
of the METHOD_DEF node breking due to its being misidentified as a placeholder itself.
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname">metaas/trunk/src/main/java/uk/co/badgersinfoil/metaas/impl</span><br />
<div class="fileheader"><big><b>TokenBuilder.java</b></big> <small id="info">501 -&gt; 502</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/TokenBuilder.java        2007-08-03 00:01:26 UTC (rev 501)
+++ trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/TokenBuilder.java        2007-08-12 15:54:15 UTC (rev 502)
@@ -8,6 +8,8 @@
</small></pre><pre class="diff" id="context"> 
 import org.asdt.core.internal.antlr.AS3Parser;
 import uk.co.badgersinfoil.metaas.impl.antlr.LinkedListToken;
</pre><pre class="diff" id="added">+import uk.co.badgersinfoil.metaas.impl.antlr.LinkedListTree;
+import uk.co.badgersinfoil.metaas.impl.antlr.PlaceholderLinkedListToken;
</pre><pre class="diff" id="context"> 
 
 public class TokenBuilder {
</pre><pre class="diff"><small id="info">@@ -91,13 +93,15 @@
</small></pre><pre class="diff" id="context">         public static LinkedListToken newInterface() {
                 return newToken(AS3Parser.INTERFACE, "interface");
         }
</pre><pre class="diff" id="removed">-        
-        public static LinkedListToken newPlaceholder() {
-                LinkedListToken placeholder = new LinkedListToken(AS3Parser.VIRTUAL_PLACEHOLDER, "");
-                placeholder.setChannel(AS3Parser.CHANNEL_PLACEHOLDER);
-                return placeholder;
</pre><pre class="diff" id="added">+
+        public static LinkedListToken newFunction() {
+                return newToken(AS3Parser.FUNCTION, "function");
</pre><pre class="diff" id="context">         }
 
</pre><pre class="diff" id="added">+        public static LinkedListToken newPlaceholder(LinkedListTree held) {
+                return new PlaceholderLinkedListToken(held);
+        }
+
</pre><pre class="diff" id="context">         public static LinkedListToken newPlus() {
                 return newToken(AS3Parser.PLUS, "+");
         }
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname">metaas/trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/antlr</span><br />
<div class="fileheader"><big><b>BasicListUpdateDelegate.java</b></big> <small id="info">501 -&gt; 502</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/antlr/BasicListUpdateDelegate.java        2007-08-03 00:01:26 UTC (rev 501)
+++ trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/antlr/BasicListUpdateDelegate.java        2007-08-12 15:54:15 UTC (rev 502)
@@ -50,7 +50,8 @@
</small></pre><pre class="diff" id="context">         private boolean isPlaceholder(LinkedListTree ast) {
                 return ast.getStartToken()==ast.getStopToken()
                     &amp;&amp; ast.getStartToken()!=null
</pre><pre class="diff" id="removed">-                    &amp;&amp; ast.getStartToken().getType()==AS3Parser.VIRTUAL_PLACEHOLDER<span id="removedchars">;</span>
</pre><pre class="diff" id="added">+                    &amp;&amp; ast.getStartToken().getType()==AS3Parser.VIRTUAL_PLACEHOLDER
+                    &amp;&amp; ((PlaceholderLinkedListToken)ast.getStartToken()).getHeld()==ast;
</pre><pre class="diff" id="context">         }
 
         private LinkedListToken findTokenInsertionPointForChildWithinParent(LinkedListTree parent, LinkedListTree child) {
</pre><pre class="diff"><small id="info">@@ -180,12 +181,12 @@
</small></pre><pre class="diff" id="context">                 LinkedListToken stop = child.getStopToken();
                 LinkedListToken startPrev = start.getPrev();
                 LinkedListToken stopNext = stop.getNext();
</pre><pre class="diff" id="removed">-                if (startPrev == null) {
-                        throw new IllegalArgumentException("No start.prev: "+child);
-                }
-                if (stopNext == null) {
-                        throw new IllegalArgumentException("No stop.next: "+child+" (stop="+stop+")");
-                }
</pre><pre class="diff" id="added">+//                if (startPrev == null) {
+//                        throw new IllegalArgumentException("No start.prev: "+child);
+//                }
+//                if (stopNext == null) {
+//                        throw new IllegalArgumentException("No stop.next: "+child+" (stop="+stop+")");
+//                }
</pre><pre class="diff" id="context">                 if (parent.getChildCount() == 0
                  &amp;&amp; start == parent.getStartToken()
                  &amp;&amp; stop == parent.getStopToken())
</pre><pre class="diff"><small id="info">@@ -196,17 +197,21 @@
</small></pre><pre class="diff" id="context">                         // there's something in the token stream for the parent
                         // to reference, and the parent remains anchored to the
                         // appropriate location within the source code
</pre><pre class="diff" id="removed">-                        LinkedListToken placeholder = TokenBuilder.newPlaceholder();
</pre><pre class="diff" id="added">+                        LinkedListToken placeholder = TokenBuilder.newPlaceholder(<span id="addedchars">parent</span>);
</pre><pre class="diff" id="context">                         startPrev.setNext(placeholder);
                         stopNext.setPrev(placeholder);
</pre><pre class="diff" id="removed">-                        parent.setStartToken(placeholder);
-                        parent.setStopToken(placeholder);
</pre><pre class="diff" id="context">                 } else {
                         if (startPrev != null) {
                                 startPrev.setNext(stopNext);
                         } else if (stopNext != null) {  // so try the other way around,
                                 stopNext.setPrev(startPrev);
                         }
</pre><pre class="diff" id="added">+                        if (parent.getStartToken() == start) {
+                                parent.setStartToken(stopNext);
+                        }
+                        if (parent.getStopToken() == stop) {
+                                parent.setStopToken(startPrev);
+                        }
</pre><pre class="diff" id="context">                 }
                 // just to save possible confusion, break links out from the
                 // removed token list too,
</pre></div>
<hr /><a name="file3" /><div class="file">
<span class="pathname" id="added">metaas/trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/antlr</span><br />
<div class="fileheader" id="added"><big><b>PlaceholderLinkedListToken.java</b></big> <small id="info">added at 502</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/antlr/PlaceholderLinkedListToken.java                                (rev 0)
+++ trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/antlr/PlaceholderLinkedListToken.java        2007-08-12 15:54:15 UTC (rev 502)
@@ -0,0 +1,19 @@
</small></pre><pre class="diff" id="added">+package uk.co.badgersinfoil.metaas.impl.antlr;
+
+import org.asdt.core.internal.antlr.AS3Parser;
+
+public class PlaceholderLinkedListToken extends LinkedListToken {
+        private LinkedListTree held;
+
+        public PlaceholderLinkedListToken(LinkedListTree held) {
+                super(AS3Parser.VIRTUAL_PLACEHOLDER, "");
+                setChannel(AS3Parser.CHANNEL_PLACEHOLDER);
+                this.held = held;
+                held.setStartToken(this);
+                held.setStopToken(this);
+        }
+
+        public LinkedListTree getHeld() {
+                return held;
+        }        
+}
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -&gt; email">CVSspam</a> 0.2.12</small></center>
</body></html>