Nearly CC
An educational compiler skeleton
Public Member Functions | List of all members
BaseException Class Reference

Base type for exceptions indicating a syntax error,. More...

#include "exceptions.h"

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

Public Member Functions

 BaseException (const Location &loc, const std::string &desc)
 Constructor. More...
 
 BaseException (const BaseException &other)
 Copy constructor. More...
 
bool has_location () const
 Check whether this exception has a valud source Location. More...
 
const Locationget_loc () const
 Get the source Location. More...
 

Detailed Description

Base type for exceptions indicating a syntax error,.

Constructor & Destructor Documentation

◆ BaseException() [1/2]

BaseException::BaseException ( const Location loc,
const std::string &  desc 
)

Constructor.

Parameters
locthe source Location of the error
descdescription of the error

◆ BaseException() [2/2]

BaseException::BaseException ( const BaseException other)

Copy constructor.

Parameters
otherthe BaseException object to copy from

Member Function Documentation

◆ get_loc()

const Location & BaseException::get_loc ( ) const

Get the source Location.

Returns
the source Location

◆ has_location()

bool BaseException::has_location ( ) const
inline

Check whether this exception has a valud source Location.

Returns
true if this exception has a valid source Location, false otherwise

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