2000-12-08 21:51:13 +01:00
|
|
|
#ifndef _LEXER_H
|
|
|
|
#define _LEXER_H
|
|
|
|
|
|
|
|
#include <clex.h>
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// mylexer
|
|
|
|
|
|
|
|
class YYFAR mylexer : public yyflexer {
|
|
|
|
public:
|
|
|
|
mylexer();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void yytables();
|
|
|
|
virtual int yyaction(int action);
|
|
|
|
|
|
|
|
public:
|
2000-12-11 21:28:41 +01:00
|
|
|
#line 24 "C:\\spongebob\\Utils\\scripter\\lexer.l"
|
2000-12-08 21:51:13 +01:00
|
|
|
|
2000-12-11 21:28:41 +01:00
|
|
|
int openInputFile(char *_filename);
|
|
|
|
int closeInputFile();
|
2000-12-08 21:51:13 +01:00
|
|
|
|
2000-12-11 21:28:41 +01:00
|
|
|
void setCurrentParser(class myparser *_parser) {m_currentParser=_parser;}
|
|
|
|
class myparser *getCurrentParser() {return m_currentParser;}
|
|
|
|
|
|
|
|
int getCurrentLine() {return m_lineCount+1;}
|
|
|
|
int getCurrentCharOnLine() {return m_currentCharOnLine;}
|
|
|
|
int getErrorCount() {return m_errorCount;}
|
|
|
|
|
|
|
|
void error() {m_errorCount++;}
|
|
|
|
|
|
|
|
|
|
|
|
// Overridden lexer functions
|
|
|
|
int yygetchar();
|
|
|
|
|
|
|
|
private:
|
2000-12-11 23:18:54 +01:00
|
|
|
// FILE *m_fhInput;
|
2000-12-11 21:28:41 +01:00
|
|
|
int m_charCount;
|
|
|
|
int m_lineCount;
|
|
|
|
int m_currentCharOnLine;
|
|
|
|
int m_errorCount;
|
|
|
|
|
|
|
|
class myparser *m_currentParser;
|
|
|
|
|
|
|
|
#line 46 "C:\\spongebob\\Utils\\scripter\\lexer.h"
|
2000-12-08 21:51:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef YYLEXNAME
|
|
|
|
#define YYLEXNAME mylexer
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef INITIAL
|
|
|
|
#define INITIAL 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|