DLexer.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/* DLexer.h (formerly DLexer.cpp)
*
* This was renamed because the use of the .cpp extension caused problems
* with IDEs.
*
* 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 ZZCOPY
#define ZZCOPY \
/* Truncate matching buffer to size (not an error) */ \
}else{ \
bufovf = 1; \
}
#endif
void DLGLexer::
mode( int m )
{
/* points to base of dfa table */
if (m<MAX_MODE){
automaton = m;
/* have to redo class since using different compression */
}else{
}
}
nextTokenType(void)
{
/* last space reserved for the null char */
skip:
bufovf = 0;
more:
if ( interactive ) {
/* interactive version of automaton */
/* if there is something in ch, process it */
if (charfull){
}
while (alternatives[newstate]){
}
/* figure out if last character really part of token */
charfull = 1;
--nextpos;
}else{
charfull = 0;
}
*(nextpos) = '\0';
/* Able to transition out of start state to some non err state?*/
/* make sure doesn't get stuck */
advance();
}
}
else { /* non-interactive version of automaton */
if (!charfull)
advance();
else
while (ZZNEWSTATE != DfaStates) {
}
charfull = 1;
}else{
bufovf = 1;
}
*nextpos = '\0';
/* make sure doesn't get stuck */
advance();
}else{
*nextpos = '\0';
}
}
add_erase = 0;
#ifdef OLD
tk = (ANTLRTokenType)
// actions is not a [] of pointers
// to member functions.
#endif
// MR1
// MR1 11-Apr-97 Help for tracking DLG results
// MR1
#ifdef DEBUG_LEXER
/* MR1 */ if (debugLexerFlag) {
/* MR1 */ } else {
/* MR1 */ };
/* MR1 */ automaton);
/* MR1 */ } else {
/* MR1 */ } else {
/* MR1 */ };
/* MR1 */ };
/* MR1 */ ""));
/* MR1 */ };
#endif
switch (add_erase) {
case 1: goto skip;
case 2: goto more;
}
return tk;
}
void DLGLexer::
advance()
{
}