polserver/pol-core/bscript/compiler/ast/NodeVisitor.cpp

90 lines
1.9 KiB
C++
Raw Permalink Normal View History

#include "NodeVisitor.h"
#include "compiler/ast/Argument.h"
2020-08-19 10:43:08 -07:00
#include "compiler/ast/FloatValue.h"
#include "compiler/ast/FunctionCall.h"
#include "compiler/ast/FunctionParameterDeclaration.h"
#include "compiler/ast/FunctionParameterList.h"
#include "compiler/ast/ModuleFunctionDeclaration.h"
2020-08-16 23:03:33 -07:00
#include "compiler/ast/Node.h"
#include "compiler/ast/StringValue.h"
#include "compiler/ast/TopLevelStatements.h"
#include "compiler/ast/UnaryOperator.h"
#include "compiler/ast/ValueConsumer.h"
#include "compiler/ast/VarStatement.h"
2020-08-16 23:03:33 -07:00
namespace Pol::Bscript::Compiler
{
void NodeVisitor::visit_argument( Argument& node )
{
visit_children( node );
}
2020-08-19 10:43:08 -07:00
void NodeVisitor::visit_float_value( FloatValue& node )
{
visit_children( node );
}
void NodeVisitor::visit_function_call( FunctionCall& node )
{
visit_children( node );
}
void NodeVisitor::visit_function_parameter_declaration( FunctionParameterDeclaration& node )
{
visit_children( node );
}
void NodeVisitor::visit_function_parameter_list( FunctionParameterList& node )
{
visit_children( node );
}
void NodeVisitor::visit_identifier( Identifier& )
{
}
2020-08-25 23:27:24 -07:00
void NodeVisitor::visit_integer_value( IntegerValue& )
{
}
void NodeVisitor::visit_module_function_declaration( ModuleFunctionDeclaration& node )
{
visit_children( node );
}
void NodeVisitor::visit_string_value( StringValue& node )
{
visit_children( node );
}
void NodeVisitor::visit_top_level_statements( TopLevelStatements& node )
{
visit_children( node );
}
void NodeVisitor::visit_unary_operator( UnaryOperator& node )
{
visit_children( node );
}
void NodeVisitor::visit_value_consumer( ValueConsumer& node )
{
visit_children( node );
}
void NodeVisitor::visit_var_statement( VarStatement& node )
{
visit_children( node );
}
2020-08-16 23:03:33 -07:00
void NodeVisitor::visit_children( Node& parent )
{
for ( const auto& child : parent.children )
{
child->accept( *this );
}
}
} // namespace Pol::Bscript::Compiler