%{ #define YY_INPUT(buf,result,max_size) \ { int digit ; \ int c = getc( yyin ) ; \ result = c == EOF ? 0 : 1 ; \ if( c == '%' ) { \ c = getc( yyin ) ; \ digit = c >= 'A' ? (( c & 0xdf ) - 'A' ) + 10 : c - '0' ; \ digit *= 16 ; \ c = getc( yyin ) ; \ digit += c >= 'A' ? (( c & 0xdf ) - 'A' ) + 10 : c - '0' ; \ buf[0] = (char) digit ; \ } \ else if( c == '+' ) \ buf[0] = ' ' ; \ else \ buf[0] = (char) c ; \ } %} WS [ \t]* %% answer1={WS}scanf{WS}\({WS}\"%d{WS}%d\"{WS},{WS}\&foo{WS},{WS}\&bar{WS}\){WS};{WS} { send_file( "ans1-7.right" ) ; return( 0 ) ; } [^\r]* { send_file( "ans1-7.wrong" ) ; return( 0 ) ; } /* [^\r]* { printf( "Content-type:text/html\n\n" ) ; printf( "
Got:\n" ) ; printf( "%s\n", yytext ) ; printf( "\n" ) ; return( 0 ) ; } */ %% #include