OpenMD  2.5
Molecular Dynamics in the Open
antlr::Token Class Reference

#include <Token.hpp>

Inheritance diagram for antlr::Token:
antlr::CommonToken antlr::CommonHiddenStreamToken

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.

Definition at line 24 of file Token.hpp.

Constructor & Destructor Documentation

◆ Token() [1/5]

antlr::Token::Token ( )
inline

Definition at line 44 of file Token.hpp.

◆ Token() [2/5]

antlr::Token::Token ( int  t)
inline

Definition at line 49 of file Token.hpp.

◆ Token() [3/5]

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

Definition at line 54 of file Token.hpp.

◆ ~Token()

virtual antlr::Token::~Token ( )
inlinevirtual

Definition at line 60 of file Token.hpp.

References ANTLR_USE_NAMESPACE, and OpenMD::toString().

◆ Token() [4/5]

antlr::Token::Token ( RefToken  other)
private

◆ Token() [5/5]

antlr::Token::Token ( const Token )
private

Member Function Documentation

◆ getColumn()

int antlr::Token::getColumn ( ) const
virtual

Reimplemented in antlr::CommonToken.

Definition at line 15 of file Token.cpp.

◆ getFilename()

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

Definition at line 58 of file Token.cpp.

References antlr::emptyString().

◆ getLine()

int antlr::Token::getLine ( ) const
virtual

Reimplemented in antlr::CommonToken.

Definition at line 20 of file Token.cpp.

◆ getText()

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

◆ getType()

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ setColumn()

void antlr::Token::setColumn ( int  c)
virtual

Reimplemented in antlr::CommonToken.

Definition at line 35 of file Token.cpp.

◆ setFilename()

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

Definition at line 52 of file Token.cpp.

References ANTLR_USE_NAMESPACE, and antlr::emptyString().

◆ setLine()

void antlr::Token::setLine ( int  l)
virtual

Reimplemented in antlr::CommonToken.

Definition at line 39 of file Token.cpp.

◆ setText()

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

Reimplemented in antlr::CommonToken.

Definition at line 43 of file Token.cpp.

◆ setType()

void antlr::Token::setType ( int  t)
virtual

Definition at line 47 of file Token.cpp.

References type.

◆ toString()

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

Reimplemented in antlr::CommonToken.

Definition at line 63 of file Token.cpp.

References getText(), and type.

Friends And Related Function Documentation

◆ TokenRef

friend struct TokenRef
friend

Definition at line 81 of file Token.hpp.

Member Data Documentation

◆ EOF_TYPE

const int antlr::Token::EOF_TYPE = 1
static

◆ INVALID_TYPE

const int antlr::Token::INVALID_TYPE = 0
static

◆ MIN_USER_TYPE

const int antlr::Token::MIN_USER_TYPE = 4
static

Definition at line 29 of file Token.hpp.

Referenced by antlr::ASTFactory::ASTFactory(), and antlr::ASTFactory::registerFactory().

◆ NULL_TREE_LOOKAHEAD

const int antlr::Token::NULL_TREE_LOOKAHEAD = 3
static

◆ ref

TokenRef* antlr::Token::ref
private

Definition at line 82 of file Token.hpp.

Referenced by antlr::TokenRef::getRef(), and antlr::TokenRef::TokenRef().

◆ SKIP

const int antlr::Token::SKIP = -1
static

Definition at line 33 of file Token.hpp.

◆ type

int antlr::Token::type
private

the type of the token

Definition at line 84 of file Token.hpp.

Referenced by getType(), setType(), and toString().


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