/*********************************************************************
 * Author: B. Alex Bridges                                           *
 * Login ID: brid0129                                                *
 * Class: CPSC-431, Winter 2000                                      *
 * Project: Laboratory Exercise 3                                    *
 * Description: This program is a lexical analyzer, the parser       *
 *              portion of a syntax analyzer, and a semantic analyzer*
 *              for the lanaguage Micro Modula-2.                    *
 * Contents: Setup and control of Token object.                      *
 *********************************************************************/


/* IMPORTS */
import java.io.*;


class Token
{
  /* CONSTANTS */
  final static boolean b_debug = false; // CONTROLS EXTRA DEBUG OUTPUT

  /* OBJECT VARIABLES */ 
  public String str_actual;     // TOKEN'S ACTUAL VALUE
  public String str_name;       // TOKEN'S ASSOCIATED NAME
  public String str_attribute;  // TOKEN'S ATTRIBUTE (TYPE INFORMATION)
  public int int_line;          // TOKEN'S LINE NUMBER AS IN SOURCE FILE
  public int int_ttype;         // TOKEN'S TTYPE FOR JAVA AS INTEGER
  public String str_ttype;      // TOKEN'S TTYPE FOR JAVA AS STRING
  public String str_original;   // TOKEN'S ORIGINAL STRING

  public Token()
  {
    str_actual = "UNKNOWN";
    str_name = "UNKNOWN";
    str_attribute = "UNKNOWN";
  } // constructor Token


  /*************************************************************************
   * Method: print                                                         *
   * Purpose: Prints the Token for the output table.                       *
   * Input: --PARAMATERS--                                                 *
   *        => NONE                                                        *
   * Output: --RETURNS--                                                   *
   *         => NONE                                                       *
   *************************************************************************/
  public void print()
  {
    /* LOCAL VARIABLES */
    int int_length; // STRING'S LENGTH
    
    System.out.print("     "+str_actual);
    
    int_length = str_actual.length();
    
    for(int i = 0; i + int_length < 15; i++)
      System.out.print(" ");
      
    System.out.print(str_name);

    int_length = str_name.length();
    
    for(int i = 0; i + int_length < 15; i++)
      System.out.print(" ");

    System.out.println(str_attribute);
  } // method print
} // class Token

