memgraph/cypher/errors.hpp
2015-09-13 11:34:17 +02:00

27 lines
558 B
C++

#ifndef MEMGRAPH_CYPHER_ERRORS_HPP
#define MEMGRAPH_CYPHER_ERRORS_HPP
#include <stdexcept>
#include "token.hpp"
class SyntaxError : public std::runtime_error
{
public:
SyntaxError(const std::string& near)
: std::runtime_error("Syntax error near '" + near + "'.") {}
};
class LexicalError : public std::runtime_error
{
public:
LexicalError(const Token& token)
: std::runtime_error("Unrecognized token '" + token.value + "'.") {}
};
class ParserError : public std::runtime_error
{
using runtime_error::runtime_error;
};
#endif