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

#include <ANTLRException.hpp>

Inheritance diagram for antlr::ANTLRException:
antlr::CharStreamException antlr::IOException antlr::RecognitionException antlr::TokenStreamException antlr::CharStreamIOException antlr::MismatchedCharException antlr::MismatchedTokenException antlr::NoViableAltException antlr::NoViableAltForCharException antlr::SemanticException antlr::TokenStreamIOException antlr::TokenStreamRecognitionException antlr::TokenStreamRetryException

Public Member Functions

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

Private Attributes

std ::string text

Detailed Description

Definition at line 18 of file ANTLRException.hpp.

Constructor & Destructor Documentation

◆ ANTLRException() [1/2]

antlr::ANTLRException::ANTLRException ( )

Create ANTLR base exception without error message.

Definition at line 22 of file ANTLRException.hpp.

◆ ANTLRException() [2/2]

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

Create ANTLR base exception with error message.

Definition at line 26 of file ANTLRException.hpp.

◆ ~ANTLRException()

virtual antlr::ANTLRException::~ANTLRException ( )
throw (

Definition at line 30 of file ANTLRException.hpp.

Member Function Documentation

◆ getMessage()

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

Return error message without additional info (if present)

when making your own exceptions classes override toString and call in toString getMessage which relays the text attribute from here.

Reimplemented in antlr::MismatchedCharException, antlr::MismatchedTokenException, antlr::NoViableAltException, and antlr::NoViableAltForCharException.

Definition at line 48 of file ANTLRException.hpp.

Referenced by antlr::MismatchedTokenException::getMessage(), antlr::MismatchedCharException::getMessage(), OpenMD::SimCreator::parseFile(), antlr::TokenStreamRecognitionException::toString(), and antlr::RecognitionException::toString().

◆ toString()

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

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

for your own exceptions override this one. Call getMessage from here to get the 'clean' error message stored in the text attribute.

Reimplemented in antlr::RecognitionException, and antlr::TokenStreamRecognitionException.

Definition at line 38 of file ANTLRException.hpp.

Referenced by antlr::LLkParser::trace().

Member Data Documentation

◆ text

std ::string antlr::ANTLRException::text

Definition at line 53 of file ANTLRException.hpp.

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