campo-sirio/include/scanner.h
guy 789ac315d5 Aggiunti distruttori virtuali
git-svn-id: svn://10.65.10.50/trunk@900 c028cbd2-c16b-5b4b-a496-9718f37d4682
1995-01-24 08:52:49 +00:00

49 lines
902 B
C++
Executable File

#ifndef __SCANNER_H
#define __SCANNER_H
#ifndef __FSTREAM_H
#include <fstream.h>
#endif
#ifndef __STRINGS_H
#include <strings.h>
#endif
#ifndef INCL_XVTH
#include <xvt.h>
#endif
// @C
class TScanner : private ifstream
{
// @DPRIV
TString _token, _key;
bool _pushed;
word _line;
public:
// @FPUB
TScanner(const char* filename);
~TScanner() {}
const TString& pop();
const TString& key() const { return _key; }
const TString& popkey() { pop(); return key(); }
const TString& string();
TString& line(char eol = '\n');
const TString& equal() { return line('='); }
void rectangle(RCT& rect);
int integer();
double number();
const TString& operand();
bool paragraph(const char* name);
bool ok() { return good(); }
void push(const char* tok = NULL);
const TString& token() const { return _token; }
word linenum() { return _line; }
};
#endif // __SCANNER_H