#include <yaramod/yaramod.h>

#include "py_visitor.h"

namespace py = pybind11;
using namespace yaramod;

void addVisitorClasses(py::module& module)
{
	py::class_<Visitor, PyVisitor>(module, "Visitor")
		.def(py::init<>())
		.def("visit_StringExpression", py::overload_cast<StringExpression*>(&Visitor::visit))
		.def("visit_StringWildcardExpression", py::overload_cast<StringWildcardExpression*>(&Visitor::visit))
		.def("visit_StringAtExpression", py::overload_cast<StringAtExpression*>(&Visitor::visit))
		.def("visit_StringInRangeExpression", py::overload_cast<StringInRangeExpression*>(&Visitor::visit))
		.def("visit_StringCountExpression", py::overload_cast<StringCountExpression*>(&Visitor::visit))
		.def("visit_StringOffsetExpression", py::overload_cast<StringOffsetExpression*>(&Visitor::visit))
		.def("visit_StringLengthExpression", py::overload_cast<StringLengthExpression*>(&Visitor::visit))
		.def("visit_NotExpression", py::overload_cast<NotExpression*>(&Visitor::visit))
		.def("visit_UnaryMinusExpression", py::overload_cast<UnaryMinusExpression*>(&Visitor::visit))
		.def("visit_BitwiseNotExpression", py::overload_cast<BitwiseNotExpression*>(&Visitor::visit))
		.def("visit_AndExpression", py::overload_cast<AndExpression*>(&Visitor::visit))
		.def("visit_OrExpression", py::overload_cast<OrExpression*>(&Visitor::visit))
		.def("visit_LtExpression", py::overload_cast<LtExpression*>(&Visitor::visit))
		.def("visit_GtExpression", py::overload_cast<GtExpression*>(&Visitor::visit))
		.def("visit_LeExpression", py::overload_cast<LeExpression*>(&Visitor::visit))
		.def("visit_GeExpression", py::overload_cast<GeExpression*>(&Visitor::visit))
		.def("visit_EqExpression", py::overload_cast<EqExpression*>(&Visitor::visit))
		.def("visit_NeqExpression", py::overload_cast<NeqExpression*>(&Visitor::visit))
		.def("visit_ContainsExpression", py::overload_cast<ContainsExpression*>(&Visitor::visit))
		.def("visit_MatchesExpression", py::overload_cast<MatchesExpression*>(&Visitor::visit))
		.def("visit_PlusExpression", py::overload_cast<PlusExpression*>(&Visitor::visit))
		.def("visit_MinusExpression", py::overload_cast<MinusExpression*>(&Visitor::visit))
		.def("visit_MultiplyExpression", py::overload_cast<MultiplyExpression*>(&Visitor::visit))
		.def("visit_DivideExpression", py::overload_cast<DivideExpression*>(&Visitor::visit))
		.def("visit_ModuloExpression", py::overload_cast<ModuloExpression*>(&Visitor::visit))
		.def("visit_BitwiseXorExpression", py::overload_cast<BitwiseXorExpression*>(&Visitor::visit))
		.def("visit_BitwiseAndExpression", py::overload_cast<BitwiseAndExpression*>(&Visitor::visit))
		.def("visit_BitwiseOrExpression", py::overload_cast<BitwiseOrExpression*>(&Visitor::visit))
		.def("visit_ShiftLeftExpression", py::overload_cast<ShiftLeftExpression*>(&Visitor::visit))
		.def("visit_ShiftRightExpression", py::overload_cast<ShiftRightExpression*>(&Visitor::visit))
		.def("visit_ForIntExpression", py::overload_cast<ForIntExpression*>(&Visitor::visit))
		.def("visit_ForStringExpression", py::overload_cast<ForStringExpression*>(&Visitor::visit))
		.def("visit_OfExpression", py::overload_cast<OfExpression*>(&Visitor::visit))
		.def("visit_SetExpression", py::overload_cast<SetExpression*>(&Visitor::visit))
		.def("visit_RangeExpression", py::overload_cast<RangeExpression*>(&Visitor::visit))
		.def("visit_IdExpression", py::overload_cast<IdExpression*>(&Visitor::visit))
		.def("visit_StructAccessExpression", py::overload_cast<StructAccessExpression*>(&Visitor::visit))
		.def("visit_ArrayAccessExpression", py::overload_cast<ArrayAccessExpression*>(&Visitor::visit))
		.def("visit_FunctionCallExpression", py::overload_cast<FunctionCallExpression*>(&Visitor::visit))
		.def("visit_BoolLiteralExpression", py::overload_cast<BoolLiteralExpression*>(&Visitor::visit))
		.def("visit_StringLiteralExpression", py::overload_cast<StringLiteralExpression*>(&Visitor::visit))
		.def("visit_IntLiteralExpression", py::overload_cast<IntLiteralExpression*>(&Visitor::visit))
		.def("visit_DoubleLiteralExpression", py::overload_cast<DoubleLiteralExpression*>(&Visitor::visit))
		.def("visit_FilesizeExpression", py::overload_cast<FilesizeExpression*>(&Visitor::visit))
		.def("visit_EntrypointExpression", py::overload_cast<EntrypointExpression*>(&Visitor::visit))
		.def("visit_AllExpression", py::overload_cast<AllExpression*>(&Visitor::visit))
		.def("visit_AnyExpression", py::overload_cast<AnyExpression*>(&Visitor::visit))
		.def("visit_ThemExpression", py::overload_cast<ThemExpression*>(&Visitor::visit))
		.def("visit_ParenthesesExpression", py::overload_cast<ParenthesesExpression*>(&Visitor::visit))
		.def("visit_IntFunctionExpression", py::overload_cast<IntFunctionExpression*>(&Visitor::visit))
		.def("visit_RegexpExpression", py::overload_cast<RegexpExpression*>(&Visitor::visit));

	py::class_<DeepVisitor, PyDeepVisitor, Visitor>(module, "DeepVisitor")
		.def(py::init<>())
		.def("visit_StringExpression", py::overload_cast<StringExpression*>(&DeepVisitor::visit))
		.def("visit_StringWildcardExpression", py::overload_cast<StringWildcardExpression*>(&DeepVisitor::visit))
		.def("visit_StringAtExpression", py::overload_cast<StringAtExpression*>(&DeepVisitor::visit))
		.def("visit_StringInRangeExpression", py::overload_cast<StringInRangeExpression*>(&DeepVisitor::visit))
		.def("visit_StringCountExpression", py::overload_cast<StringCountExpression*>(&DeepVisitor::visit))
		.def("visit_StringOffsetExpression", py::overload_cast<StringOffsetExpression*>(&DeepVisitor::visit))
		.def("visit_StringLengthExpression", py::overload_cast<StringLengthExpression*>(&DeepVisitor::visit))
		.def("visit_NotExpression", py::overload_cast<NotExpression*>(&DeepVisitor::visit))
		.def("visit_UnaryMinusExpression", py::overload_cast<UnaryMinusExpression*>(&DeepVisitor::visit))
		.def("visit_BitwiseNotExpression", py::overload_cast<BitwiseNotExpression*>(&DeepVisitor::visit))
		.def("visit_AndExpression", py::overload_cast<AndExpression*>(&DeepVisitor::visit))
		.def("visit_OrExpression", py::overload_cast<OrExpression*>(&DeepVisitor::visit))
		.def("visit_LtExpression", py::overload_cast<LtExpression*>(&DeepVisitor::visit))
		.def("visit_GtExpression", py::overload_cast<GtExpression*>(&DeepVisitor::visit))
		.def("visit_LeExpression", py::overload_cast<LeExpression*>(&DeepVisitor::visit))
		.def("visit_GeExpression", py::overload_cast<GeExpression*>(&DeepVisitor::visit))
		.def("visit_EqExpression", py::overload_cast<EqExpression*>(&DeepVisitor::visit))
		.def("visit_NeqExpression", py::overload_cast<NeqExpression*>(&DeepVisitor::visit))
		.def("visit_ContainsExpression", py::overload_cast<ContainsExpression*>(&DeepVisitor::visit))
		.def("visit_MatchesExpression", py::overload_cast<MatchesExpression*>(&DeepVisitor::visit))
		.def("visit_PlusExpression", py::overload_cast<PlusExpression*>(&DeepVisitor::visit))
		.def("visit_MinusExpression", py::overload_cast<MinusExpression*>(&DeepVisitor::visit))
		.def("visit_MultiplyExpression", py::overload_cast<MultiplyExpression*>(&DeepVisitor::visit))
		.def("visit_DivideExpression", py::overload_cast<DivideExpression*>(&DeepVisitor::visit))
		.def("visit_ModuloExpression", py::overload_cast<ModuloExpression*>(&DeepVisitor::visit))
		.def("visit_BitwiseXorExpression", py::overload_cast<BitwiseXorExpression*>(&DeepVisitor::visit))
		.def("visit_BitwiseAndExpression", py::overload_cast<BitwiseAndExpression*>(&DeepVisitor::visit))
		.def("visit_BitwiseOrExpression", py::overload_cast<BitwiseOrExpression*>(&DeepVisitor::visit))
		.def("visit_ShiftLeftExpression", py::overload_cast<ShiftLeftExpression*>(&DeepVisitor::visit))
		.def("visit_ShiftRightExpression", py::overload_cast<ShiftRightExpression*>(&DeepVisitor::visit))
		.def("visit_ForIntExpression", py::overload_cast<ForIntExpression*>(&DeepVisitor::visit))
		.def("visit_ForStringExpression", py::overload_cast<ForStringExpression*>(&DeepVisitor::visit))
		.def("visit_OfExpression", py::overload_cast<OfExpression*>(&DeepVisitor::visit))
		.def("visit_SetExpression", py::overload_cast<SetExpression*>(&DeepVisitor::visit))
		.def("visit_RangeExpression", py::overload_cast<RangeExpression*>(&DeepVisitor::visit))
		.def("visit_IdExpression", py::overload_cast<IdExpression*>(&DeepVisitor::visit))
		.def("visit_StructAccessExpression", py::overload_cast<StructAccessExpression*>(&DeepVisitor::visit))
		.def("visit_ArrayAccessExpression", py::overload_cast<ArrayAccessExpression*>(&DeepVisitor::visit))
		.def("visit_FunctionCallExpression", py::overload_cast<FunctionCallExpression*>(&DeepVisitor::visit))
		.def("visit_BoolLiteralExpression", py::overload_cast<BoolLiteralExpression*>(&DeepVisitor::visit))
		.def("visit_StringLiteralExpression", py::overload_cast<StringLiteralExpression*>(&DeepVisitor::visit))
		.def("visit_IntLiteralExpression", py::overload_cast<IntLiteralExpression*>(&DeepVisitor::visit))
		.def("visit_DoubleLiteralExpression", py::overload_cast<DoubleLiteralExpression*>(&DeepVisitor::visit))
		.def("visit_FilesizeExpression", py::overload_cast<FilesizeExpression*>(&DeepVisitor::visit))
		.def("visit_EntrypointExpression", py::overload_cast<EntrypointExpression*>(&DeepVisitor::visit))
		.def("visit_AllExpression", py::overload_cast<AllExpression*>(&DeepVisitor::visit))
		.def("visit_AnyExpression", py::overload_cast<AnyExpression*>(&DeepVisitor::visit))
		.def("visit_ThemExpression", py::overload_cast<ThemExpression*>(&DeepVisitor::visit))
		.def("visit_ParenthesesExpression", py::overload_cast<ParenthesesExpression*>(&DeepVisitor::visit))
		.def("visit_IntFunctionExpression", py::overload_cast<IntFunctionExpression*>(&DeepVisitor::visit))
		.def("visit_RegexpExpression", py::overload_cast<RegexpExpression*>(&DeepVisitor::visit));

	py::class_<PassiveVisitor, PyPassiveVisitor, Visitor>(module, "PassiveVisitor")
		.def(py::init<>())
		.def("visit_StringExpression", py::overload_cast<StringExpression*>(&PassiveVisitor::visit))
		.def("visit_StringWildcardExpression", py::overload_cast<StringWildcardExpression*>(&PassiveVisitor::visit))
		.def("visit_StringAtExpression", py::overload_cast<StringAtExpression*>(&PassiveVisitor::visit))
		.def("visit_StringInRangeExpression", py::overload_cast<StringInRangeExpression*>(&PassiveVisitor::visit))
		.def("visit_StringCountExpression", py::overload_cast<StringCountExpression*>(&PassiveVisitor::visit))
		.def("visit_StringOffsetExpression", py::overload_cast<StringOffsetExpression*>(&PassiveVisitor::visit))
		.def("visit_StringLengthExpression", py::overload_cast<StringLengthExpression*>(&PassiveVisitor::visit))
		.def("visit_NotExpression", py::overload_cast<NotExpression*>(&PassiveVisitor::visit))
		.def("visit_UnaryMinusExpression", py::overload_cast<UnaryMinusExpression*>(&PassiveVisitor::visit))
		.def("visit_BitwiseNotExpression", py::overload_cast<BitwiseNotExpression*>(&PassiveVisitor::visit))
		.def("visit_AndExpression", py::overload_cast<AndExpression*>(&PassiveVisitor::visit))
		.def("visit_OrExpression", py::overload_cast<OrExpression*>(&PassiveVisitor::visit))
		.def("visit_LtExpression", py::overload_cast<LtExpression*>(&PassiveVisitor::visit))
		.def("visit_GtExpression", py::overload_cast<GtExpression*>(&PassiveVisitor::visit))
		.def("visit_LeExpression", py::overload_cast<LeExpression*>(&PassiveVisitor::visit))
		.def("visit_GeExpression", py::overload_cast<GeExpression*>(&PassiveVisitor::visit))
		.def("visit_EqExpression", py::overload_cast<EqExpression*>(&PassiveVisitor::visit))
		.def("visit_NeqExpression", py::overload_cast<NeqExpression*>(&PassiveVisitor::visit))
		.def("visit_ContainsExpression", py::overload_cast<ContainsExpression*>(&PassiveVisitor::visit))
		.def("visit_MatchesExpression", py::overload_cast<MatchesExpression*>(&PassiveVisitor::visit))
		.def("visit_PlusExpression", py::overload_cast<PlusExpression*>(&PassiveVisitor::visit))
		.def("visit_MinusExpression", py::overload_cast<MinusExpression*>(&PassiveVisitor::visit))
		.def("visit_MultiplyExpression", py::overload_cast<MultiplyExpression*>(&PassiveVisitor::visit))
		.def("visit_DivideExpression", py::overload_cast<DivideExpression*>(&PassiveVisitor::visit))
		.def("visit_ModuloExpression", py::overload_cast<ModuloExpression*>(&PassiveVisitor::visit))
		.def("visit_BitwiseXorExpression", py::overload_cast<BitwiseXorExpression*>(&PassiveVisitor::visit))
		.def("visit_BitwiseAndExpression", py::overload_cast<BitwiseAndExpression*>(&PassiveVisitor::visit))
		.def("visit_BitwiseOrExpression", py::overload_cast<BitwiseOrExpression*>(&PassiveVisitor::visit))
		.def("visit_ShiftLeftExpression", py::overload_cast<ShiftLeftExpression*>(&PassiveVisitor::visit))
		.def("visit_ShiftRightExpression", py::overload_cast<ShiftRightExpression*>(&PassiveVisitor::visit))
		.def("visit_ForIntExpression", py::overload_cast<ForIntExpression*>(&PassiveVisitor::visit))
		.def("visit_ForStringExpression", py::overload_cast<ForStringExpression*>(&PassiveVisitor::visit))
		.def("visit_OfExpression", py::overload_cast<OfExpression*>(&PassiveVisitor::visit))
		.def("visit_SetExpression", py::overload_cast<SetExpression*>(&PassiveVisitor::visit))
		.def("visit_RangeExpression", py::overload_cast<RangeExpression*>(&PassiveVisitor::visit))
		.def("visit_IdExpression", py::overload_cast<IdExpression*>(&PassiveVisitor::visit))
		.def("visit_StructAccessExpression", py::overload_cast<StructAccessExpression*>(&PassiveVisitor::visit))
		.def("visit_ArrayAccessExpression", py::overload_cast<ArrayAccessExpression*>(&PassiveVisitor::visit))
		.def("visit_FunctionCallExpression", py::overload_cast<FunctionCallExpression*>(&PassiveVisitor::visit))
		.def("visit_BoolLiteralExpression", py::overload_cast<BoolLiteralExpression*>(&PassiveVisitor::visit))
		.def("visit_StringLiteralExpression", py::overload_cast<StringLiteralExpression*>(&PassiveVisitor::visit))
		.def("visit_IntLiteralExpression", py::overload_cast<IntLiteralExpression*>(&PassiveVisitor::visit))
		.def("visit_DoubleLiteralExpression", py::overload_cast<DoubleLiteralExpression*>(&PassiveVisitor::visit))
		.def("visit_FilesizeExpression", py::overload_cast<FilesizeExpression*>(&PassiveVisitor::visit))
		.def("visit_EntrypointExpression", py::overload_cast<EntrypointExpression*>(&PassiveVisitor::visit))
		.def("visit_AllExpression", py::overload_cast<AllExpression*>(&PassiveVisitor::visit))
		.def("visit_AnyExpression", py::overload_cast<AnyExpression*>(&PassiveVisitor::visit))
		.def("visit_ThemExpression", py::overload_cast<ThemExpression*>(&PassiveVisitor::visit))
		.def("visit_ParenthesesExpression", py::overload_cast<ParenthesesExpression*>(&PassiveVisitor::visit))
		.def("visit_IntFunctionExpression", py::overload_cast<IntFunctionExpression*>(&PassiveVisitor::visit))
		.def("visit_RegexpExpression", py::overload_cast<RegexpExpression*>(&PassiveVisitor::visit));
}
