// An example of using the flex C++ scanner class.
name ({alpha}|{dig}|\$)({alpha}|{dig}|\_|\.|\-|\/|\$)*
num1 [-+]?{dig}+\.?([eE][-+]?{dig}+)?
num2 [-+]?{dig}*\.{dig}+([eE][-+]?{dig}+)?
{ws} /* skip blanks and tabs */
while((c = yyinput()) != 0)
if((c = yyinput()) == '/')
{number} cout << "number " << YYText() << '\n';
{name} cout << "name " << YYText() << '\n';
{string} cout << "string " << YYText() << '\n';
int main( int /* argc */, char** /* argv */ )
FlexLexer* lexer = new yyFlexLexer;
while(lexer->yylex() != 0)