package stupid;

import rebelsky.compiler.lexer.Identifier;
import rebelsky.compiler.lexer.NamedToken;
import rebelsky.compiler.lexer.ProgramSymbol;
import rebelsky.compiler.lexer.Token;

/**
 * A collection of the key tokens and token types for Stupid
 *
 * @author Samuel A. Rebelsky
 * @version 1.1.1 of April 2004 
 */
public class StupidTokens
{
  // +-------------------+-------------------------------------------------
  // | Helpful Variables |
  // +-------------------+
 
  private static int tokType = Token.FIRSTID;


  // +------------------------+--------------------------------------------
  // | Constants: Token Types |
  // +------------------------+

  /** General category: String. */
  public static final int STRING = 	  ++tokType;
  /** General category: Integer. */
  public static final int INT = 	  ++tokType;
  /** General category: Real. */
  public static final int REAL = 	  ++tokType;

  /** Keyword: AND. */
  public static final int AND = 	++tokType;
  /** Keyword: BEGIN. */
  public static final int BEGIN = 	++tokType;
  /** Keyword: DO. */
  public static final int DO = 	++tokType;
  /** Keyword: ELSE. */
  public static final int ELSE = 	++tokType;
  /** Keyword: END. */
  public static final int END = 	++tokType;
  /** Keyword: IF. */
  public static final int IF = 		++tokType;
  /** Keyword: MOD. */
  public static final int MOD = 	++tokType;
  /** Keyword: NOT. */
  public static final int NOT = 	++tokType;
  /** Keyword: OR. */
  public static final int OR = 		++tokType;
  /** Keyword: PROGRAM. */
  public static final int PROGRAM = 	++tokType;
  /** Keyword: READ. */
  public static final int READ = 	++tokType;
  /** Keyword: THEN. */
  public static final int THEN = 	++tokType;
  /** Keyword: VAR. */
  public static final int VAR = 	++tokType;
  /** Keyword: WHILE. */
  public static final int WHILE = 	++tokType;
  /** Keyword: WRITE. */
  public static final int WRITE = 	++tokType;
  /** Keyword: WRITELN. */
  public static final int WRITELN = 	++tokType;

  /** Operation: Assignment. */
  public static final int ASSIGN = 	++tokType;
  /** Operation: Addition. */
  public static final int PLUS = 	++tokType;
  /** Operation: Subtraction. */
  public static final int MINUS = 	++tokType;
  /** Operation: Multiplication. */
  public static final int TIMES = 	++tokType;
  /** Operation: Division. */
  public static final int DIVIDE = 	++tokType;
  /** Operation: Integer Division. */
  public static final int DIV = 	++tokType;
  /** Operation: Equality Comparison . */
  public static final int EQUALS = 	++tokType;
  /** Operation: Inequality . */
  public static final int NOTEQUALS = 	++tokType;
  /** Operation: Less-Than. */
  public static final int LESSTHAN = 	++tokType;
  /** Operation: Greater-Than. */
  public static final int GREATERTHAN =++tokType;
  /** Operation: Less-Than-Or-Equal-To. */
  public static final int LESSEQ = 	++tokType;
  /** Operation: Greater-Than-Or-Equal-To. */
  public static final int GREATEREQ = 	++tokType;

  /** Notation: Open Parenthesis. */
  public static final int OPENPAREN = 	++tokType;
  /** Notation: Close Parenthesis. */
  public static final int CLOSEPAREN = 	++tokType;
  /** Notation: Period. */
  public static final int PERIOD =	++tokType;
  /** Notation: Comma. */
  public static final int COMMA =	++tokType;
  /** Notation: Semicolon. */
  public static final int SEMI =	++tokType;
  /** Notation: Colon. */
  public static final int COLON = 	++tokType;


  // +-------------------+-------------------------------------------------
  // | Constants: Tokens |
  // +-------------------+

  /** Identifier: BOOLEAN. */
  public static final Token TBOOLEAN = new Identifier("BOOLEAN");
  /** Identifier: INTEGER. */
  public static final Token TINTEGER = new Identifier("INTEGER");
  /** Identifier: REAL. */
  public static final Token TREAL = new Identifier("REAL");
  /** Identifier: CHAR. */
  public static final Token TCHAR = new Identifier("CHAR");

