OpenClonk
aul::DefaultRecursiveVisitor Class Reference

#include <C4AulAST.h>

Inheritance diagram for aul::DefaultRecursiveVisitor:
[legend]
Collaboration diagram for aul::DefaultRecursiveVisitor:
[legend]

Public Member Functions

 ~DefaultRecursiveVisitor () override=default
 
void visit (const ::aul::ast::ArrayLit *n) override
 
void visit (const ::aul::ast::ProplistLit *n) override
 
void visit (const ::aul::ast::UnOpExpr *n) override
 
void visit (const ::aul::ast::BinOpExpr *n) override
 
void visit (const ::aul::ast::AssignmentExpr *n) override
 
void visit (const ::aul::ast::SubscriptExpr *n) override
 
void visit (const ::aul::ast::SliceExpr *n) override
 
void visit (const ::aul::ast::CallExpr *n) override
 
void visit (const ::aul::ast::ParExpr *n) override
 
void visit (const ::aul::ast::Block *n) override
 
void visit (const ::aul::ast::Return *n) override
 
void visit (const ::aul::ast::ForLoop *n) override
 
void visit (const ::aul::ast::RangeLoop *n) override
 
void visit (const ::aul::ast::DoLoop *n) override
 
void visit (const ::aul::ast::WhileLoop *n) override
 
void visit (const ::aul::ast::If *n) override
 
void visit (const ::aul::ast::VarDecl *n) override
 
void visit (const ::aul::ast::FunctionDecl *n) override
 
void visit (const ::aul::ast::FunctionExpr *n) override
 
void visit (const ::aul::ast::Script *n) override
 
virtual void visit (const ::aul::ast::Noop *)
 
virtual void visit (const ::aul::ast::StringLit *)
 
virtual void visit (const ::aul::ast::IntLit *)
 
virtual void visit (const ::aul::ast::BoolLit *)
 
virtual void visit (const ::aul::ast::NilLit *)
 
virtual void visit (const ::aul::ast::ThisLit *)
 
virtual void visit (const ::aul::ast::VarExpr *n)
 
virtual void visit (const ::aul::ast::Break *)
 
virtual void visit (const ::aul::ast::Continue *)
 
virtual void visit (const ::aul::ast::IncludePragma *)
 
virtual void visit (const ::aul::ast::AppendtoPragma *)
 
template<class T >
void visit (const T *)=delete
 

Detailed Description

Definition at line 434 of file C4AulAST.h.

Constructor & Destructor Documentation

◆ ~DefaultRecursiveVisitor()

aul::DefaultRecursiveVisitor::~DefaultRecursiveVisitor ( )
overridedefault

Member Function Documentation

◆ visit() [1/32]

virtual void aul::AstVisitor::visit ( const ::aul::ast::Noop )
inlinevirtualinherited

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 63 of file C4AulAST.h.

63 {}

◆ visit() [2/32]

virtual void aul::AstVisitor::visit ( const ::aul::ast::StringLit )
inlinevirtualinherited

Reimplemented in C4AulCompiler::ConstexprEvaluator, and C4AulCompiler::CodegenAstVisitor.

Definition at line 64 of file C4AulAST.h.

64 {}

◆ visit() [3/32]

virtual void aul::AstVisitor::visit ( const ::aul::ast::IntLit )
inlinevirtualinherited

Reimplemented in C4AulCompiler::ConstexprEvaluator, and C4AulCompiler::CodegenAstVisitor.

Definition at line 65 of file C4AulAST.h.

65 {}

◆ visit() [4/32]

virtual void aul::AstVisitor::visit ( const ::aul::ast::BoolLit )
inlinevirtualinherited

Reimplemented in C4AulCompiler::ConstexprEvaluator, and C4AulCompiler::CodegenAstVisitor.

Definition at line 66 of file C4AulAST.h.

66 {}

◆ visit() [5/32]

virtual void aul::AstVisitor::visit ( const ::aul::ast::NilLit )
inlinevirtualinherited

Reimplemented in C4AulCompiler::ConstexprEvaluator, and C4AulCompiler::CodegenAstVisitor.

Definition at line 69 of file C4AulAST.h.

69 {}

◆ visit() [6/32]

virtual void aul::AstVisitor::visit ( const ::aul::ast::ThisLit )
inlinevirtualinherited

Reimplemented in C4AulCompiler::ConstexprEvaluator, and C4AulCompiler::CodegenAstVisitor.

Definition at line 70 of file C4AulAST.h.

70 {}

◆ visit() [7/32]

virtual void aul::AstVisitor::visit ( const ::aul::ast::VarExpr n)
inlinevirtualinherited

Reimplemented in C4AulCompiler::ConstexprEvaluator, and C4AulCompiler::CodegenAstVisitor.

Definition at line 71 of file C4AulAST.h.

71 {}

◆ visit() [8/32]

virtual void aul::AstVisitor::visit ( const ::aul::ast::Break )
inlinevirtualinherited

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 85 of file C4AulAST.h.

85 {}

◆ visit() [9/32]

virtual void aul::AstVisitor::visit ( const ::aul::ast::Continue )
inlinevirtualinherited

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 86 of file C4AulAST.h.

86 {}

◆ visit() [10/32]

virtual void aul::AstVisitor::visit ( const ::aul::ast::IncludePragma )
inlinevirtualinherited

Reimplemented in C4AulCompiler::PreparseAstVisitor.

Definition at line 91 of file C4AulAST.h.

91 {}

◆ visit() [11/32]

virtual void aul::AstVisitor::visit ( const ::aul::ast::AppendtoPragma )
inlinevirtualinherited

Reimplemented in C4AulCompiler::PreparseAstVisitor.

Definition at line 92 of file C4AulAST.h.

92 {}

◆ visit() [12/32]

