From: Francis Cianfrocca Date: 2006-09-15T11:51:16+09:00 Subject: Re: Regular expression question. ------=_Part_7184_8387020.1158288629219 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 9/14/06, Logan Capaldo wrote: > > > gcc agrees with me at least: > > % cat comments.c > #include > > int main(int argc, char **argv) { > /* printf("*/"); */ > /* printf("/*.......*/"); */ > return 0; > } > % gcc -c comments.c > comments.c: In function 'main': > comments.c:4: error: missing terminating " character > comments.c:5: error: missing terminating " character > > > > > is actually context-free. Does anyone know for sure? > As for whether or not its context free, I don't know, but I think you > overestimated how hard C tries. /* */ are not nestable for instance. > > I know these are syntax errors in C. I was talking about a hypothetical language (not C) that defined such constructs as legal. I'm still not sure that it's impossible to use a regular language to generate this case: /* "*/ */ I'm pretty convinced that the other case requires a context-free language. ------=_Part_7184_8387020.1158288629219--