Joos1W Compiler Framework
|
Represents a scoped (i.e., local) typed variable declaration. More...
#include <Decl.h>
Public Member Functions | |
VarDecl (BumpAllocator &alloc, SourceRange location, Type *type, string_view name, Expr *init, ScopeID const *scope) noexcept | |
std::ostream & | print (std::ostream &os, int indentation=0) const override |
int | printDotNode (DotPrinter &dp) const override |
virtual bool | hasCanonicalName () const override |
Returns if the declaration has a canonical name. | |
![]() | |
TypedDecl (BumpAllocator &alloc, SourceRange location, Type *type, string_view name, Expr *init, ScopeID const *scope) noexcept | |
Type const * | type () const |
Type * | mut_type () const |
utils::Generator< ast::AstNode const * > | children () const override final |
Returns a generator for the children of this node. | |
bool | hasInit () const |
Expr const * | init () const |
Expr * | mut_init () |
SourceRange | location () const override |
Returns the location of the declaration. This is an abstract method to allow abstract classes of Decl without location. | |
ScopeID const * | scope () const |
![]() | |
Decl (BumpAllocator &alloc, std::string_view name) noexcept | |
std::string_view | name () const |
Gets the simple name of this declaration. | |
DeclContext * | parent () const |
Gets the context in which this declaration is declared. | |
virtual void | setParent (DeclContext *parent) |
Sets the parent. See parent(). | |
std::string_view | getCanonicalName () const |
Gets the fully qualified name of this declaration. Returns undefined value if the declaration does not have a canonical name. | |
virtual DeclContext const * | asDeclContext () const |
![]() | |
AstNode (const AstNode &)=delete | |
AstNode (AstNode &&)=delete | |
AstNode & | operator= (const AstNode &)=delete |
AstNode & | operator= (AstNode &&)=delete |
std::ostream & | printDot (std::ostream &os) const |
void | dump () const |
utils::Generator< AstNode * > | mut_children () |
Returns a generator for the mutable children of this node. | |
Additional Inherited Members | |
![]() | |
static std::string | indent (int indentation) |
Get a string of spaces for indentation. More... | |
![]() | |
std::pmr::string | canonicalName_ |