[antlr-interest] Jim Idle: C-Runtime - C++Builder and static void int(pXYZParser ctx); /encoding

Jim Idle jimi at temporal-wave.com
Tue Sep 27 14:26:16 PDT 2011


It is the same, but you just add one of:


/// General latin-1 or other 8 bit encoding scheme such as straight ASCII
///
#define ANTLR3_ENC_8BIT     4

/// UTF-8 encoding scheme
///
#define ANTLR3_ENC_UTF8     8

/// UTF-16 encoding scheme (which also covers UCS2 as that does not have
surrogates)
///
#define ANTLR3_ENC_UTF16        16
#define ANTLR3_ENC_UTF16BE      16 + ANTLR3_BE
#define ANTLR3_ENC_UTF16LE      16 + ANTLR3_LE

/// UTF-32 encoding scheme (basically straight 32 bit)
///
#define ANTLR3_ENC_UTF32        32
#define ANTLR3_ENC_UTF32BE      32 + ANTLR3_BE
#define ANTLR3_ENC_UTF32LE      32 + ANTLR3_LE

/// Input is 8 bit EBCDIC (which we convert to 8 bit ASCII on the fly
///
#define ANTLR3_ENC_EBCDIC       64


As in:

antlr3FileStreamNew ((pANTLR3_UINT8)"fred", ANTLR3_ENC_8BIT);


Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Udo Weik
> Sent: Tuesday, September 27, 2011 2:17 PM
> To: antlr-interest at antlr.org
> Subject: Re: [antlr-interest] Jim Idle: C-Runtime - C++Builder and
> static void int(pXYZParser ctx); /encoding
>
> Hello Jim,
>
> > Is that the name of a rule? Just change the rule name. If this is a
> > method in the runtime, then that is a bug in C++ builder - if the C
> > compiler is happy, then the build tool should be happy. But you need
> > to give me more info so I can decide.
>
> you are right, it's a name of a (parser) rule - int. There is a a lexer
> rule INT which is prefixed by a 'm' - mINT. Why is there no prefix for
> parser rules?
> I'm just getting my first grammar working with C++Builder, really a lot
> of micracles and hurdles. I miss antlr3AsciiFileStreamNew, so what is
> the encoding for a simple, plain ascii-file when I use
> antlr3FileStreamNew (pANTLR3_UINT8 fileName, ANTLR3_UINT32 encoding)?
>
>
> Many thanks and greetings
> Udo
>
>
> >> -----Original Message-----
> >> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> >> bounces at antlr.org] On Behalf Of Udo Weik
> >> Sent: Tuesday, September 27, 2011 12:58 PM
> >> To: antlr-interest at antlr.org
> >> Subject: [antlr-interest] Jim Idle: C-Runtime - C++Builder and
> static
> >> void int(pXYZParser ctx);
> >>
> >> Hello Jim,
> >>
> >> C++Builder doesn't like the int of int(pXYZParser ctx) - is it
> >> C++possible
> >> to use another name?
> >>
> >>
> >> Many thanks and greetings
> >> Udo
> >>
> >> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> >> Unsubscribe:
> >> http://www.antlr.org/mailman/options/antlr-interest/your-
> >> email-address
> >
> > List: http://www.antlr.org/mailman/listinfo/antlr-interest
> > Unsubscribe:
> > http://www.antlr.org/mailman/options/antlr-interest/your-email-
> address
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address


More information about the antlr-interest mailing list