X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=include%2Fpol.h;h=1d149896801205c8621c6fe971ecaaf0bb70644f;hp=262cccbc1c93aa557ac4374d66733c04db7e7e58;hb=7ae47cb0ff0a16d1c36797576155263434cc73ff;hpb=df761d2b3cac3d347f4ef0f9f69e88d3bb66b2fa diff --git a/include/pol.h b/include/pol.h index 262cccb..1d14989 100644 --- a/include/pol.h +++ b/include/pol.h @@ -2,7 +2,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: pol.h,v 1.8 2000/12/27 20:09:19 kevin Exp $ +** $Id: pol.h,v 1.10 2000/12/29 20:11:42 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -21,7 +21,7 @@ #define __H_POL #include "hashtable.h" - +#include class POL { @@ -38,7 +38,7 @@ class POL { ~POL(); void init (); - void addSkipWord (const char const *w); + void addSkipWord (const char* const w); void addSkipChar (int c); void addKeyword (const char* const str, int code); bool readWord (char *search, int nlet); @@ -167,6 +167,17 @@ private: PC_DUMP, }; + enum { + INPUT_STREAM = 1, + INPUT_FILE, + INPUT_STRING, + }; + + int m_iInputType; + std::istream* m_pInputStream; + FILE* m_pInputFile; + char* m_pszInputString; + enum { MAXFILE = 8, }; @@ -178,12 +189,8 @@ private: char inputline[MAXLINE]; /* current input line */ int lineptr; /* current position in inputline */ - enum { - BUFSIZE = 100, - }; - int bp; // pointer to next free position - int buf[BUFSIZE]; // pushed back input characters - + std::stack m_stackPushBackInput; + bool skipSingleToken (char term[]); int tok (struct token_st *token); void dumptok (struct token_st *token);