saqut-compiler/src/opt/optimization_pass.hpp

20 lines
508 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef SAQUT_OPT_PASS
#define SAQUT_OPT_PASS
#include <string>
#include "parser/ast_node.hpp"
#include "symbol/symbol_table.hpp"
class OptimizationPass {
public:
virtual ~OptimizationPass() = default;
// Pass'i çalıştırır. En az bir dönüşüm yaptıysa true döndürür.
// root: optimize edilecek klonlanmış AST kökü (sahiplik değişmez).
virtual bool run(ASTNode* root, SymbolTable* table) = 0;
virtual const std::string& name() const = 0;
};
#endif // SAQUT_OPT_PASS