blob: 0a00f60acddf6a4372027412f9ec0790bf09251b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#ifndef PARSEERROR_HPP_INCLUDED
#define PARSEERROR_HPP_INCLUDED
#include <stdexcept>
#include "tokenstream.hpp"
#include <compile_error.hpp>
namespace ParseError {
using CompileError::Generic;
using CompileError::BugCheck;
using CompileError::Todo;
class BadChar:
public CompileError::Base
{
//char m_char;
public:
BadChar(const TokenStream& lex, char character);
virtual ~BadChar() throw ();
};
class Unexpected:
public CompileError::Base
{
Token m_tok;
public:
Unexpected(const TokenStream& lex, const Token& tok);
Unexpected(const TokenStream& lex, const Token& tok, Token exp);
Unexpected(const TokenStream& lex, const Token& tok, ::std::vector<eTokenType> exp);
virtual ~Unexpected() throw ();
};
#define ASSERT(lex, cnd) do { if( !(cnd) ) throw CompileError::BugCheck(lex, "Assertion failed: " __FILE__ " - " #cnd); } while(0)
}
#endif // PARSEERROR_HPP_INCLUDED
|