7 #include "../diff/diff.h"
23 Tokens(const char *file_tok
,
25 const char *context_tok
,
26 const char *added_tok
,
27 const char *deleted_tok
);
39 virtual token
match(QString
&line
) const;
43 class TokensGit
: public Tokens
{
49 Tokens
*factory(std::string
);
64 states _current_state
;
65 QString _current_line
;
66 Tokens::token _current_token
;
77 void _changeState(states
);
79 QString
_capCurrentLine(int);
81 void _createNewFile();
84 void _createNewHunk();
87 void _addCurrentLineToContext();
88 void _finishContext();
89 void _addCurrentLineToAdded();
91 void _addCurrentLineToDeleted();
92 void _finishDeleted();
93 void _finishChanged();
104 Parser(std::string type
, QTextStream
*in
) :
105 _current_state(START_STATE
),
107 _cur_file(NULL
), _cur_hunk(NULL
), _cur_context(NULL
),
108 _cur_deleted(NULL
), _cur_added(NULL
) { _tokens
= factory(type
); }