+// typedef std::map<std::string,int> KeywordCodeList;
+
+ struct token_st {
+ int ready; // TRUE if token is ready
+ // std::string tokstr; // token string
+ char tokstr[MAXTOK+1];
+ int type; // type of token 'TT_'
+ int code; // holds code for user defined tokens
+ double fnum; // real value of token
+ int inum; // integer value of token
+ };
+ typedef struct token_st TOKEN;
+ struct token_st token; // current token
+
+ // Tables words stored with install() & found with lookup()
+ KeywordCodeHashTable skiptable; // words to ignore and skip
+ KeywordCodeHashTable cmdtable; // pol parameter commands
+ KeywordCodeHashTable usertable; // user defined symbols
+
+ struct metachar {
+ char eoc; /* end of command character */
+ char str; /* string delimiter */
+ char com; /* comment character */
+ char cmd; /* pol parameter command character */
+ char prg; /* program load character */
+ char con; /* continuation across newline character */
+ char out; /* character that delimits output to terminal */
+ char ter; /* character indicates insertion of input from terminal */
+ char inb; /* input from graphics device */
+ } meta;
+
+
+ char m_szSkipChars [MAXSKIPCHAR]; // characters to skip
+ bool m_bTrace;
+ bool m_bNewlineIsEOC;
+
+ struct KeywordCodeList {
+ const char *keyword;
+ int code;
+ };
+
+ static const struct KeywordCodeList cmdlist[];
+ static const unsigned int NUMCMD;
+
+ // Internal codes for pol commands
+ enum {
+ PC_EOC = 1,
+ PC_STR,
+ PC_COM,
+ PC_CMD,
+ PC_PRG,
+ PC_CON,
+ PC_OUT,
+ PC_TER,
+ PC_INB,
+ PC_NL_EOC,
+ PC_NL_NEOC,
+ PC_TRON,
+ PC_TROFF,
+ PC_FILE,
+ 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,
+ };
+
+ int currentf; /* pointer to current fp */
+ FILE *filep[MAXFILE]; /* == NULL for string input */
+ char *fname[MAXFILE]; /* pointer to filename */
+
+ char inputline[MAXLINE]; /* current input line */
+ int lineptr; /* current position in inputline */
+
+ std::stack<int> m_stackPushBackInput;
+
+ bool skipSingleToken (char term[]);
+ int tok (struct token_st *token);
+ void dumptok (struct token_st *token);
+
+
+ int getpol_tok (struct token_st *token);
+ int getcmd ();
+ int gettok (TOKEN *tok);
+ void getblank (char *s, int toksiz);
+ int getalpha (char *s, int toksiz);
+ void getquote (char *qs, int toksiz);
+ void getescape (char *s, int delim, int toksiz);
+ int getnumber (char str[], int strsize, double *fnum, int *inum);
+ void eatline ();
+ int type (int c);
+ int getch (FILE *fp);