<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/antlr</tt></b></td></tr>
<tr><td><tt><a href="#file1">LinkedListTokenStream.java</a></tt> </td><td></td><td align="right" id="added">+4</td><td align="right" id="removed">-58</td><td nowrap="nowrap" align="center">361 -&gt; 362</td></tr>
</table>
<pre class="comment">
remove code copied from the ANTLR example which we don't actually need
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname">metaas/trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/antlr</span><br />
<div class="fileheader"><big><b>LinkedListTokenStream.java</b></big> <small id="info">361 -&gt; 362</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/antlr/LinkedListTokenStream.java        2007-01-20 17:44:02 UTC (rev 361)
+++ trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/antlr/LinkedListTokenStream.java        2007-01-20 17:53:30 UTC (rev 362)
@@ -4,10 +4,6 @@
</small></pre><pre class="diff" id="context"> 
 package uk.co.badgersinfoil.metaas.impl.antlr;
 
</pre><pre class="diff" id="removed">-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
</pre><pre class="diff" id="context"> import org.antlr.runtime.CharStream;
 import org.antlr.runtime.Token;
 import org.antlr.runtime.TokenSource;
</pre><pre class="diff"><small id="info">@@ -19,12 +15,6 @@
</small></pre><pre class="diff" id="context">         protected LinkedListToken head;
         protected LinkedListToken tail;
 
</pre><pre class="diff" id="removed">-        /** Map&lt;tokentype, channel&gt; to override some Tokens' channel numbers */
-        protected Map channelOverrideMap;
-
-        /** Set&lt;tokentype&gt;; discard any tokens with this type */
-        protected Set discardSet;
-
</pre><pre class="diff" id="context">         /** Skip tokens on any channel but this one; this is how we skip whitespace... */
         protected int channel = Token.DEFAULT_CHANNEL;
 
</pre><pre class="diff"><small id="info">@@ -87,21 +77,9 @@
</small></pre><pre class="diff" id="context">                 LinkedListToken t = (LinkedListToken)tokenSource.nextToken();
                 while ( t!=null &amp;&amp; t.getType()!=CharStream.EOF ) {
                         boolean discard = false;
</pre><pre class="diff" id="removed">-                        if ( discardSet!=null &amp;&amp;
-                                 discardSet.contains(new Integer(t.getType())) )
-                        {
</pre><pre class="diff" id="added">+                        if ( discardOffChannelTokens &amp;&amp; t.getChannel()!=this.channel ) {
</pre><pre class="diff" id="context">                                 discard = true;
                         }
</pre><pre class="diff" id="removed">-                        else if ( discardOffChannelTokens &amp;&amp; t.getChannel()!=this.channel ) {
-                                discard = true;
-                        }
-                        // is there a channel override for token type?
-                        else if ( channelOverrideMap!=null ) {
-                                Integer channelI = findChannel(t.getType());
-                                if ( channelI!=null ) {
-                                        t.setChannel(channelI.intValue());
-                                }
-                        }
</pre><pre class="diff" id="context">                         if ( !discard )        {
                                 if (head == null &amp;&amp; tail == null) {
                                         head = tail = t;
</pre><pre class="diff"><small id="info">@@ -129,10 +107,6 @@
</small></pre><pre class="diff" id="context">                 return next;
         }
 
</pre><pre class="diff" id="removed">-        private Integer findChannel(int type) {
-                return (Integer)
-                        channelOverrideMap.get(new Integer(type));
-        }
</pre><pre class="diff" id="context"> 
         /** Return absolute token i; ignore which channel the tokens are on;
          *  that is, count all tokens not just on-channel tokens.
</pre><pre class="diff"><small id="info">@@ -227,17 +201,9 @@
</small></pre><pre class="diff" id="context">         }
 
         public void consume() {
</pre><pre class="diff" id="removed">-                // TODO: can we just set p=null here to avoid being 1 token ahead all the time?
-//                if (p == null) {
-//                        p = head;
-//                } else {
-//                        p = succ(p);
-                        do {
-                                p = p.getNext();
-                        } while (p != null &amp;&amp; p.getChannel() != channel);
-//                }
-//                p = skipOffTokenChannels(p); // leave p on valid token
-//                p = null;
</pre><pre class="diff" id="added">+                do {
+                        p = p.getNext();
+                } while (p != null &amp;&amp; p.getChannel() != channel);
</pre><pre class="diff" id="context">         }
 
         public int index() {
</pre><pre class="diff"><small id="info">@@ -286,26 +252,6 @@
</small></pre><pre class="diff" id="context">         }
 
 
</pre><pre class="diff" id="removed">-        /** A simple filter mechanism whereby you can tell this token stream
-         *  to force all tokens of type ttype to be on channel.  For example,
-         *  when interpreting, we cannot exec actions so we need to tell
-         *  the stream to force all WS and NEWLINE to be a different, ignored
-         *  channel.
-         */
-        public void setTokenTypeChannel(int ttype, int channel) {
-                if ( channelOverrideMap==null ) {
-                        channelOverrideMap = new HashMap();
-                }
-                channelOverrideMap.put(new Integer(ttype), new Integer(channel));
-        }
-
-        public void discardTokenType(int ttype) {
-                if ( discardSet==null ) {
-                        discardSet = new HashSet();
-                }
-                discardSet.add(new Integer(ttype));
-        }
-
</pre><pre class="diff" id="context">         public void discardOffChannelTokens(boolean discardOffChannelTokens) {
                 this.discardOffChannelTokens = discardOffChannelTokens;
         }
</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>