Joos1W Compiler Framework
All Classes Functions Typedefs Pages
ast::VarDecl Class Reference

Represents a scoped (i.e., local) typed variable declaration. More...

#include <Decl.h>

Inheritance diagram for ast::VarDecl:

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.
 
- Public Member Functions inherited from ast::TypedDecl
 TypedDecl (BumpAllocator &alloc, SourceRange location, Type *type, string_view name, Expr *init, ScopeID const *scope) noexcept
 
Type const * type () const
 
Typemut_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
 
Exprmut_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
 
- Public Member Functions inherited from ast::Decl
 Decl (BumpAllocator &alloc, std::string_view name) noexcept
 
std::string_view name () const
 Gets the simple name of this declaration.
 
DeclContextparent () 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
 
- Public Member Functions inherited from ast::AstNode
 AstNode (const AstNode &)=delete
 
 AstNode (AstNode &&)=delete
 
AstNodeoperator= (const AstNode &)=delete
 
AstNodeoperator= (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 Protected Member Functions inherited from ast::AstNode
static std::string indent (int indentation)
 Get a string of spaces for indentation. More...
 
- Protected Attributes inherited from ast::Decl
std::pmr::string canonicalName_
 

Detailed Description

Represents a scoped (i.e., local) typed variable declaration.

Definition at line 43 of file Decl.h.


The documentation for this class was generated from the following files: