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

Base class for all AST nodes. Helps unify printing and dot printing. More...

#include <AstNode.h>

Inheritance diagram for ast::AstNode:

Public Member Functions

 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.
 

Static Protected Member Functions

static std::string indent (int indentation)
 Get a string of spaces for indentation. More...
 

Friends

class Expr
 

Detailed Description

Base class for all AST nodes. Helps unify printing and dot printing.

Definition at line 39 of file AstNode.h.

Member Function Documentation

◆ indent()

static std::string ast::AstNode::indent ( int  indentation)
inlinestaticprotected

Get a string of spaces for indentation.

Parameters
indentationThe level of indentation
Returns
std::string String of spaces

Definition at line 77 of file AstNode.h.

77  {
78  return std::string(indentation * 2, ' ');
79  }

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