DLexerBase.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
*
* SOFTWARE RIGHTS
*
* We reserve no LEGAL rights to the Purdue Compiler Construction Tool
* Set (PCCTS) -- PCCTS is in the public domain. An individual or
* company may do whatever they wish with source code distributed with
* PCCTS or the code generated by PCCTS, including the incorporation of
* PCCTS, or its output, into commerical software.
*
* We encourage users to develop software with PCCTS. However, we do ask
* that credit is given to us for developing PCCTS. By "credit",
* we mean that if you incorporate our source code into one of your
* programs (commercial product, research project, or otherwise) that you
* acknowledge this fact somewhere in the documentation, research report,
* etc... If you like PCCTS and have developed a nice tool with the
* output, please mention that you developed it using PCCTS. In
* addition, we ask that this header remain intact in our source code.
* As long as these guidelines are kept, we expect to continue enhancing
* this system and expect to make other tools available as they are
* completed.
*
* ANTLR 1.33
* Terence Parr
* Parr Research Corporation
* with Purdue University and AHPCRC, University of Minnesota
* 1989-2000
*/
#ifndef DLGX_H
#define DLGX_H
#include "pcctscfg.h"
#include "pccts_stdio.h"
#include ATOKEN_H
#include ATOKENSTREAM_H
/* must define what a char looks like; can make this a class too */
typedef char DLGChar;
/* Can have it as a class too: (ack this looks weird; is it right?)
class DllExportPCCTS DLGChar {
private:
int c;
public:
DLGChar(int ch) { c = ch; }
int atom() { return c; }
};
*/
/* user must subclass this */
};
/* Predefined char stream: Input from FILE */
int found_eof;
int nextChar() {
int c;
else {
return c;
}
}
};
// MR9 Suggested by Bruce Guenter (bruceg@qcc.sk.ca)
// MR9 Make DLGStringInput const correct
/* Predefined char stream: Input from string */
const DLGChar *p; // MR9
int nextChar()
{
if (*p) return (int) (unsigned char) *p++; // MR14
else return EOF;
}
};
int interactive;
int track_columns;
int auto_num;
int add_erase;
int lookc;
int char_full;
int line;
int bufsize;
int bufovf;
int class_num;
int debugLexerFlag; // MR1
};
/* user must subclass this */
int interactive;
int track_columns;
int _bufsize; /* number of characters in lextext */
int _begcol; /* column that first character of token is in*/
int _endcol; /* column that last character of token is in */
int _line; /* line current token is on */
int ch; /* character to determine next state */
int bufovf; /* indicates that buffer too small for text */
int charfull;
int cl;
int automaton;
int add_erase;
int debugLexerFlag; // MR1
void skip(void); /* erase lextext, look for antoher token */
void more(void); /* keep lextext, look for another token */
void mode(int k); /* switch to automaton 'k' */
void restoreState(DLGState *);
a character */
a string */ /* MR20 const */
void set_begcol(int a) { _begcol=a; }
void set_endcol(int a) { _endcol=a; }
void setInputStream(DLGInputStream *);
unsigned bufsize=2000,
int interactive=0,
int track_columns=0);
void reset(); // MR19
void trackColumns() {
track_columns = 1;
};
int lexErrCount; // MR12
};
#endif