Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::ParseError Class Reference

Exception class for parsing errors with location information. More...

#include <parse_utils.H>

Inheritance diagram for Aleph::ParseError:
[legend]
Collaboration diagram for Aleph::ParseError:
[legend]

Public Member Functions

 ParseError (const std::string &message, const SourceLocation &location)
 Construct a parse error with message and location.
 
 ParseError (const std::string &message)
 Construct a parse error with message only.
 
const SourceLocation & location () const
 Get the source location of the error.
 

Private Attributes

SourceLocation loc_
 

Detailed Description

Exception class for parsing errors with location information.

Extends std::runtime_error to include source location where the error occurred, enabling precise error messages.

Example
throw ParseError("Expected semicolon", SourceLocation::previous("input.txt"));
Exception class for parsing errors with location information.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Definition Blossom.H:466
static SourceLocation previous(const std::string &file="")
Construct from the previous (token start) global parsing state.

Definition at line 653 of file parse_utils.H.

Constructor & Destructor Documentation

◆ ParseError() [1/2]

Aleph::ParseError::ParseError ( const std::string &  message,
const SourceLocation &  location 
)
inline

Construct a parse error with message and location.

Parameters
messageError description
locationWhere the error occurred

Definition at line 663 of file parse_utils.H.

◆ ParseError() [2/2]

Aleph::ParseError::ParseError ( const std::string &  message)
inlineexplicit

Construct a parse error with message only.

Parameters
messageError description (uses current global position)

Definition at line 671 of file parse_utils.H.

Member Function Documentation

◆ location()

const SourceLocation & Aleph::ParseError::location ( ) const
inline

Get the source location of the error.

Definition at line 678 of file parse_utils.H.

References loc_.

Member Data Documentation

◆ loc_

SourceLocation Aleph::ParseError::loc_
private

Definition at line 655 of file parse_utils.H.

Referenced by location().


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