summaryrefslogtreecommitdiff
path: root/Tools/CCode/Source/Pccts/h/BufFileInput.h
diff options
context:
space:
mode:
authorlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>2006-10-05 23:24:16 +0000
committerlhauch <lhauch@6f19259b-4bc3-4df7-8a09-765794883524>2006-10-05 23:24:16 +0000
commit604371b98d3ad2472e96be8d126df92b2fcf68df (patch)
treec51c0d63bf3517ed48b28b111cf744dd5da4c866 /Tools/CCode/Source/Pccts/h/BufFileInput.h
parent28305207ea586d0b5ceb530b0e2a436cad9fdd8f (diff)
downloadedk2-platforms-604371b98d3ad2472e96be8d126df92b2fcf68df.tar.xz
More moves for Tool Packages
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1676 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/CCode/Source/Pccts/h/BufFileInput.h')
-rw-r--r--Tools/CCode/Source/Pccts/h/BufFileInput.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/Tools/CCode/Source/Pccts/h/BufFileInput.h b/Tools/CCode/Source/Pccts/h/BufFileInput.h
new file mode 100644
index 0000000000..ea54c0ee26
--- /dev/null
+++ b/Tools/CCode/Source/Pccts/h/BufFileInput.h
@@ -0,0 +1,53 @@
+// FILE: BufFileInput.h
+// AUTHOR: Alexey Demakov (AVD) demakov@kazbek.ispras.ru
+// CREATION: 26-JAN-1998
+// DESCRIPTION: File Input Stream with lookahead for Scanner
+// Tested under Win32 with ANTLR 1.33 MR10 and MSVC 5.0
+
+// Change History:
+//
+// 28-May-1998 Add virtual destructor to release buffer
+// Manfred Kogler (km@cast.uni-linz.ac.at)
+// (1.33MR14)
+
+#ifndef BufFileInput_h
+#define BufFileInput_h
+
+#include "pcctscfg.h"
+
+#include "pccts_stdio.h"
+
+PCCTS_NAMESPACE_STD
+
+#include "DLexerBase.h"
+
+class DllExportPCCTS BufFileInput : public DLGInputStream
+{
+public:
+ // constructor
+ // f - input stream
+ // buf_size - size of buffer (maximal length for string in is_in)
+
+ BufFileInput(FILE *f, int buf_size = 8 );
+
+ virtual ~BufFileInput();
+
+ // gets next char from stream
+
+ virtual int nextChar( void );
+
+ // looks in stream and compares next l characters with s
+ // returns the result of comparision
+
+ int lookahead( char* s );
+
+private:
+ FILE *input; // input stream;
+ int* buf; // buffer
+ int size; // size of buffer
+ int start; // position of the first symbol in buffer
+ int len; // count of characters in buffers
+};
+
+#endif
+// end of file BufFileInput.h