Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compiler Tools Pccts > Allowing any ch...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 74 of 134
Post > Topic >>

Allowing any character into a block comment

by garbage@[EMAIL PROTECTED] (Alexander Jhin) Oct 31, 2004 at 09:26 AM

I'm trying to implement a C++ style block comment:
/*hello!*/

I've copied the block comment code from the samples. It works fine
UNLESS the block comment contains a character that is not used by any
of my language's other constructs.

For example, my language does not use the '.' operator for anything.
So, ANTLR will reject this code with an "unexpected char" error:
/*Hello.*/

This, however is ok:
/*Hello!*/

Because the '!' is a valid char in my language (it means "not.")

Any advice on how to allow anything to be inside the block comment? I
thought matching against ~('*'|'\n'|'\r') would do the trick, but it
doesn't seem to be enough.

Thanks in advance.
 




 2 Posts in Topic:
Allowing any character into a block comment
garbage@[EMAIL PROTECTED]  2004-10-31 09:26:48 
Re: Allowing any character into a block comment
"Kunle Odutola"  2004-11-23 15:57:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 23 23:36:13 CDT 2008.