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