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

#include <MismatchedTokenException.hpp>

Inheritance diagram for antlr::MismatchedTokenException:
antlr::RecognitionException antlr::ANTLRException

Public Member Functions

 MismatchedTokenException ()
 
 MismatchedTokenException (const char *const *tokenNames_, const int numTokens_, RefAST node_, int lower, int upper_, bool matchNot)
 Expected range / not range. More...
 
 MismatchedTokenException (const char *const *tokenNames_, const int numTokens_, RefAST node_, int expecting_, bool matchNot)
 
 MismatchedTokenException (const char *const *tokenNames_, const int numTokens_, RefAST node_, BitSet set_, bool matchNot)
 
 MismatchedTokenException (const char *const *tokenNames_, const int numTokens_, RefToken token_, int lower, int upper_, bool matchNot, const std ::string &fileName_)
 
 MismatchedTokenException (const char *const *tokenNames_, const int numTokens_, RefToken token_, int expecting_, bool matchNot, const std ::string &fileName_)
 
 MismatchedTokenException (const char *const *tokenNames_, const int numTokens_, RefToken token_, BitSet set_, bool matchNot, const std ::string &fileName_)
 
 ~MismatchedTokenException () throw ()
 
std ::string getMessage () const
 
- Public Member Functions inherited from antlr::RecognitionException
 RecognitionException ()
 
 RecognitionException (const std ::string &s)
 
 RecognitionException (const std ::string &s, const std ::string &fileName, int line, int column)
 
virtual ~RecognitionException () throw ()
 
virtual std ::string getFilename () const throw ()
 Return file where mishap occurred. More...
 
virtual int getLine () const throw ()
 
virtual int getColumn () const throw ()
 
virtual std ::string toString () const
 Return complete error message with line/column number info (if present) More...
 
virtual std ::string getFileLineColumnString () const
 See what file/line/column info is present and return it as a string. More...
 
- Public Member Functions inherited from antlr::ANTLRException
 ANTLRException ()
 Create ANTLR base exception without error message. More...
 
 ANTLRException (const std ::string &s)
 Create ANTLR base exception with error message. More...
 
virtual ~ANTLRException () throw ()
 

Public Attributes

const RefToken token
 The token that was encountered. More...
 
const RefAST node
 The offending AST node if tree walking. More...
 
std ::string tokenText
 taken from node or token object More...
 
int mismatchType
 One of the above. More...
 
int expecting
 For TOKEN/NOT_TOKEN and RANGE/NOT_RANGE. More...
 
int upper
 For RANGE/NOT_RANGE (expecting is lower bound of range) More...
 
BitSet set
 For SET/NOT_SET. More...
 

Static Public Attributes

static const int TOKEN = 1
 Types of tokens. More...
 
static const int NOT_TOKEN = 2
 
static const int RANGE = 3
 
static const int NOT_RANGE = 4
 
static const int SET = 5
 
static const int NOT_SET = 6
 

Private Member Functions

std ::string tokenName (int tokenType) const
 Return token name for tokenType. More...
 

Private Attributes

const char *const * tokenNames
 Token names array for formatting. More...
 
const int numTokens
 Max number of tokens in tokenNames. More...
 

Additional Inherited Members

- Protected Attributes inherited from antlr::RecognitionException
std ::string fileName
 
int line
 
int column
 

Detailed Description

Definition at line 22 of file MismatchedTokenException.hpp.

Constructor & Destructor Documentation

◆ MismatchedTokenException() [1/7]

antlr::MismatchedTokenException::MismatchedTokenException ( )

Definition at line 15 of file MismatchedTokenException.cpp.

◆ MismatchedTokenException() [2/7]

antlr::MismatchedTokenException::MismatchedTokenException ( const char *const *  tokenNames_,
const int  numTokens_,
RefAST  node_,
int  lower,
int  upper_,
bool  matchNot 
)

Expected range / not range.

Definition at line 25 of file MismatchedTokenException.cpp.

◆ MismatchedTokenException() [3/7]

antlr::MismatchedTokenException::MismatchedTokenException ( const char *const *  tokenNames_,
const int  numTokens_,
RefAST  node_,
int  expecting_,
bool  matchNot 
)

Definition at line 45 of file MismatchedTokenException.cpp.

◆ MismatchedTokenException() [4/7]

antlr::MismatchedTokenException::MismatchedTokenException ( const char *const *  tokenNames_,
const int  numTokens_,
RefAST  node_,
BitSet  set_,
bool  matchNot 
)

Definition at line 63 of file MismatchedTokenException.cpp.

◆ MismatchedTokenException() [5/7]

antlr::MismatchedTokenException::MismatchedTokenException ( const char *const *  tokenNames_,
const int  numTokens_,
RefToken  token_,
int  lower,
int  upper_,
bool  matchNot,
const std ::string &  fileName_ 
)

Definition at line 81 of file MismatchedTokenException.cpp.

