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 ANTLR_USE_NAMESPACE(std) string &txt)
virtual ~Token ()
virtual int getColumn () const
virtual int getLine () const
virtual ANTLR_USE_NAMESPACE (std) string getText() const
virtual const ANTLR_USE_NAMESPACE (std) string &getFilename() const
virtual int getType () const
virtual void setColumn (int c)
virtual void setLine (int l)
virtual void setText (const ANTLR_USE_NAMESPACE(std) string &t)
virtual void setType (int t)
virtual void setFilename (const std::string &file)
virtual ANTLR_USE_NAMESPACE (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

Friends

struct TokenRef

Detailed Description

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

Definition at line 24 of file Token.hpp.


Constructor & Destructor Documentation

Token::Token (  )  [inline]

Definition at line 44 of file Token.hpp.

Token::Token ( int  t  )  [inline]

Definition at line 49 of file Token.hpp.

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

Definition at line 54 of file Token.hpp.

virtual Token::~Token (  )  [inline, virtual]

Definition at line 60 of file Token.hpp.

Token::Token ( RefToken  other  )  [private]

Token::Token ( const Token  )  [private]


Member Function Documentation

virtual int Token::getColumn (  )  const [virtual]

Reimplemented in CommonToken.

virtual int Token::getLine (  )  const [virtual]

Reimplemented in CommonToken.

virtual Token::ANTLR_USE_NAMESPACE ( std   )  const [virtual]

Reimplemented in CommonToken, and CommonToken.

virtual const Token::ANTLR_USE_NAMESPACE ( std   )  const [virtual]

Reimplemented in CommonToken, and CommonToken.

virtual int Token::getType (  )  const [virtual]

virtual void Token::setColumn ( int  c  )  [virtual]

Reimplemented in CommonToken.

virtual void Token::setLine ( int  l  )  [virtual]

Reimplemented in CommonToken.

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

Reimplemented in CommonToken.

virtual void Token::setType ( int  t  )  [virtual]

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

virtual Token::ANTLR_USE_NAMESPACE ( std   )  const [virtual]

Reimplemented in CommonToken, and CommonToken.

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

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


Friends And Related Function Documentation

friend struct TokenRef [friend]

Definition at line 81 of file Token.hpp.


Field Documentation

const int Token::MIN_USER_TYPE = 4 [static]

Definition at line 29 of file Token.hpp.

const int Token::NULL_TREE_LOOKAHEAD = 3 [static]

Definition at line 30 of file Token.hpp.

const int Token::INVALID_TYPE = 0 [static]

Definition at line 31 of file Token.hpp.

const int Token::EOF_TYPE = 1 [static]

Definition at line 32 of file Token.hpp.

Referenced by Parser::consumeUntil().

const int Token::SKIP = -1 [static]

Definition at line 33 of file Token.hpp.

TokenRef* Token::ref [private]

Definition at line 82 of file Token.hpp.

int Token::type [private]

the type of the token

Definition at line 84 of file Token.hpp.


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

Generated on Tue Mar 31 20:19:28 2009 for ctrump by  doxygen 1.5.6