Skip to content

Commit

Permalink
Remove Facility::Compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinEady committed Mar 2, 2021
1 parent 4221803 commit e4f3eca
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 55 deletions.
1 change: 0 additions & 1 deletion pol-core/bscript/CMakeSources.cmake
Expand Up @@ -314,7 +314,6 @@ set (bscript_sources # sorted !
executortype.h
expression.cpp
expression.h
facility/Compiler.h
filefmt.h
fmodule.cpp
fmodule.h
Expand Down
17 changes: 7 additions & 10 deletions pol-core/bscript/compiler.h
Expand Up @@ -15,8 +15,6 @@
#include "parser.h"
#endif

#include "facility/Compiler.h"

#include <iosfwd>
#include <map>
#include <stddef.h>
Expand Down Expand Up @@ -124,7 +122,7 @@ class Scope
friend class Compiler;
};

class Compiler final : public SmartParser, public Facility::Compiler
class Compiler final : public SmartParser
{
public:
static bool check_filecase_;
Expand Down Expand Up @@ -279,13 +277,12 @@ class Compiler final : public SmartParser, public Facility::Compiler
int write_dbg( const char* fname, bool generate_txtfile );
void writeIncludedFilenames( const char* fname ) const;

// Facility::Compiler
bool compile_file( const std::string& filename ) override;
bool write_ecl( const std::string& pathname ) override;
void write_listing( const std::string& pathname ) override;
void write_dbg( const std::string& pathname, bool include_debug_text ) override;
void write_included_filenames( const std::string& pathname ) override;
void set_include_compile_mode() override;
bool compile_file( const std::string& filename );
bool write_ecl( const std::string& pathname );
void write_listing( const std::string& pathname );
void write_dbg( const std::string& pathname, bool include_debug_text );
void write_included_filenames( const std::string& pathname );
void set_include_compile_mode();


Pol::Bscript::Compiler::LegacyFunctionOrder get_legacy_function_order() const;
Expand Down
19 changes: 9 additions & 10 deletions pol-core/bscript/compiler/Compiler.h
@@ -1,9 +1,8 @@
#ifndef POLSERVER_COMPILER_H
#define POLSERVER_COMPILER_H

#include "bscript/facility/Compiler.h"

#include <memory>
#include <string>

#include "bscript/compiler/model/UserFunctionInclusion.h"

Expand All @@ -16,20 +15,20 @@ class SourceFileCache;
class Profile;
class Report;

class Compiler : public Pol::Bscript::Facility::Compiler
class Compiler
{
public:
Compiler( SourceFileCache& em_cache, SourceFileCache& inc_cache, Profile& );
~Compiler() override;
~Compiler();
Compiler( const Compiler& ) = delete;
Compiler& operator=( const Compiler& ) = delete;

bool compile_file( const std::string& filename ) override;
bool write_ecl( const std::string& pathname ) override;
void write_listing( const std::string& pathname ) override;
void write_dbg( const std::string& pathname, bool include_debug_text ) override;
void write_included_filenames( const std::string& pathname ) override;
void set_include_compile_mode() override;
bool compile_file( const std::string& filename );
bool write_ecl( const std::string& pathname );
void write_listing( const std::string& pathname );
void write_dbg( const std::string& pathname, bool include_debug_text );
void write_included_filenames( const std::string& pathname );
void set_include_compile_mode();

bool compile_file( const std::string& filename, const LegacyFunctionOrder* );
void compile_file_steps( const std::string& pathname, const LegacyFunctionOrder*, Report& );
Expand Down
28 changes: 0 additions & 28 deletions pol-core/bscript/facility/Compiler.h

This file was deleted.

11 changes: 5 additions & 6 deletions pol-core/ecompile/ECompileMain.cpp
Expand Up @@ -17,7 +17,6 @@
#include "../bscript/escriptv.h"
#include "../bscript/executor.h"
#include "../bscript/executortype.h"
#include "../bscript/facility/Compiler.h"
#include "../bscript/filefmt.h"
#include "../bscript/parser.h"
#include "../clib/Program/ProgramConfig.h"
Expand Down Expand Up @@ -147,10 +146,10 @@ void generate_wordlist()
Parser::write_words( ofs );
}

std::unique_ptr<Facility::Compiler> create_compiler()
std::unique_ptr<Compiler::Compiler> create_compiler()
{
std::unique_ptr<Facility::Compiler> compiler = std::make_unique<Compiler::Compiler>(
em_parse_tree_cache, inc_parse_tree_cache, summary.profile );
auto compiler = std::make_unique<Compiler::Compiler>( em_parse_tree_cache, inc_parse_tree_cache,
summary.profile );
return compiler;
}

Expand All @@ -159,7 +158,7 @@ void compile_inc( const char* path )
if ( !quiet )
INFO_PRINT << "Compiling: " << path << "\n";

std::unique_ptr<Facility::Compiler> compiler = create_compiler();
std::unique_ptr<Compiler::Compiler> compiler = create_compiler();

compiler->set_include_compile_mode();
bool res = compiler->compile_file( path );
Expand Down Expand Up @@ -279,7 +278,7 @@ bool compile_file( const char* path )
if ( !quiet )
INFO_PRINT << "Compiling: " << path << "\n";

std::unique_ptr<Facility::Compiler> compiler = create_compiler();
std::unique_ptr<Compiler::Compiler> compiler = create_compiler();

bool success = compiler->compile_file( path );

Expand Down

0 comments on commit e4f3eca

Please sign in to comment.