template<class T >
void aul::AstVisitor::visit ( const T *  )
deleteinherited

◆ visit() [13/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::ArrayLit n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 441 of file C4AulAST.h.

442  {
443  for (const auto &c : n->values)
444  c->accept(this);
445  }
std::vector< ExprPtr > values
Definition: C4AulAST.h:180

◆ visit() [14/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::ProplistLit n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 446 of file C4AulAST.h.

447  {
448  for (const auto &c : n->values)
449  c.second->accept(this);
450  }
std::vector< std::pair< std::string, ExprPtr > > values
Definition: C4AulAST.h:187

◆ visit() [15/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::UnOpExpr n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 451 of file C4AulAST.h.

452  {
453  n->operand->accept(this);
454  }

◆ visit() [16/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::BinOpExpr n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 455 of file C4AulAST.h.

456  {
457  n->lhs->accept(this);
458  n->rhs->accept(this);
459  }

◆ visit() [17/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::AssignmentExpr n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 460 of file C4AulAST.h.

461  {
462  n->lhs->accept(this);
463  n->rhs->accept(this);
464  }

◆ visit() [18/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::SubscriptExpr n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 465 of file C4AulAST.h.

466  {
467  n->object->accept(this);
468  n->index->accept(this);
469  }

◆ visit() [19/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::SliceExpr n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 470 of file C4AulAST.h.

471  {
472  n->object->accept(this);
473  n->start->accept(this);
474  n->end->accept(this);
475  }

◆ visit() [20/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::CallExpr n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor, and C4AulCompiler::PreparseAstVisitor.

Definition at line 476 of file C4AulAST.h.

References a.

477  {
478  if (n->context)
479  n->context->accept(this);
480  for (const auto &a : n->args)
481  a->accept(this);
482  }
#define a
std::vector< ExprPtr > args
Definition: C4AulAST.h:257

◆ visit() [21/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::ParExpr n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor, and C4AulCompiler::PreparseAstVisitor.

Definition at line 483 of file C4AulAST.h.

484  {
485  n->arg->accept(this);
486  }

◆ visit() [22/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::Block n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 487 of file C4AulAST.h.

References s.

488  {
489  for (const auto &s : n->children)
490  s->accept(this);
491  }
std::vector< StmtPtr > children
Definition: C4AulAST.h:273
#define s

◆ visit() [23/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::Return n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 492 of file C4AulAST.h.

493  {
494  n->value->accept(this);
495  }
ExprPtr value
Definition: C4AulAST.h:284

◆ visit() [24/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::ForLoop n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 496 of file C4AulAST.h.

497  {
498  if (n->init)
499  n->init->accept(this);
500  if (n->cond)
501  n->cond->accept(this);
502  if (n->incr)
503  n->incr->accept(this);
504  n->body->accept(this);
505  }
StmtPtr body
Definition: C4AulAST.h:291
ExprPtr cond
Definition: C4AulAST.h:290

◆ visit() [25/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::RangeLoop n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor, and C4AulCompiler::PreparseAstVisitor.

Definition at line 506 of file C4AulAST.h.

507  {
508  n->cond->accept(this);
509  n->body->accept(this);
510  }
StmtPtr body
Definition: C4AulAST.h:291
ExprPtr cond
Definition: C4AulAST.h:290

◆ visit() [26/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::DoLoop n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 511 of file C4AulAST.h.

512  {
513  n->body->accept(this);
514  n->cond->accept(this);
515  }
StmtPtr body
Definition: C4AulAST.h:291
ExprPtr cond
Definition: C4AulAST.h:290

◆ visit() [27/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::WhileLoop n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 516 of file C4AulAST.h.

517  {
518  n->cond->accept(this);
519  n->body->accept(this);
520  }
StmtPtr body
Definition: C4AulAST.h:291
ExprPtr cond
Definition: C4AulAST.h:290

◆ visit() [28/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::If n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 521 of file C4AulAST.h.

522  {
523  n->cond->accept(this);
524  n->iftrue->accept(this);
525  if (n->iffalse)
526  n->iffalse->accept(this);
527  }
ExprPtr cond
Definition: C4AulAST.h:338
StmtPtr iftrue
Definition: C4AulAST.h:339
StmtPtr iffalse
Definition: C4AulAST.h:339

◆ visit() [29/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::VarDecl n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::ConstantResolver, C4AulCompiler::CodegenAstVisitor, and C4AulCompiler::PreparseAstVisitor.

Definition at line 528 of file C4AulAST.h.

529  {
530  for (const auto &d : n->decls)
531  if (d.init)
532  d.init->accept(this);
533  }
std::vector< Var > decls
Definition: C4AulAST.h:365

◆ visit() [30/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::FunctionDecl n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor, and C4AulCompiler::PreparseAstVisitor.

Definition at line 534 of file C4AulAST.h.

535  {
536  n->body->accept(this);
537  }
std::unique_ptr< Block > body
Definition: C4AulAST.h:379

◆ visit() [31/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::FunctionExpr n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::CodegenAstVisitor.

Definition at line 538 of file C4AulAST.h.

539  {
540  n->body->accept(this);
541  }
std::unique_ptr< Block > body
Definition: C4AulAST.h:379

◆ visit() [32/32]

void aul::DefaultRecursiveVisitor::visit ( const ::aul::ast::Script n)
inlineoverridevirtual

Reimplemented from aul::AstVisitor.

Reimplemented in C4AulCompiler::ConstantResolver, C4AulCompiler::CodegenAstVisitor, and C4AulCompiler::PreparseAstVisitor.

Definition at line 542 of file C4AulAST.h.

543  {
544  for (const auto &d : n->declarations)
545  d->accept(this);
546  }
std::vector< DeclPtr > declarations
Definition: C4AulAST.h:425

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