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
00056 class PrintHex {
00057 public:
00058 PrintHex(unsigned number, unsigned width);
00059 PrintHex(const PrintHex &);
00060 ~PrintHex();
00061 private:
00062 PrintHex& operator= (const PrintHex &);
00063 struct Private;
00064 Private *d;
00065 friend std::ostream& operator<< (std::ostream &, const PrintHex &);
00066 };
00068 std::ostream& operator<< (std::ostream &, const PrintHex &);
00069
00074 class Color {
00075 public:
00080 Color(EColor color = C_NO_COLOR);
00081 Color(const Color &);
00082 ~Color();
00087 static void enable(bool);
00091 static bool isEnabled();
00092 private:
00093 Color& operator= (const Color &);
00094 static bool useColors;
00095 struct Private;
00096 Private *d;
00097 friend std::ostream& operator<< (std::ostream &, const Color &);
00098 };
00100 std::ostream& operator<< (std::ostream &, const Color &);
00101
00103 enum EError {
00104 E_NO_ERROR = 0,
00105 E_ERROR,
00106 E_WARNING,
00107 E_NOTE,
00108 };
00109
00111 class Error {
00112 public:
00114 Error(
00115 EError type,
00116 std::string file,
00117 std::string msg,
00118 int lineno = 0,
00119 std::string category = std::string(),
00120 Token token = Token());
00121
00123 Error(
00124 EError type,
00125 std::string file,
00126 std::string msg,
00127 Token token,
00128 bool internal = false);
00129 ~Error();
00130 private:
00131 Color& operator= (const Color &);
00132 struct Private;
00133 Private *d;
00134 friend std::ostream& operator<< (std::ostream &, const Error &);
00135 };
00137 std::ostream& operator<< (std::ostream &, const Error &);
00138
00139 }
00140
00141 #endif