DLexerBase.cpp revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * SOFTWARE RIGHTS
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * Set (PCCTS) -- PCCTS is in the public domain. An individual or
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * company may do whatever they wish with source code distributed with
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * PCCTS or the code generated by PCCTS, including the incorporation of
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * PCCTS, or its output, into commerical software.
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * We encourage users to develop software with PCCTS. However, we do ask
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * that credit is given to us for developing PCCTS. By "credit",
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * we mean that if you incorporate our source code into one of your
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * programs (commercial product, research project, or otherwise) that you
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * acknowledge this fact somewhere in the documentation, research report,
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * etc... If you like PCCTS and have developed a nice tool with the
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * output, please mention that you developed it using PCCTS. In
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * addition, we ask that this header remain intact in our source code.
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * As long as these guidelines are kept, we expect to continue enhancing
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * this system and expect to make other tools available as they are
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * completed.
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * ANTLR 1.33
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * Terence Parr
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * Parr Research Corporation
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * with Purdue University and AHPCRC, University of Minnesota
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * 1989-2000
d0538f66491267879b7418b21ad78e3dcc2dcc83cg/* I have to put this here due to C++ limitation
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * that you can't have a 'forward' decl for enums.
d0538f66491267879b7418b21ad78e3dcc2dcc83cg * I hate C++!!!!!!!!!!!!!!!
d0538f66491267879b7418b21ad78e3dcc2dcc83cg// MR1 10-Apr-97 133MR1 Prevent use of varying sizes for the
d0538f66491267879b7418b21ad78e3dcc2dcc83cg// MR1 ANTLRTokenType enum
d0538f66491267879b7418b21ad78e3dcc2dcc83cgenum ANTLRTokenType { TER_HATES_CPP=0, ITS_UTTER_GARBAGE, // MR1
d0538f66491267879b7418b21ad78e3dcc2dcc83cg this->cl = 0;
d0538f66491267879b7418b21ad78e3dcc2dcc83cg// MR19 THM
d0538f66491267879b7418b21ad78e3dcc2dcc83cg/* saves dlg state, but not what feeds dlg (such as file position) */
d0538f66491267879b7418b21ad78e3dcc2dcc83cg/* erase what is currently in the buffer, and get a new reg. expr */
d0538f66491267879b7418b21ad78e3dcc2dcc83cg/* don't erase what is in the lextext buffer, add on to it */
d0538f66491267879b7418b21ad78e3dcc2dcc83cg/* substitute c for the reg. expr last matched and is in the buffer */
d0538f66491267879b7418b21ad78e3dcc2dcc83cg /* can't allow overwriting null at end of string */
d0538f66491267879b7418b21ad78e3dcc2dcc83cg if (c != '\0') {
d0538f66491267879b7418b21ad78e3dcc2dcc83cg/* replace the string s for the reg. expr last matched and in the buffer */
d0538f66491267879b7418b21ad78e3dcc2dcc83cg//Turn off "assignment within conditional expression" warning
dc8c6b69817035ac35a9f4e5a835d114ce2b5e24ms /* empty */
dc8c6b69817035ac35a9f4e5a835d114ce2b5e24ms /* correct for NULL at end of string */
fc6df3bdbec9a23827d64460d15c987a4497ef35miao chen - Sun Microsystems - Beijing China if ((nextpos <= l) && (*(--s) == 0)){
void DLGLexerBase::
int DLGLexerBase::
err_in()
return EOF;
advance();
skip();
getToken()
return tk;
void DLGLexerBase::
int iRet = 0;
if (parser)
return iRet;