[antlr-interest] ASTRefCount.hpp

wiggjd at sbu.ac.uk wiggjd at sbu.ac.uk
Tue Jul 29 04:15:57 PDT 2003


I am redeveloping our C++ parser using ANTLR.

I have come across the following coding in ASTRefCount.hpp and
I cannot make sense of the first line. It was included in
support.cpp. It must have compiled but to parse it properly I 
need to understand it. Please could the author (or anyone
else) help?

operator T* () const
	{ return ref ? static_cast<T*>(ref->ptr) : 0; }
T* operator->() const
	{ return ref ? static_cast<T*>(ref->ptr) : 0; }
T* get() const
	{ return ref ? static_cast<T*>(ref->ptr) : 0; }

Problems,
1. It doesn't seem to specify a return type
2. T* is not an operator

Thanks,

David.

 

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




More information about the antlr-interest mailing list