You can always resolve an inline declaration like the one below either by
the
syntax of the statement or by the SymbolTable or by the default rule that
ambiguous statements that look like a declaration are a declaration. The
SymbolTable is required but an AST and TreeParser is not.

TBuffer(123) foo;

Forward references to a class member may require an AST and TreeParser but
they are not common. The problem you list below cannot happen if the member
functions are defined in a separate C++ file and would not happen if the
member
variables are declared before the member functions. This is the 10% case.


see <
http://publib.boulder.ibm.com/infocenter/comphelp/v7v91/index.jsp?topic=%2Fcom.ibm.vacpp7a.doc%2Flanguage%2Fref%2Fclrc08cplr403.htm
>

On Mon, Jul 11, 2011 at 11:14 PM, Ron Burk <ronb...@gmail.com> wrote:

> > 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...
>
> 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

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to