[antlr-interest] Can one identify the type of parser needed for a given BNF grammar

Ron Burk ronburk at gmail.com
Mon Jul 11 20:14:51 PDT 2011


> Most C++ programs will not have any
> statements
> that cannot be resolved inline in the parser and would need to be resolved
> in a later AST
> TreeParser phase.

Hmmm? Surely a great many C++ programs rely extensively on
class libraries, and surely most of those make extensive use of
inline declarations.

struct TBuffer
    {
    void    Grow(size_t NewSize) { Buffer = realloc(Buffer, NewSize);
} /* wtf is Buffer? */
    char*  Buffer;    /* only later do we know what 'Buffer' refers to */
    };

How do you "resolve inline" class inline declarations that invariably refer
to a class that is not yet fully defined?

s/will not have any/will have many/

Use an abstract syntax tree or some form of token reprocessing,
what other choices are there? Neither way qualifies as "inline processing"
I would think...


More information about the antlr-interest mailing list