1
// FILE: BufFileInput.h
2
// AUTHOR: Alexey Demakov (AVD) demakov@kazbek.ispras.ru
3
// CREATION: 26-JAN-1998
4
// DESCRIPTION: File Input Stream with lookahead for Scanner
5
// Tested under Win32 with ANTLR 1.33 MR10 and MSVC 5.0
9
// 28-May-1998 Add virtual destructor to release buffer
10
// Manfred Kogler (km@cast.uni-linz.ac.at)
13
#ifndef BufFileInput_h
14
#define BufFileInput_h
18
#include "pccts_stdio.h"
22
#include "DLexerBase.h"
24
class DllExportPCCTS BufFileInput : public DLGInputStream
29
// buf_size - size of buffer (maximal length for string in is_in)
31
BufFileInput(FILE *f, int buf_size = 8 );
33
virtual ~BufFileInput();
35
// gets next char from stream
37
virtual int nextChar( void );
39
// looks in stream and compares next l characters with s
40
// returns the result of comparision
42
int lookahead( char* s );
45
FILE *input; // input stream;
47
int size; // size of buffer
48
int start; // position of the first symbol in buffer
49
int len; // count of characters in buffers
53
// end of file BufFileInput.h