Gorgon Game Engine
Exceptions.h
Go to the documentation of this file.
1 
3 #pragma once
4 
5 #include <stdexcept>
6 
7 namespace Gorgon { namespace String {
10  class ParseError : public std::runtime_error {
11  public:
15  ParseError(int code=0, const std::string &what="Parse error") :
16  std::runtime_error(what), Code(code) {
17  }
18 
20  int Code;
21  };
22 
25  class IllegalTokenError : public ParseError {
26  public:
28  IllegalTokenError(size_t location=0, int code=1000, const std::string &what="Illegal token") :
29  ParseError(code, what), Location(location) {
30  }
31 
33  size_t Location;
34  };
35 } }
Gorgon::String::IllegalTokenError
This error will be thrown if a parsing function encounters with an illegal token.
Definition: Exceptions.h:25
Gorgon::String::IllegalTokenError::Location
size_t Location
Location of the illegal token in the string.
Definition: Exceptions.h:33
Gorgon
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
Gorgon::String::ParseError
This error will be thrown if a parsing function encounters with a general error.
Definition: Exceptions.h:10
Gorgon::String::ParseError::Code
int Code
Error code.
Definition: Exceptions.h:20
Gorgon::String::IllegalTokenError::IllegalTokenError
IllegalTokenError(size_t location=0, int code=1000, const std::string &what="Illegal token")
Constructor.
Definition: Exceptions.h:28
Gorgon::String::ParseError::ParseError
ParseError(int code=0, const std::string &what="Parse error")
Constructs a new parse error.
Definition: Exceptions.h:15