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

#include <RecognitionException.hpp>

Inheritance diagram for antlr::RecognitionException:
antlr::ANTLRException antlr::MismatchedCharException antlr::MismatchedTokenException antlr::NoViableAltException antlr::NoViableAltForCharException antlr::SemanticException

Public Member Functions

 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 ()
 
virtual std ::string getMessage () const
 

Protected Attributes

std ::string fileName
 
int line
 
int column
 

Detailed Description

Definition at line 18 of file RecognitionException.hpp.

Constructor & Destructor Documentation

◆ RecognitionException() [1/3]

antlr::RecognitionException::RecognitionException ( )

Definition at line 15 of file RecognitionException.cpp.

◆ RecognitionException() [2/3]

antlr::RecognitionException::RecognitionException ( const std ::string &  s)

Definition at line 22 of file RecognitionException.cpp.

◆ RecognitionException() [3/3]

antlr::RecognitionException::RecognitionException ( const std ::string &  s,
const std ::string &  fileName,
int  line,
int  column 
)

Definition at line 29 of file RecognitionException.cpp.

◆ ~RecognitionException()

virtual antlr::RecognitionException::~RecognitionException ( )
throw (
)
inlinevirtual

Definition at line 27 of file RecognitionException.hpp.

Member Function Documentation

◆ getColumn()

virtual int antlr::RecognitionException::getColumn ( ) const
throw (
)
inlinevirtual
Returns
the column number that this exception happened on.

Definition at line 46 of file RecognitionException.hpp.

References ANTLR_USE_NAMESPACE, and OpenMD::toString().

Referenced by antlr::TokenStreamRecognitionException::getColumn(), and OpenMD::SimCreator::parseFile().

◆ getFileLineColumnString()

std::string antlr::RecognitionException::getFileLineColumnString ( ) const
virtual

See what file/line/column info is present and return it as a string.

Definition at line 39 of file RecognitionException.cpp.

References ANTLR_USE_NAMESPACE, column, fileName, and line.

Referenced by antlr::TokenStreamRecognitionException::toString(), and toString().

◆ getFilename()

virtual std ::string antlr::RecognitionException::getFilename ( ) const
throw (
)
inlinevirtual

Return file where mishap occurred.

Definition at line 32 of file RecognitionException.hpp.

Referenced by antlr::TokenStreamRecognitionException::getFilename(), and OpenMD::SimCreator::parseFile().

◆ getLine()

virtual int antlr::RecognitionException::getLine ( ) const
throw (
)
inlinevirtual
Returns
the line number that this exception happened on.

Definition at line 39 of file RecognitionException.hpp.

Referenced by antlr::TokenStreamRecognitionException::getLine(), and OpenMD::SimCreator::parseFile().

◆ toString()

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

Return complete error message with line/column number info (if present)

Reimplemented from antlr::ANTLRException.

Definition at line 64 of file RecognitionException.cpp.

References getFileLineColumnString(), and antlr::ANTLRException::getMessage().

Referenced by antlr::TreeParser::reportError(), antlr::Parser::reportError(), and antlr::CharScanner::reportError().

Member Data Documentation

◆ column

int antlr::RecognitionException::column
protected

Definition at line 59 of file RecognitionException.hpp.

Referenced by getFileLineColumnString().

◆ fileName

std ::string antlr::RecognitionException::fileName
protected

Definition at line 57 of file RecognitionException.hpp.

Referenced by getFileLineColumnString().

◆ line

int antlr::RecognitionException::line
protected

Definition at line 58 of file RecognitionException.hpp.

Referenced by getFileLineColumnString().


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