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

#include <MismatchedTokenException.hpp>

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

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 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 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 RecognitionException
std ::string fileName
 
int line
 
int column
 

Constructor & Destructor Documentation

◆ MismatchedTokenException() [1/7]

MismatchedTokenException::MismatchedTokenException ( )

◆ MismatchedTokenException() [2/7]

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

Expected range / not range.

◆ MismatchedTokenException() [3/7]

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

◆ MismatchedTokenException() [4/7]

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

◆ MismatchedTokenException() [5/7]

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

◆ MismatchedTokenException() [6/7]

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

◆ MismatchedTokenException() [7/7]

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

◆ ~MismatchedTokenException()

MismatchedTokenException::~MismatchedTokenException ( )
throw (
)
inline

Member Function Documentation

◆ getMessage()

std::string MismatchedTokenException::getMessage ( ) const

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

◆ tokenName()

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

Return token name for tokenType.

Member Data Documentation

◆ expecting

int MismatchedTokenException::expecting

For TOKEN/NOT_TOKEN and RANGE/NOT_RANGE.

◆ mismatchType

int MismatchedTokenException::mismatchType

One of the above.

◆ node

const RefAST MismatchedTokenException::node

The offending AST node if tree walking.

◆ NOT_RANGE

const int MismatchedTokenException::NOT_RANGE = 4
static

◆ NOT_SET

const int MismatchedTokenException::NOT_SET = 6
static

◆ NOT_TOKEN

const int MismatchedTokenException::NOT_TOKEN = 2
static

◆ numTokens

const int MismatchedTokenException::numTokens
private

Max number of tokens in tokenNames.

◆ RANGE

const int MismatchedTokenException::RANGE = 3
static

◆ SET

const int MismatchedTokenException::SET = 5
static

◆ set

BitSet MismatchedTokenException::set

For SET/NOT_SET.

◆ token

const RefToken MismatchedTokenException::token

The token that was encountered.

◆ TOKEN

const int MismatchedTokenException::TOKEN = 1
static

Types of tokens.

◆ tokenNames

const char* const* MismatchedTokenException::tokenNames
private

Token names array for formatting.

◆ tokenText

std ::string MismatchedTokenException::tokenText

taken from node or token object

◆ upper

int MismatchedTokenException::upper

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


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