summaryrefslogtreecommitdiff
path: root/parser.h
blob: 689846da6a7efcb9700e10b66b517b8af12039af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef _PARSER_H
#define _PARSER_H

#include "utils.h"

namespace ledger {

class account_t;
class journal_t;

class parser_t
{
 public:
  virtual ~parser_t() {}

  virtual bool test(std::istream& in) const = 0;

  virtual unsigned int parse(std::istream&	 in,
			     journal_t *	 journal,
			     account_t *	 master        = NULL,
			     const string * original_file = NULL) = 0;
};

DEFINE_EXCEPTION(parse_exception)

} // namespace ledger

#endif // _PARSER_H