[antlr-interest] [v2 to v3][C++/C] Fresh list of features for v3.4? // @after

Jim Idle jimi at temporal-wave.com
Wed Sep 7 09:30:20 PDT 2011


It is a C target not a C++ target, so it is raw and closer to the metal.
It is a lot faster than the 2.7 C++ target as a result, but you have to
dig a little.

Starting at the C API documentation linked from the ANTLR front page,
select ANTLR3 C Usage Guide then Using the ANTLR3 C Target, then
implementing Customized Methods, where you find the following text:

Implementing Customized Methods
Unless you wish to create your own tree structures using the built in
ANTLR AST rewriting notation, you will rarely need to override the default
implementation of runtime methods. The exception to this will be the
syntax err reporting method, which is essentially a stub function that you
will usually want to provide your own implementation for. You should
consider the built in function displayRecognitionError() as an example of
where to start as there can be no really useful generic error message
display

Selecting that shows you the documentation for that function. This is what
you should override. Start by copying the example version in the runtime,
then adapt it to your own needs. It is pretty easy.

In general all the names of methods and routines in the C runtime reflect
the Java names so that you can find Java examples and then see the
differences with C by looking for the C examples or searching the List or
reading the code. You will find it very helpful to single step your parser
in the C debugger for instance.

Also, searching from the Support page of antlr.org:

http://markmail.org/search/list:antlr+C+displayRecognitionError


Or, as there is no work out there in the world right now, you could just
hire me to do it all for you :)


Jim




> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Ruslan Zasukhin
> Sent: Wednesday, September 07, 2011 5:23 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] [v2 to v3][C++/C] Fresh list of features for
> v3.4? // @after
>
> Hi Terrence,
> Hi Jim,
>
> Our status is:
> *  we have used ANTLR 2.7 C++ in our Valentina DB engine near to 10
> years.
> * we have start smooth steps to ANTLR3 switch more of year ago ...
>     always something have interrupt us.
>
> Now we have working grammar, and tree parser grammar, and all this is
> integrated by #define into db engine, so far all good.
>
> Now task is provide error reporting.
>     How EASY this was in ANTLR v2 for us - C++ developers..
>     And I already have spent two days reading reading reading
>         site, docs, google, mail list, book, ...
>
> Terrence, I do not complain, but IMO, at least for C target it is very
> hard find on SITE, docs that answer major questions.
>
> I believe, it is not correct way, push developers to search google, and
> prev letters for last 3 years. Right?
>
> While I have read letters, I have note, for example, one at 2009 year,
> where is said
>     @after is not supported in C target
>
> So I ask self.
> * Hmm, I have NOT see this info in docs, which I have to read already.
> And
> * Hmm, interesting if this feature still not implemented for C?
>
> And may be I am blind, but I do not see such page on SITE/WIKI, As
>
> =========================================
>             List of Features of Runtime Targets  v3.4
>                                (and another pages for v 3.3  3.2  3.1
> 3.0 )
>
>                 Java        C           C#
>
> @after      yes           no         ?
> =========================================
>
>
> You see my point?
>
> I should say that ANTLR3 somehow is harder to use from box ...
> May be at least for C target ...
> May be at least comparing to what we are used in v2.7
>
>
> Couple days ago you have asked about features for 4.x  :-) I would like
> to ask add such major and important info into SITE.
>
>
> --
> Best regards,
>
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
>
> Valentina - Joining Worlds of Information http://www.paradigmasoft.com
>
> [I feel the need: the need for speed]
>
>
>
> 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