ANTLR Support Libraries 2.7.1+
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
Token Class Reference

#include <Token.hpp>

Inheritance diagram for Token:
Inheritance graph
[legend]
Collaboration diagram for Token:
Collaboration graph
[legend]

Public Member Functions

 Token ()
 
 Token (int t)
 
 Token (int t, const std ::string &txt)
 
virtual ~Token ()
 
virtual int getColumn () const
 
virtual int getLine () const
 
virtual std ::string getText () const
 
virtual const std ::string & getFilename () const
 
virtual int getType () const
 
virtual void setColumn (int c)
 
virtual void setLine (int l)
 
virtual void setText (const std ::string &t)
 
virtual void setType (int t)
 
virtual void setFilename (const std::string &file)
 
virtual std ::string toString () const
 

Static Public Attributes

static const int MIN_USER_TYPE = 4
 
static const int NULL_TREE_LOOKAHEAD = 3
 
static const int INVALID_TYPE = 0
 
static const int EOF_TYPE = 1
 
static const int SKIP = -1
 

Private Member Functions

 Token (RefToken other)
 
Tokenoperator= (const Token &other)
 
Tokenoperator= (RefToken other)
 
 Token (const Token &)
 

Private Attributes

TokenRefref
 
int type
 the type of the token More...
 

Friends

struct TokenRef
 

Detailed Description

A token is minimally a token type. Subclasses can add the text matched for the token and line info.

Constructor & Destructor Documentation

◆ Token() [1/5]

Token::Token ( )
inline

◆ Token() [2/5]

Token::Token ( int  t)
inline

◆ Token() [3/5]

Token::Token ( int  t,
const std ::string &  txt 
)
inline

◆ ~Token()

virtual Token::~Token ( )
inlinevirtual

◆ Token() [4/5]

Token::Token ( RefToken  other)
private

◆ Token() [5/5]

Token::Token ( const Token )
private

Member Function Documentation

◆ getColumn()

int Token::getColumn ( ) const
virtual

Reimplemented in CommonToken.

◆ getFilename()

const std::string & Token::getFilename ( ) const
virtual

◆ getLine()

int Token::getLine ( ) const
virtual

Reimplemented in CommonToken.

◆ getText()

std::string Token::getText ( ) const
virtual

Reimplemented in CommonToken.

◆ getType()

int Token::getType ( ) const
virtual

◆ operator=() [1/2]

Token& Token::operator= ( const Token other)
private

◆ operator=() [2/2]

Token& Token::operator= ( RefToken  other)
private

◆ setColumn()

void Token::setColumn ( int  c)
virtual

Reimplemented in CommonToken.

◆ setFilename()

void Token::setFilename ( const std::string &  file)
virtual

◆ setLine()

void Token::setLine ( int  l)
virtual

Reimplemented in CommonToken.

◆ setText()

void Token::setText ( const std ::string &  t)
virtual

Reimplemented in CommonToken.

◆ setType()

void Token::setType ( int  t)
virtual

◆ toString()

std::string Token::toString ( ) const
virtual

Reimplemented in CommonToken.

Friends And Related Function Documentation

◆ TokenRef

friend struct TokenRef
friend

Member Data Documentation

◆ EOF_TYPE

const int Token::EOF_TYPE = 1
static

◆ INVALID_TYPE

const int Token::INVALID_TYPE = 0
static

◆ MIN_USER_TYPE

const int Token::MIN_USER_TYPE = 4
static

◆ NULL_TREE_LOOKAHEAD

const int Token::NULL_TREE_LOOKAHEAD = 3
static

◆ ref

TokenRef* Token::ref
private

◆ SKIP

const int Token::SKIP = -1
static

◆ type

int Token::type
private

the type of the token


The documentation for this class was generated from the following files: