[antlr-interest] Re: ANTLR C++ error?

Ric Klaren klaren at cs.utwente.nl
Wed Feb 27 03:00:44 PST 2002

On Wed, Feb 27, 2002 at 10:36:38AM -0000, marc_schellens wrote:
> > I see no problem here.
> As I see it, the problem is the first cast:
> var_AST=astFactory.create(static_cast<antlr::RefAST>(
> static_cast<antlr::RefAST>(tmp58_AST),i->getText()
> ));
> because of which the expression is a comma expression instead of
> to paramters. Consequently I get the following error:
> my.tree.g: In method `void MyTreeParser::var
> (antlr::ASTRefCount<DNode>)':
> my.tree.g:316: no matching function for call to
> `antlr::ASTRefCount<antlr::AST>::ASTRefCount (string)'
> antlr/ASTRefCount.hpp:66: candidates are: 
> antlr::ASTRefCount<T>::ASTRefCount (const antlr::AST * = 0) [with T = 
> antlr::AST]
> antlr/ASTRefCount.hpp:70:                 
> antlr::ASTRefCount<T>::ASTRefCount (const antlr::ASTRefCount<T> &) 
> [with T = antlr::AST]
> Do I miss something?
> Maybe I got the wrong syntax?
> I thought with #[TYPE,text] I would define a NEW node. I don't want
> to copy something here.

Aha I see the problem now, didn't look at the braces for the first mail.
Ok. What ANTLR version (did you try the prerelease already)? What compiler?
What exact grammar options?

Above all send me a small version of your grammar that can run through
antlr, then I might be able to look at this sooner, if not I'll put it of
till I got time again.

    ---- Ric Klaren ----- klaren at cs.utwente.nl ----- +31 53 4893722  ----
 'And this 'rebooting' business? Give it a good kicking, do you?' 'Oh, no,
  of course, we ... that is ... well, yes, in fact,' said Ponder. 'Adrian
    goes round the back and ... er ... prods it with his foot. But in a
     technical way,' he added. --- From: Hogfather by Terry Pratchett.


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

More information about the antlr-interest mailing list