Blame vhdlparser/Token.cc

Packit 1c1d7e
/* Generated By:JavaCC: Do not edit this line. Token.cc Version 6.0 */
Packit 1c1d7e
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true,TOKEN_INCLUDES=,TOKEN_EXTENDS= */
Packit 1c1d7e
#include "Token.h"
Packit 1c1d7e
Packit 1c1d7e
namespace vhdl {
Packit 1c1d7e
namespace parser {
Packit 1c1d7e
Packit 1c1d7e
/**
Packit 1c1d7e
 * Describes the input token stream.
Packit 1c1d7e
 */
Packit 1c1d7e
Packit 1c1d7e
  /**
Packit 1c1d7e
   * An optional attribute value of the Token.
Packit 1c1d7e
   * Tokens which are not used as syntactic sugar will often contain
Packit 1c1d7e
   * meaningful values that will be used later on by the compiler or
Packit 1c1d7e
   * interpreter. This attribute value is often different from the image.
Packit 1c1d7e
   * Any subclass of Token that actually wants to return a non-NULL value can
Packit 1c1d7e
   * override this method as appropriate.
Packit 1c1d7e
   */
Packit 1c1d7e
  void * Token::getValue() {
Packit 1c1d7e
    return NULL;
Packit 1c1d7e
  }
Packit 1c1d7e
Packit 1c1d7e
  /**
Packit 1c1d7e
   * No-argument constructor
Packit 1c1d7e
   */
Packit 1c1d7e
  Token::Token() {
Packit 1c1d7e
    this->next = NULL;
Packit 1c1d7e
    this->specialToken = NULL;
Packit 1c1d7e
  }
Packit 1c1d7e
Packit 1c1d7e
  /**
Packit 1c1d7e
   * Constructs a new token for the specified Image.
Packit 1c1d7e
   */
Packit 1c1d7e
  Token::Token(int kind)
Packit 1c1d7e
  {
Packit 1c1d7e
    this->kind = kind;
Packit 1c1d7e
    this->next = NULL;
Packit 1c1d7e
    this->specialToken = NULL;
Packit 1c1d7e
  }
Packit 1c1d7e
Packit 1c1d7e
  /**
Packit 1c1d7e
   * Constructs a new token for the specified Image and Kind.
Packit 1c1d7e
   */
Packit 1c1d7e
  Token::Token(int kind, JAVACC_STRING_TYPE image)
Packit 1c1d7e
  {
Packit 1c1d7e
    this->kind = kind;
Packit 1c1d7e
    this->image = image;
Packit 1c1d7e
    this->next = NULL;
Packit 1c1d7e
    this->specialToken = NULL;
Packit 1c1d7e
  }
Packit 1c1d7e
Packit 1c1d7e
  /**
Packit 1c1d7e
   * Returns the image.
Packit 1c1d7e
   */
Packit 1c1d7e
  JAVACC_STRING_TYPE Token::toString()
Packit 1c1d7e
  {
Packit 1c1d7e
    return image;
Packit 1c1d7e
  }
Packit 1c1d7e
Packit 1c1d7e
  /**
Packit 1c1d7e
   * Returns a new Token object, by default. However, if you want, you
Packit 1c1d7e
   * can create and return subclass objects based on the value of ofKind.
Packit 1c1d7e
   * Simply add the cases to the switch for all those special cases.
Packit 1c1d7e
   * For example, if you have a subclass of Token called IDToken that
Packit 1c1d7e
   * you want to create if ofKind is ID, simply add something like :
Packit 1c1d7e
   *
Packit 1c1d7e
   *    case MyParserConstants.ID : return new IDToken(ofKind, image);
Packit 1c1d7e
   *
Packit 1c1d7e
   * to the following switch statement. Then you can cast matchedToken
Packit 1c1d7e
   * variable to the appropriate type and use sit in your lexical actions.
Packit 1c1d7e
   */
Packit 1c1d7e
  Token *Token::newToken(int ofKind, JAVACC_STRING_TYPE image)
Packit 1c1d7e
  {
Packit 1c1d7e
    switch(ofKind)
Packit 1c1d7e
    {
Packit 1c1d7e
      default : return new Token(ofKind, image);
Packit 1c1d7e
    }
Packit 1c1d7e
  }
Packit 1c1d7e
Packit 1c1d7e
  Token *Token::newToken(int ofKind)
Packit 1c1d7e
  {
Packit 1c1d7e
    return newToken(ofKind, JAVACC_STRING_TYPE((JAVACC_CHAR_TYPE*)""));
Packit 1c1d7e
  }
Packit 1c1d7e
Packit 1c1d7e
  Token::~Token() {
Packit 1c1d7e
    if (specialToken) delete specialToken;
Packit 1c1d7e
  }
Packit 1c1d7e
Packit 1c1d7e
}
Packit 1c1d7e
}
Packit 1c1d7e
/* JavaCC - OriginalChecksum=9db9ca693072c4c37bb7cc933c0c5e35 (do not edit this line) */