The base class of the Declaration hierarchy. All declarations have a scoped Name, comments, etc. The filename and type name are constant strings. This is enforced so that the strings will reference the same data, saving both memory and cpu time. For this to work however, you must be careful to use the same strings for constructing the names from, for example from a dictionary.
Public Typedefs Summary: | |
std::vector<Declaration*> | vector A vector of Declaration objects [Source] |
Public Member functions Summary: | |
constructor | Declaration(SourceFile* file, int line, const std::string& type, const ScopedName& name) Constructor [Source] |
virtual destructor | ~Declaration() Destructor. [Source] |
virtual void | accept(Visitor*) Accept the given AST::Visitor [Source] |
ScopedName& | name() Returns the scoped name of this declaration [Source] |
const ScopedName& | name() Constant version of name() [Source] |
SourceFile* | file() Returns the filename of this declaration [Source] |
void | set_file(SourceFile* file) Changes the filename of this declaration [Source] |
int | line() Returns the line number of this declaration [Source] |
const std::string& | type() Returns the name of the type (not class) of this declaration [Source] |
void | set_type(const std::string& type) Change the type name. [Source] |
Access | access() Returns the accessability of this declaration [Source] |
void | set_access(Access axs) Sets the accessability of this declaration [Source] |
const Comment::vector& | comments() Constant version of comments() [Source] |
Comment::vector& | comments() Returns the vector of comments. [Source] |
Types::Declared* | declared() Return a cached Types::Declared for this Declaration. [Source] |
const Types::Declared* | declared() Return a cached Types::Declared for this Declaration. [Source] |
Private Data members Summary: | |
SourceFile* | m_file The filename [Source] |
int | m_line The first line number [Source] |
std::string | m_type The string type name [Source] |
ScopedName | m_name The scoped name [Source] |
Comment::vector | m_comments The vector of Comment objects [Source] |
Access | m_access The accessability spec [Source] |
Types::Declared* | m_declared The Types::Declared cache [Source] |
Public Data members Inherited from FakeGC::cleanup | |
cleanup_next |
Public Member function Details: |
Destructor. Recursively deletes the comments for this declaration
Change the type name. Currently only used to indicate template types
Returns the vector of comments. The vector returned is the private member vector of this Declaration, so modifications will affect the Declaration.
Return a cached Types::Declared for this Declaration. It is created on demand and returned every time you call the method on this object.
Return a cached Types::Declared for this Declaration. It is created on demand and returned every time you call the method on this object. This is the const version.