00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef VYPIO_H
00021 #define VYPIO_H
00022
00023 #include "config.h"
00024 #include "scanner.h"
00025
00026 #ifndef BUILDING_DOX
00027 # include <iostream>
00028 # include <string>
00029 #endif
00030
00035 namespace StreamDecorator {
00037 enum EColor {
00038 C_NO_COLOR = 0,
00039 C_BLUE,
00040 C_GREEN,
00041 C_CYAN,
00042 C_RED,
00043 C_PURPLE,
00044 C_BROWN,
00045 C_LIGHT_GRAY,
00046 C_DARK_GRAY,
00047 C_LIGHT_BLUE,
00048 C_LIGHT_GREEN,
00049 C_LIGHT_CYAN,
00050 C_LIGHT_RED,
00051 C_LIGHT_PURPLE,
00052 C_YELLOW,
00053 C_WHITE
00054 };
00055
00060 class Color {
00061 public:
00066 Color(EColor color = C_NO_COLOR);
00067 Color(const Color &);
00068 ~Color();
00073 static void enable(bool);
00077 static bool isEnabled();
00078 private:
00079 Color& operator= (const Color &);
00080 static bool useColors;
00081 struct Private;
00082 Private *d;
00083 friend std::ostream& operator<< (std::ostream &, const Color &);
00084 };
00086 std::ostream& operator<< (std::ostream &, const Color &);
00087
00089 enum EError {
00090 E_NO_ERROR = 0,
00091 E_ERROR,
00092 E_WARNING,
00093 E_NOTE,
00094 };
00095
00097 class Error {
00098 public:
00100 Error(
00101 EError type,
00102 std::string file,
00103 std::string msg,
00104 int lineno = 0,
00105 std::string category = std::string(),
00106 Token token = Token());
00107
00109 Error(
00110 EError type,
00111 std::string file,
00112 std::string msg,
00113 Token token,
00114 bool internal = false);
00115 ~Error();
00116 private:
00117 Color& operator= (const Color &);
00118 struct Private;
00119 Private *d;
00120 friend std::ostream& operator<< (std::ostream &, const Error &);
00121 };
00123 std::ostream& operator<< (std::ostream &, const Error &);
00124
00125 }
00126
00127 #endif