4 * const char *data = ts;
6 * cout << "<" << tok << "> ";
7 * for ( int i = 0; i < len; i++ )
31 # Single and double literals.
32 ( 'L'? "'" ( [^'\\\n] | '\\' any )* "'" )
41 ( 'L'? '"' ( [^"\\\n] | '\\' any )* '"' )
52 ( [a-zA-Z_] [a-zA-Z0-9_]* )
63 fract_const = digit* '.' digit+ | digit+ '.';
64 exponent = [eE] [+\-]? digit+;
65 float_suffix = [flFL];
67 ( fract_const exponent? float_suffix? |
68 digit+ exponent float_suffix? )
78 # Integer decimal. Leading part buffered by float.
79 ( ( '0' | [1-9] [0-9]* ) [ulUL]? )
89 # Integer octal. Leading part buffered by float.
90 ( '0' [0-9]+ [ulUL]? )
100 # Integer hex. Leading 0 buffered by float.
101 ( '0' ( 'x' [0-9a-fA-F]+ [ulUL]? ) )
111 # Only buffer the second item, first buffered by symbol.
257 # Three char compounds, first item already buffered.
267 # Single char symbols.
268 ( punct - [_"'] ) => {
269 token = first_token_char;
277 # Comments and whitespace.
278 '/!' ( any* $0 '!/' @1 ) => comment;
279 '//' ( any* $0 '\n' @1 ) => comment;
280 ( any - 33..126 )+ => {
291 "\"\\\"hi\" /!\n!/\n44 .44\n44. 44\n44 . 44\n44.44\n_hithere22"
292 "'\\''\"\\n\\d'\\\"\"\nhi\n99\n.99\n99e-4\n->*\n||\n0x98\n0x\n//\n/! * !/"