help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C++ scanner passing values back out


From: Rupert Swarbrick
Subject: C++ scanner passing values back out
Date: Tue, 24 May 2005 00:00:24 +0100
User-agent: Debian Thunderbird 1.0 (X11/20050116)

This may be a stupid question, but I'm trying to use a proper C++
scanner with flex++ and, after reading some of the tokens, I need to
make the value that I've read available to the rest of my program.

Obviously a global yylval is out - I want something encapsulated within
the class, but the class is defined in (/usr/include/)FlexLexer.h and so
shouldn't be messed around with.

Although I can inherit from the class, the code in lex.ll can't write to
whatever the derived class's properties are because it thinks it's in
class yyFlexLexer (correctly).

Is there a clean way to handle this?

Or should I include the header for the derived class and do something
nasty like recasting this-> to get the variables?

Thanks in advance for any help,

Rupert

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]