Modules | Files | Inheritance Tree | Inheritance Graph | Name Index | Config
namespace Synopsis::Parser::C++::AST
class Declaration
Files: Synopsis/Parser/C++/syn/ast.hh
Declaration-inheritance Scopes/Synopsis/Parser/C++/AST/Scope.html Scopes/Synopsis/Parser/C++/AST/Typedef.html Scopes/Synopsis/Parser/C++/AST/Enum.html Scopes/Synopsis/Parser/C++/AST/Macro.html Scopes/Synopsis/Parser/C++/AST/Enumerator.html Scopes/Synopsis/Parser/C++/AST/Variable.html Scopes/Synopsis/Parser/C++/AST/Forward.html Scopes/Synopsis/Parser/C++/AST/Function.html Scopes/Synopsis/Parser/C++/AST/Const.html Scopes/Synopsis/Parser/C++/FakeGC/cleanup.html

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:
 constructorDeclaration(SourceFile* file, int line, const std::string& type, const ScopedName& name)
Constructor [Source]
virtual destructor~Declaration()
Destructor. [Source]
virtual voidaccept(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]
 voidset_file(SourceFile* file)
Changes the filename of this declaration [Source]
 intline()
Returns the line number of this declaration [Source]
 const std::string&type()
Returns the name of the type (not class) of this declaration [Source]
 voidset_type(const std::string& type)
Change the type name. [Source]
 Accessaccess()
Returns the accessability of this declaration [Source]
 voidset_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]
intm_line
The first line number [Source]
std::stringm_type
The string type name [Source]
ScopedNamem_name
The scoped name [Source]
Comment::vectorm_comments
The vector of Comment objects [Source]
Accessm_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:
virtual destructor ~Declaration()

Destructor. Recursively deletes the comments for this declaration


 void set_type(const std::string& type)

Change the type name. Currently only used to indicate template types


 Comment::vector& comments()

Returns the vector of comments. The vector returned is the private member vector of this Declaration, so modifications will affect the Declaration.


 Types::Declared* declared()

Return a cached Types::Declared for this Declaration. It is created on demand and returned every time you call the method on this object.


const Types::Declared* declared()

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.