Joos1W Compiler Framework
All Classes Functions Typedefs Pages
ast::Decl Class Referenceabstract

Base class for all declarations. More...

#include <AstNode.h>

Inheritance diagram for ast::Decl:

Public Member Functions

 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 bool hasCanonicalName () const =0
 Returns if the declaration has a canonical name.
 
virtual SourceRange location () const =0
 Returns the location of the declaration. This is an abstract method to allow abstract classes of Decl without location.
 
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
 
virtual std::ostream & print (std::ostream &os, int indentation=0) const =0
 
virtual int printDotNode (DotPrinter &dp) const =0
 
void dump () const
 
virtual utils::Generator< AstNode const * > children () const =0
 Returns a generator for the children of this node.
 
utils::Generator< AstNode * > mut_children ()
 Returns a generator for the mutable children of this node.
 

Protected Attributes

std::pmr::string canonicalName_
 

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...
 

Detailed Description

Base class for all declarations.

Definition at line 87 of file AstNode.h.


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