2020-09-02 00:27:09 -07:00
|
|
|
#ifndef POLSERVER_BINARYOPERATORWITHFLOATOPTIMIZER_H
|
|
|
|
|
#define POLSERVER_BINARYOPERATORWITHFLOATOPTIMIZER_H
|
|
|
|
|
|
2021-02-25 16:53:22 +01:00
|
|
|
#include "bscript/compiler/ast/NodeVisitor.h"
|
2020-09-02 00:27:09 -07:00
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
|
|
|
{
|
|
|
|
|
class Expression;
|
|
|
|
|
class Report;
|
|
|
|
|
|
|
|
|
|
class BinaryOperatorWithFloatOptimizer : public NodeVisitor
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
const FloatValue& lhs;
|
|
|
|
|
const BinaryOperator& op;
|
|
|
|
|
Report& report;
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<Expression> optimized_result;
|
|
|
|
|
|
|
|
|
|
BinaryOperatorWithFloatOptimizer( FloatValue& lhs, BinaryOperator& op, Report& );
|
|
|
|
|
|
|
|
|
|
void visit_children( Node& parent ) override;
|
|
|
|
|
void visit_float_value( FloatValue& rhs ) override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Pol::Bscript::Compiler
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // POLSERVER_BINARYOPERATORWITHFLOATOPTIMIZER_H
|