mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* all except pol * pol and includes under defines * something weird has happened * remove own folder from include searchpath * fixed remaining, adapted include style for external headers * missing include
54 lines
1.5 KiB
C++
54 lines
1.5 KiB
C++
#include "bscript/compiler/model/CompilerWorkspace.h"
|
|
|
|
#include "bscript/compiler/analyzer/Constants.h"
|
|
#include "bscript/compiler/ast/ClassDeclaration.h"
|
|
#include "bscript/compiler/ast/ConstDeclaration.h"
|
|
#include "bscript/compiler/ast/ModuleFunctionDeclaration.h"
|
|
#include "bscript/compiler/ast/Program.h"
|
|
#include "bscript/compiler/ast/TopLevelStatements.h"
|
|
#include "bscript/compiler/ast/UserFunction.h"
|
|
#include "bscript/compiler/file/SourceFileIdentifier.h"
|
|
#include "bscript/compiler/model/FlowControlLabel.h"
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
CompilerWorkspace::CompilerWorkspace( Report& report ) : constants( report ) {}
|
|
|
|
CompilerWorkspace::~CompilerWorkspace() = default;
|
|
|
|
/*
|
|
* This method is the main argument for making this class into an ast/Node.
|
|
* However, it has only one caller: the Optimizer.
|
|
* Other classes visit parts of the tree or do things in between visiting parts.
|
|
*/
|
|
void CompilerWorkspace::accept( NodeVisitor& visitor )
|
|
{
|
|
for ( auto& constant : const_declarations )
|
|
{
|
|
constant->accept( visitor );
|
|
}
|
|
|
|
for ( auto& module_function : module_function_declarations )
|
|
{
|
|
module_function->accept( visitor );
|
|
}
|
|
|
|
top_level_statements->accept( visitor );
|
|
|
|
if ( program )
|
|
{
|
|
program->accept( visitor );
|
|
}
|
|
|
|
for ( auto& user_function : user_functions )
|
|
{
|
|
user_function->accept( visitor );
|
|
}
|
|
|
|
for ( auto& class_decl : class_declarations )
|
|
{
|
|
class_decl->accept( visitor );
|
|
}
|
|
}
|
|
|
|
} // namespace Pol::Bscript::Compiler
|