1 /* $NetBSD: testxxLexer.l,v 1.1.1.1 2009/10/26 00:28:31 christos Exp $ */
3 // An example of using the flex C++ scanner class.
17 name ({alpha}|{dig}|\$)({alpha}|{dig}|\_|\.|\-|\/|\$)*
18 num1 [-+]?{dig}+\.?([eE][-+]?{dig}+)?
19 num2 [-+]?{dig}*\.{dig}+([eE][-+]?{dig}+)?
24 {ws} /* skip blanks and tabs */
29 while((c = yyinput()) != 0)
36 if((c = yyinput()) == '/')
44 {number} FLEX_STD cout << "number " << YYText() << '\n';
48 {name} FLEX_STD cout << "name " << YYText() << '\n';
50 {string} FLEX_STD cout << "string " << YYText() << '\n';
54 int main( int /* argc */, char** /* argv */ )
56 FlexLexer* lexer = new yyFlexLexer;
57 while(lexer->yylex() != 0)