Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / mbkvrlog / mgl_class.h
1 class mgl_scomplexer : public yyFlexLexer {
2 public:
3 void embedded_yylex(int& result, YYSTYPE *lvalp, mgl_scompcontext *local_context);
4 private:
5 int yylex();
6 mgl_scompcontext *context;
7 YYSTYPE semantic_value;
8 };
9
10 class ParserExecutionContext {
11 friend mgl_scompcontext *mgl_getcontext(void *parm);
12
13 public:
14 ParserExecutionContext(mgl_scomplexer *ptlexer, FILE *ptinbuf) {
15 currentLexer = ptlexer;
16 currentStreambuf = new mgl_ifdstreambuf(fileno(ptinbuf), 512);
17 mgl_infile = new istream(currentStreambuf);
18 }
19 ~ParserExecutionContext(void) {
20 delete mgl_infile;
21 delete currentStreambuf;
22 }
23 mgl_scomplexer *currentLexer;
24 std::istream *mgl_infile;
25 private:
26 mgl_scompcontext context;
27 mgl_ifdstreambuf *currentStreambuf;
28 };
29