  /** Identifier: FALSE. */
  public static final Token TFALSE = new Identifier("FALSE");
  /** Identifier: TRUE. */
  public static final Token TTRUE = new Identifier("TRUE");

  /** Keyword: AND. */
  public static final Token TAND = new NamedToken("AND", AND);
  /** Keyword: BEGIN. */
  public static final Token TBEGIN = new NamedToken("BEGIN", BEGIN);
  /** Keyword: DO. */
  public static final Token TDO = new NamedToken("DO", DO);
  /** Keyword: ELSE. */
  public static final Token TELSE = new NamedToken("ELSE", ELSE);
  /** Keyword: END. */
  public static final Token TEND = new NamedToken("END", END);
  /** Keyword: IF. */
  public static final Token TIF = new NamedToken("IF", IF);
  /** Keyword: MOD. */
  public static final Token TMOD = new NamedToken("MOD", MOD);
  /** Keyword: NOT. */
  public static final Token TNOT = new NamedToken("NOT", NOT);
  /** Keyword: OR. */
  public static final Token TOR = new NamedToken("OR", OR);
  /** Keyword: PROGRAM. */
  public static final Token TPROGRAM = new NamedToken("PROGRAM", PROGRAM);
  /** Keyword: READ. */
  public static final Token TREAD = new NamedToken("READ", READ);
  /** Keyword: THEN. */
  public static final Token TTHEN = new NamedToken("THEN", THEN);
  /** Keyword: VAR. */
  public static final Token TVAR = new NamedToken("VAR", VAR);
  /** Keyword: WHILE. */
  public static final Token TWHILE = new NamedToken("WHILE", WHILE);
  /** Keyword: WRITE. */
  public static final Token TWRITE = new NamedToken("WRITE", WRITE);
  /** Keyword: WRITELN. */
  public static final Token TWRITELN = new NamedToken("WRITELN", WRITELN);

  /** Operation: Assignment. */
  public static final Token TASSIGN = new ProgramSymbol(":=", ASSIGN);
  /** Operation: Addition. */
  public static final Token TPLUS = new ProgramSymbol("+", PLUS);
  /** Operation: Subtraction. */
  public static final Token TMINUS = new ProgramSymbol("-", MINUS);
  /** Operation: Multiplication . */
  public static final Token TTIMES = new ProgramSymbol("*", TIMES);
  /** Operation: Division . */
  public static final Token TDIVIDE = new ProgramSymbol("/", DIVIDE);
  /** Operation: Integer Division. */
  public static final Token TDIV = new ProgramSymbol("DIV", DIV);
  /** Operation: Modulus. */
  public static final Token TEQUALS = new ProgramSymbol("=", EQUALS);
  /** Operation: Inequality . */
  public static final Token TNOTEQUALS = new ProgramSymbol("<>", NOTEQUALS);
  /** Operation: Less-Than. */
  public static final Token TLESSTHAN = new ProgramSymbol("<", LESSTHAN);
  /** Operation: Greater-Than. */
  public static final Token TGREATERTHAN = new ProgramSymbol(">", GREATERTHAN);
  /** Operation: Less-Than-Or-Equal-To. */
  public static final Token TLESSEQ = new ProgramSymbol("<=", LESSEQ);
  /** Operation: Greater-Than-Or-Equal-To. */
  public static final Token TGREATEREQ = new ProgramSymbol(">=", GREATEREQ);

  /** Notation: Open Parenthesis. */
  public static final Token TOPENPAREN = new ProgramSymbol("(", OPENPAREN);
  /** Notation: Close Parenthesis. */
  public static final Token TCLOSEPAREN = new ProgramSymbol(")", CLOSEPAREN);
  /** Notation: Period. */
  public static final Token TPERIOD = new ProgramSymbol(".", PERIOD);
  /** Notation: Comma. */
  public static final Token TCOMMA = new ProgramSymbol(",", COMMA);
  /** Notation: Semicolon. */
  public static final Token TSEMI = new ProgramSymbol(";", SEMI);
  /** Notation: Colon. */
  public static final Token TCOLON = new ProgramSymbol(":", COLON);

} // class StupidTokens

