summaryrefslogtreecommitdiff
path: root/src/importer.hpp
blob: 643fe5a0784c543f3a0ad5dd77a013d014a87455 (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
29
30
31
32
33
34
35
36
37
38
39
#ifndef TEXO_INCLUDED_IMPORTER
#define TEXO_INCLUDED_IMPORTER

#include "producer.hpp"
#include <stdio.h>


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Texo Importer
 * Texo interface for parsers from input characters into inner representation,
 * described by Texo Producer.
 */
class TexoImporter {
public:
    TexoImporter(TexoProducer &producer);
    ~TexoImporter();


    bool End();

    bool Put(char c);
    bool Put(const char *s);
    bool Put(FILE *f);


protected:
    virtual bool TrueEnd();

    virtual bool TruePut(char c) = 0;
    virtual bool TruePut(const char *str);
    virtual bool TruePut(FILE *file);


    TexoProducer &producer;
    bool          ok;
};


#endif