mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
27 lines
563 B
C++
27 lines
563 B
C++
#ifndef POLSERVER_VALUECONSUMEROPTIMIZER_H
|
|
#define POLSERVER_VALUECONSUMEROPTIMIZER_H
|
|
|
|
#include <memory>
|
|
|
|
#include "bscript/compiler/ast/NodeVisitor.h"
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
class Statement;
|
|
|
|
class ValueConsumerOptimizer : public NodeVisitor
|
|
{
|
|
public:
|
|
std::unique_ptr<Statement> optimized_result;
|
|
|
|
void visit_children( Node& ) override;
|
|
|
|
void visit_binary_operator( BinaryOperator& ) override;
|
|
|
|
std::unique_ptr<Statement> optimize( ValueConsumer& );
|
|
};
|
|
|
|
} // namespace Pol::Bscript::Compiler
|
|
|
|
|
|
#endif // POLSERVER_VALUECONSUMEROPTIMIZER_H
|