◆ MismatchedTokenException() [6/7]

antlr::MismatchedTokenException::MismatchedTokenException ( const char *const *  tokenNames_,
const int  numTokens_,
RefToken  token_,
int  expecting_,
bool  matchNot,
const std ::string &  fileName_ 
)

Definition at line 102 of file MismatchedTokenException.cpp.

◆ MismatchedTokenException() [7/7]

antlr::MismatchedTokenException::MismatchedTokenException ( const char *const *  tokenNames_,
const int  numTokens_,
RefToken  token_,
BitSet  set_,
bool  matchNot,
const std ::string &  fileName_ 
)

Definition at line 121 of file MismatchedTokenException.cpp.

◆ ~MismatchedTokenException()

antlr::MismatchedTokenException::~MismatchedTokenException ( )
throw (
)
inline

Definition at line 84 of file MismatchedTokenException.hpp.

References ANTLR_USE_NAMESPACE.

Member Function Documentation

◆ getMessage()

std::string antlr::MismatchedTokenException::getMessage ( ) const
virtual

Returns a clean error message (no line number/column information)

Reimplemented from antlr::ANTLRException.

Definition at line 139 of file MismatchedTokenException.cpp.

References ANTLR_USE_NAMESPACE, expecting, antlr::ANTLRException::getMessage(), mismatchType, NOT_RANGE, NOT_SET, NOT_TOKEN, RANGE, SET, TOKEN, tokenName(), tokenText, and upper.

Referenced by OpenMD::SimCreator::parseFile().

◆ tokenName()

std::string antlr::MismatchedTokenException::tokenName ( int  tokenType) const
private

Return token name for tokenType.

Definition at line 175 of file MismatchedTokenException.cpp.

References ANTLR_USE_NAMESPACE, antlr::Token::INVALID_TYPE, NOT_RANGE, NOT_SET, NOT_TOKEN, numTokens, RANGE, SET, TOKEN, and tokenNames.

Referenced by getMessage().

Member Data Documentation

◆ expecting

int antlr::MismatchedTokenException::expecting

For TOKEN/NOT_TOKEN and RANGE/NOT_RANGE.

Definition at line 123 of file MismatchedTokenException.hpp.

Referenced by getMessage().

◆ mismatchType

int antlr::MismatchedTokenException::mismatchType

One of the above.

Definition at line 120 of file MismatchedTokenException.hpp.

Referenced by getMessage().

◆ node

const RefAST antlr::MismatchedTokenException::node

The offending AST node if tree walking.

Definition at line 95 of file MismatchedTokenException.hpp.

◆ NOT_RANGE

const int antlr::MismatchedTokenException::NOT_RANGE = 4
static

Definition at line 104 of file MismatchedTokenException.hpp.

Referenced by getMessage(), and tokenName().

◆ NOT_SET

const int antlr::MismatchedTokenException::NOT_SET = 6
static

Definition at line 106 of file MismatchedTokenException.hpp.

Referenced by getMessage(), and tokenName().

◆ NOT_TOKEN

const int antlr::MismatchedTokenException::NOT_TOKEN = 2
static

Definition at line 102 of file MismatchedTokenException.hpp.

Referenced by getMessage(), and tokenName().

◆ numTokens

const int antlr::MismatchedTokenException::numTokens
private

Max number of tokens in tokenNames.

Definition at line 135 of file MismatchedTokenException.hpp.

Referenced by tokenName().

◆ RANGE

const int antlr::MismatchedTokenException::RANGE = 3
static

Definition at line 103 of file MismatchedTokenException.hpp.

Referenced by getMessage(), and tokenName().

◆ SET

const int antlr::MismatchedTokenException::SET = 5
static

Definition at line 105 of file MismatchedTokenException.hpp.

Referenced by getMessage(), and tokenName().

◆ set

BitSet antlr::MismatchedTokenException::set

For SET/NOT_SET.

Definition at line 129 of file MismatchedTokenException.hpp.

◆ token

const RefToken antlr::MismatchedTokenException::token

The token that was encountered.

Definition at line 93 of file MismatchedTokenException.hpp.

◆ TOKEN

const int antlr::MismatchedTokenException::TOKEN = 1
static

Types of tokens.

Definition at line 101 of file MismatchedTokenException.hpp.

Referenced by getMessage(), and tokenName().

◆ tokenNames

const char* const* antlr::MismatchedTokenException::tokenNames
private

Token names array for formatting.

Definition at line 133 of file MismatchedTokenException.hpp.

Referenced by tokenName().

◆ tokenText

std ::string antlr::MismatchedTokenException::tokenText

taken from node or token object

Definition at line 97 of file MismatchedTokenException.hpp.

Referenced by getMessage().

◆ upper

int antlr::MismatchedTokenException::upper

For RANGE/NOT_RANGE (expecting is lower bound of range)

Definition at line 126 of file MismatchedTokenException.hpp.

Referenced by getMessage().


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