Improved Makefiles.
[qshowdiff.git] / src / parser / tokens.h
blobaf53c4957bf9622ba0827c830f5f9c99e3ea6897
1 #ifndef _TOKENS_H_
2 #define _TOKENS_H_
4 #include <QRegExp>
5 #include <string>
7 #include "../debug.h"
9 class Tokens{
10 public:
11 /*{*/
12 /**
13 * Tokens
15 QRegExp file_tok;
16 QRegExp hunk_tok;
17 QRegExp context_tok;
18 QRegExp added_tok;
19 QRegExp deleted_tok;
20 /*}*/
22 protected:
23 Tokens(const char *file_tok,
24 const char *hunk_tok,
25 const char *context_tok,
26 const char *added_tok,
27 const char *deleted_tok);
29 public:
30 enum token{
31 FILE_TOK,
32 HUNK_TOK,
33 CONTEXT_TOK,
34 ADDED_TOK,
35 DELETED_TOK,
36 NONE_TOK
39 virtual token match(QString &line) const;
42 class TokensGit : public Tokens{
43 public:
44 TokensGit();
47 class TokensSvn : public Tokens{
48 public:
49 TokensSvn();
52 Tokens *TokenFactory(std::string);
53 #endif