*
* 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
*/
#include "pcctscfg.h"
#include "pccts_stdio.h"
#include "pccts_stdlib.h"
/* I have to put this here due to C++ limitation
* that you can't have a 'forward' decl for enums.
* I hate C++!!!!!!!!!!!!!!!
*/
// MR1
// MR1 10-Apr-97 133MR1 Prevent use of varying sizes for the
// MR1 ANTLRTokenType enum
// MR1
#define ANTLR_SUPPORT_CODE
#include "pcctscfg.h"
#include DLEXERBASE_H
#include APARSER_H // MR23
unsigned bufsize,
int _interactive,
int _track_columns)
{
panic("text buffer is NULL");
}
this->cl = 0;
this->add_erase = 0;
this->_begcol = 0;
this->_endcol = 0;
this->_line = 1;
this->charfull = 0;
this->automaton = 0;
this->token_to_fill = NULL;
this->interactive = _interactive;
this->track_columns = _track_columns;
this->debugLexerFlag = 0; // MR1
this->lexErrCount=0; // MR11
}
// MR19 THM
{
this->charfull = 0;
this->_begcol = 0;
this->_endcol = 0;
this->automaton = 0;
this->_line=1;
this->lexErrCount=0;
}
void DLGLexerBase::
{
_line = 1;
charfull = 0;
}
/* saves dlg state, but not what feeds dlg (such as file position) */
void DLGLexerBase::
{
}
void DLGLexerBase::
{
}
/* erase what is currently in the buffer, and get a new reg. expr */
void DLGLexerBase::
skip()
{
add_erase = 1;
}
/* don't erase what is in the lextext buffer, add on to it */
void DLGLexerBase::
more()
{
add_erase = 2;
}
/* substitute c for the reg. expr last matched and is in the buffer */
void DLGLexerBase::
{
/* can't allow overwriting null at end of string */
*_begexpr = c;
}
if (c != '\0') {
}
else {
}
}
/* replace the string s for the reg. expr last matched and in the buffer */
#ifdef _MSC_VER // MR23
//Turn off "assignment within conditional expression" warning
#endif
void DLGLexerBase::
{
if (s){
/* empty */
}
/* correct for NULL at end of string */
nextpos--;
}
if ((nextpos <= l) && (*(--s) == 0)){
bufovf = 0;
}else{
bufovf = 1;
}
*(nextpos) = '\0';
}
#ifdef _MSC_VER // MR23
#pragma warning(default: 4706)
#endif
void DLGLexerBase::
{
lexErrCount++; /* MR11 */
"%s near line %d (text was '%s')\n",
((s == NULL) ? "Lexical error" : s),
}
int DLGLexerBase::
err_in()
{
/* return eof to get out gracefully */
return EOF;
}
{
errstd("invalid token");
advance();
skip();
return (ANTLRTokenType) 0; // bogus, but satisfies compiler
}
getToken()
{
return tk;
}
void DLGLexerBase::
{
if (parser) //MR23
else //MR23
{
//
// 7-Apr-97 133MR1
//
}
}
parser=p; // MR1
return oldValue; // MR1
} // MR1
// MR1
return parser; // MR1
} // MR1
// MR1
int DLGLexerBase:: // MR1
return oldValue; // MR1
} // MR1
//MR23
{
int iRet = 0;
if (parser)
else
return iRet;
}