mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
32 lines
738 B
C
32 lines
738 B
C
|
|
#ifndef POLSERVER_BINARYOPERATORWITHBOOLEANOPTIMIZER_H
|
||
|
|
#define POLSERVER_BINARYOPERATORWITHBOOLEANOPTIMIZER_H
|
||
|
|
|
||
|
|
#include "bscript/compiler/ast/NodeVisitor.h"
|
||
|
|
|
||
|
|
#include <memory>
|
||
|
|
|
||
|
|
namespace Pol::Bscript::Compiler
|
||
|
|
{
|
||
|
|
class Expression;
|
||
|
|
class Report;
|
||
|
|
|
||
|
|
class BinaryOperatorWithBooleanOptimizer : public NodeVisitor
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
const BooleanValue& lhs;
|
||
|
|
const BinaryOperator& op;
|
||
|
|
Report& report;
|
||
|
|
|
||
|
|
std::unique_ptr<Expression> optimized_result;
|
||
|
|
|
||
|
|
BinaryOperatorWithBooleanOptimizer( BooleanValue& lhs, BinaryOperator& op, Report& );
|
||
|
|
|
||
|
|
void visit_children( Node& parent ) override;
|
||
|
|
void visit_boolean_value( BooleanValue& rhs ) override;
|
||
|
|
};
|
||
|
|
|
||
|
|
} // namespace Pol::Bscript::Compiler
|
||
|
|
|
||
|
|
|
||
|
|
#endif // POLSERVER_BINARYOPERATORWITHBOOLEANOPTIMIZER_H
|