[antlr-interest] A suggestion for C runtime

Gokulakannan Somasundaram gokul007 at gmail.com
Fri Jul 30 03:30:04 PDT 2010


Sorry, i made a mistake in explaining the problem here.  I will try to
re-word it
a) pANTLR3_UINT8 is a pointer to unsigned char.
b) But say i get a const char* to be parsed, but when i try
the antlr3NewAsciiStringInPlaceStream, it only accepts pANTLR3_UINT8, so we
have to do a cast here. In c++, this requires a const_cast +
reinterpret_cast.

If we can take care const correctness in probably the next version, then
such unnecessary casts can be avoided.

Thanks,
Gokul.

On Thu, Jul 29, 2010 at 3:25 PM, Gokulakannan Somasundaram <
gokul007 at gmail.com> wrote:

> Hi,
>    A small suggestion for improvement on ANTLR C Runtime would be to, make
> sure the const correctness is present in the code. While this is not very
> important, it helps a lot while getting integrated into a already
> standardized code. I found it difficult especially in the places where it
> takes the query for processing. It can be pANTLR3_UINT8 const, instead
> of pANTLR3_UINT8.
>
> Thanks,
> Gokul.
>


More information about the antlr-interest mailing list