summaryrefslogtreecommitdiff
path: root/include/exceptions.hpp
blob: 050779dd0eeb6f2a286cf06e927b2126e3df8ff6 (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
/* PIA - Lenguajes Modernos de Programación
 * FACULTAD DE CIENCIAS FÍSICO MATEMÁTICAS
 * Luis Sebastián Martínez Vega - LCC */

#include <string>

#ifndef EXCEPTIONS_H
#define EXCEPTIONS_H

class Exception{
private:
  std::string error_msg;
public:
  explicit Exception(const std::string &error_msg): error_msg(error_msg){}
  std::string showMsg() const;
};

class LexerException: public Exception{
public:
  explicit LexerException(const std::string &error_msg): Exception(error_msg){}
};

class ParserException: public Exception{
public:
  explicit ParserException(const std::string &error_msg): Exception(error_msg){}
};

#endif /* EXCEPTIONS_H */