package test.parser;

import compiler.parser.Token;
import compiler.parser.Tokenizer;

/*
 * Created on 7 Apr 2010
 */

/**
 * @author Anthony Bryant
 * 
 */
public class ExpressionTokenizer extends Tokenizer
{
  
  private int state = 0;
  
  private static final Token[] TEST1 =
  {
    new Token(ExpressionType.NUMBER, new Number(1)),
    new Token(ExpressionType.TIMES, ExpressionType.TIMES),
    new Token(ExpressionType.NUMBER, new Number(2)),
    new Token(ExpressionType.PLUS, ExpressionType.PLUS),
    new Token(ExpressionType.NUMBER, new Number(3)),
    new Token(ExpressionType.MINUS, ExpressionType.MINUS),
    new Token(ExpressionType.LPAREN, ExpressionType.LPAREN),
    new Token(ExpressionType.NUMBER, new Number(12)),
    new Token(ExpressionType.MINUS, ExpressionType.MINUS),
    new Token(ExpressionType.NUMBER, new Number(6)),
    new Token(ExpressionType.RPAREN, ExpressionType.RPAREN)
  };
  
  private static final Token[] TEST2 =
  {
    new Token(ExpressionType.LPAREN, ExpressionType.LPAREN),
    new Token(ExpressionType.NUMBER, new Number(6)),
    new Token(ExpressionType.TIMES, ExpressionType.TIMES),
    new Token(ExpressionType.NUMBER, new Number(2)),
    new Token(ExpressionType.RPAREN, ExpressionType.RPAREN)
  };
  
  private Token[] tokens = TEST1;
  
  
  
  /**
   * @see compiler.parser.Tokenizer#generateToken()
   */
  @Override
  protected Token generateToken()
  {
    if (state < tokens.length)
    {
      state++;
      return tokens[state - 1];
    }
    
    return null;
  }
  
}

@@ -911,345 +911,8 @@
 %0A  %0A
-  private static final Token%5B%5D TEST2 =%0A  %7B%0A    new Token(ExpressionType.LPAREN, ExpressionType.LPAREN),%0A    new Token(ExpressionType.NUMBER, new Number(6)),%0A    new Token(ExpressionType.TIMES, ExpressionType.TIMES),%0A    new Token(ExpressionType.NUMBER, new Number(2)),%0A    new Token(ExpressionType.RPAREN, ExpressionType.RPAREN)%0A  %7D;%0A  %0A
   pr

Fix warning.