| 14 | using namespace supspi; |
| 15 | |
| 16 | class ColorCodeCallback |
| 17 | { |
| 18 | public: |
| 19 | ColorCodeCallback() |
| 20 | { |
| 21 | colorer = NULL; |
| 22 | style = COLOR_CODE; |
| 23 | } |
| 24 | ColorCodeCallback(Colorer* col, int nStyle) |
| 25 | { |
| 26 | colorer = col; |
| 27 | style = nStyle; |
| 28 | } |
| 29 | |
| 30 | void operator()(const char* start, const char* end) |
| 31 | { |
| 32 | colorer->ColorCode(style, start, end); |
| 33 | } |
| 34 | void operator()(int style, const char* start, const char* end) |
| 35 | { |
| 36 | colorer->ColorCode(style, start, end); |
| 37 | } |
| 38 | private: |
| 39 | Colorer *colorer; |
| 40 | int style; |
| 41 | }; |
| 42 | |
| 43 | namespace ColorerGrammar |
| 44 | { |