[antlr-interest] static casts in heterogeneous AST parser

John Lambert johnl at jbase.com
Mon Oct 8 09:06:02 PDT 2001


I have problems compiling a parser using heterogeneous ASTs on HPUX.

It is objecting to all  static_cast operations between ASTRefcount<AST>  and
ASTRefcount< derivedAST> 

HP support claim they are correct and that it should be a reinterpret_cast.
I disagree, this works fine on lots of other platforms
and  a quick test of reinterpret_cast on other platforms produces
compilation errors.

Has anyone else encountered this ?

Thanks,

John Lambert


Here's a sample:

				Error 746: "AcorrParser.cpp", line 41 #
Cannot use static_cast to convert class ASTRefCount<antlr::AST> to class
ASTRefCount<ConvAST>.
				            returnAST =
static_cast<RefConvAST>(ANTLR_USE_NAMESPACE(antlr)nullAST);
	
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
				Error 746: "AcorrParser.cpp", line 43 #
Cannot use static_cast to convert class ASTRefCount<antlr::AST> to class
ASTRefCount<ConvAST>.
				            RefConvAST acorr_AST =
static_cast<RefConvAST>(ANTLR_USE_NAMESPACE(antlr)nullAST);




 

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



More information about the antlr-interest mailing list