polserver/pol-core/bscript/compiler/optimizer/BinaryOperatorWithBooleanOptimizer.h

32 lines
738 B
C
Raw Permalink Normal View History

#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