@@ -0,0 +1,2292 @@
+package pw.koj.jetstreem.ast;%0A%0Aimport java.util.*;%0Aimport pw.koj.jetstreem.parser.Token;%0Aimport pw.koj.jetstreem.parser.ParserConstants;%0A%0Apublic class StrmToken implements Iterable%3CStrmToken%3E %7B%0A    private Token token;%0A    private boolean isSpecial;%0A%0A    public StrmToken(Token token) %7B%0A        this(token, false);%0A    %7D%0A%0A    public StrmToken(Token token, boolean isSpecial) %7B%0A        this.token = token;%0A        this.isSpecial = isSpecial;%0A    %7D%0A%0A    public boolean isSpecial() %7B%0A        return isSpecial;%0A    %7D%0A%0A    public int kind() %7B%0A        return token.kind;%0A    %7D%0A%0A    public String kindName() %7B%0A        return ParserConstants.tokenImage%5Btoken.kind%5D;%0A    %7D%0A%0A    public int lineno() %7B%0A        return token.beginLine;%0A    %7D%0A%0A    public int column() %7B%0A        return token.beginColumn;%0A    %7D%0A%0A    public String image() %7B%0A        return token.image;%0A    %7D%0A%0A    public Iterator%3CStrmToken%3E iterator() %7B%0A        return buildTokenList(token, false).iterator();%0A    %7D%0A%0A    private List%3CStrmToken%3E tokenWithoutFirstSpecials() %7B%0A        return buildTokenList(token, true);%0A    %7D%0A%0A    private List%3CStrmToken%3E buildTokenList(Token first, boolean ignoreFirstSpecials) %7B%0A        List%3CStrmToken%3E result = new ArrayList%3CStrmToken%3E();%0A        boolean ignoreSpecials = ignoreFirstSpecials;%0A        for (Token t = first; t != null; t = t.next) %7B%0A            if (t.specialToken != null && !ignoreSpecials) %7B%0A                Token s = specialTokenHead(t.specialToken);%0A                for (; s != null; s = s.next) %7B%0A                    result.add(new StrmToken(s));%0A                %7D%0A            %7D%0A            result.add(new StrmToken(t));%0A            ignoreSpecials = false;%0A        %7D%0A        return result;%0A    %7D%0A%0A    private Token specialTokenHead(Token firstSpecial) %7B%0A        Token s = firstSpecial;%0A        while (s.specialToken != null) %7B%0A            s = s.specialToken;%0A        %7D%0A        return s;%0A    %7D%0A%0A    public String includedLine() %7B%0A        StringBuffer buf = new StringBuffer();%0A        for (StrmToken t: tokenWithoutFirstSpecials()) %7B%0A            int idx = t.image().indexOf(%22%5Cn%22);%0A            if (idx %3E= 0) %7B%0A                buf.append(t.image().substring(0, idx));%0A                break;%0A            %7D%0A            buf.append(t.image());%0A        %7D%0A        return buf.toString();%0A    %7D%0A%7D%0A%0A

add class StrmToken