[antlr-interest] Antlr v4 - C++ target -- idea for Terrence ...
ruslan_zasukhin at valentina-db.com
Wed Jan 11 00:27:37 PST 2012
On 1/11/12 2:22 AM, "Sam Harwell" <sam at tunnelvisionlabs.com> wrote:
> I wouldn't expect a C++ version of ANTLR 4 within the next 12 months. The
> Java target and ANTLRWorks 2 are both still pre-alpha. I'm not planning to
> start the C# target until a release candidate of v4 is available, and the C#
> target will involve ports of the runtime, the tool, and potentially
> integration of some ANTLRWorks 2 features into Visual Studio. After that is
> working I'll start the C++ port.
> I'm confident that under standard usage the C++ port will reduce memory to
> about 10-15% of what 3.4 currently requires. Using templates and a custom
> token type, it should be possible to cut that down to <5% of what 3.4
As far as I have see, the 3.4 C implementation have weak-side because MANY
pointers to handlers present in the each object. In such was was imitated
virtual table of C++, but instead of single pointer was inserted all funcs
So this is main issue that will be removed with c++ version I think.
But I do not see how you going win with help of templates?
Can you show any small example?
To Terrence ...
I see you make big progress in challenge of left-recursions,
And before that in automates
I want to underline again, that C 3.4 was not faster actually of v2 C++
And ANTLR 3.4 still is slower for us than parser of SQLite - Lemon
I very recommend you make benches under profiles some your ANTLR grammar and
its analog of YACC and that Lemon.
I believe (relative) slowness of ANTLR comes from the fact of long chains of
function calls ... Yes this is strong side for debugging -- human style,,,
But weak side for RELEASE and speed.
My point is -- may be you can invent some way to produce two branches of
A) for debugging - funcs style
B) for release -- automate style
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
[I feel the need: the need for speed]
More information about the antlr-interest