[antlr-interest] Lexer speed comparison
Alex Sedow
alexsedow at mail.ru
Thu Feb 26 12:40:22 PST 2004
> You can take BIG PART in this process.
> Unfortunalty I cannot help too much.
> I am no expert on parsers, and busy on other tasks.
I don't think so. I am no expert on parsers too. And I am busy on other
tasks too. Ric want to add garbage collector. This is very hard task for
C++. Match simpler add allocator for fixed-size objects (objects with
variable length like strings may be separated by power of 2) and use smart
pointers. + hash code for strings.
> > Antlr/C++ 2.x has some handbrakes:
> > 1. Lexer generator that produce slow code. What about re2c?
> > 2. try/catch blocks in parser-generated code. What about return bool?
>
> As I know, exceptions are used for complex features of ANTLR,
> That with bool result will be very complex for coding.
Bool + error state (int). Bool sign that something wrong and need
backracking or choosing another branch. Error state used for analyse how to
propagate error: in this rule (in most cases skip tokens before guard
tokens) or in upper rule.
> > 4. Antlr not use allocators (allocators may speed up whole parser speed
> > about 3-4 times).
>
> Yes, this can be fact.
This is a real fact for C++ preprocessor.
Forget about 6-th handbrake.
6. Antlr use std::stream, faster load whole file into memory and than parse
it.
Alex.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list