Blame vhdlparser/Token.cc

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