Jump to content

Talk:Strip comments from a string: Difference between revisions

Line 23:
Are we to assume the comment character (# or ;) is not going to ever be inside a string "#" or that there are no strings in whatever language this is? If there are strings, do we assume '#' is not a valid strings in this language? what about Ruby where strings can often be delimited by meaningless characters? In order to properly "strip comments" we need to know what we're stripping them from. --[[User:Deltree|Deltree]] 16:04, 27 July 2011 (UTC)
:So far, it seems like comments may contain comment characters, but that the non-comment text cannot quote or escape comment characters. This does not seem very useful. On the other hand, normally comment stripping happens inside of a parser which has mechanics to ignore comment characters when they appear in the wrong context. So the interesting task here is probably [[Parse_EBNF]]. --[[User:Rdm|Rdm]] 17:37, 27 July 2011 (UTC)
::Except [[Parse_EBNF]] task is a little ''too'' elaborate. Here we want a parser based on some BNF, while that task requires ''creating'' a parser based on some BNF, a program writing a program sort of thing. --[[User:Ledrug|Ledrug]] 18:53, 27 July 2011 (UTC)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.