[antlr-interest] : help :Is it possible to have line number in the AST tree node

Anthony Brenelière abreneliere at telys.com
Mon Jun 23 09:53:41 PDT 2003


Yes,

But, you have to create an class that inherits from the class "baseAST",
that has a 'line' property.

The default used AST is CommonAST, and does not manage lines.

Set the created AST class to the factory that creates nodes.
In C++:

ANTLR_USE_NAMESPACE(antlr)ASTFactory ast_factory( "PNode" );

Cordially,
Anthony



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list