Leonardus
Macros | Enumerations | Functions
error.h File Reference

Error handling. More...

#include <string>
#include <cstdint>
#include <source_location>
+ Include dependency graph for error.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ERRPRAEFIX   "leo"
 Praefix for error messages of second pass.
 

Enumerations

enum  OpError : std::uint8_t {
  invalidexit , rangecheck , stackunderflow , typecheck ,
  unmatchedmark , dictstackunderflow , undefinedresult , undefined
}
 Operator error code enum. More...
 
enum  InError : std::uint8_t { cmdline , parsererror , semantics , internal }
 Interpreter error code enum. More...
 

Functions

void opErrExit (OpError p_err, const std::string &p_details="", const std::source_location p_location=std::source_location::current())
 Operator error message to interpreter cout_ and exit( EC_OPERATOR ).
 
void inErrExit (InError p_err, const std::string &p_details="", const std::source_location p_location=std::source_location::current())
 Interpreter error message to interpreter cout_ and exit( EC_INTERPRETER / EC_CMDLINE ).
 
void panicExit ()
 Panic exit( EC_PANIC ).
 

Detailed Description

Error handling.

Enumeration Type Documentation

◆ InError

enum InError : std::uint8_t

Interpreter error code enum.

Enumerator
cmdline 

command line usage error

parsererror 

explicit or implicit error from pass 1

semantics 

infinite nesting of arrays; infinite loop loading values from dictionary;

internal 

float formating; context not initialized; counter less than zero; non dictionary object on dictionary stack

◆ OpError

enum OpError : std::uint8_t

Operator error code enum.

Enumerator
invalidexit 

PS operator error invalidexit.

rangecheck 

PS operator error rangecheck.

stackunderflow 

PS operator error stackunderflow.

typecheck 

PS operator error typecheck.

unmatchedmark 

PS operator error unmatchedmark.

dictstackunderflow 

PS operator error dictstackunderflow.

undefinedresult 

PS operator error undefinedresult.

undefined 

PS operator error undefined.