Bash++
Bash++ compiler internal documentation
Classes | Namespaces | Macros
BaseListener.h File Reference
#include <memory>
#include <type_traits>
#include <AST/ASTNode.h>
#include <AST/NodeTypes.h>
#include <AST/Nodes/Nodes.h>
#include <error/InternalError.h>
#include <error/SyntaxError.h>
Include dependency graph for BaseListener.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  AST::BaseListener< Derived >
 CRTP base class for AST listeners. CRTP is a kind of language hack that makes static polymorphism possible in C++. More...
 

Namespaces

namespace  AST
 

Macros

#define AST_LISTENER_NODE_LIST(X)
 
#define AST_CASE(Name)
 

Macro Definition Documentation

◆ AST_CASE

#define AST_CASE (   Name)
Value:
case AST::NodeType::Name: \
if constexpr (requires(Derived& d, std::shared_ptr<AST::Name> x) { d.enter##Name(x); }) { \
self().enter##Name(std::static_pointer_cast<AST::Name>(node)); \
} \
for (const auto& child : node->getChildren()) { \
walk(child); \
} \
if constexpr (requires(Derived& d, std::shared_ptr<AST::Name> x) { d.exit##Name(x); }) { \
self().exit##Name(std::static_pointer_cast<AST::Name>(node)); \
} \
break;

◆ AST_LISTENER_NODE_LIST

#define AST_LISTENER_NODE_LIST (   X)