#pragma once #include "Utility.hpp" #include #include #include #include #include #include const int MAX_ITER = 256; struct LoopInfo { int idx; int iter; }; typedef unsigned int uint; typedef std::unordered_map lp_track; typedef std::unordered_map locals; typedef std::map> varmap; struct FunctionInfo { std::smatch match; uint addr = 0; std::string nm = ""; std::string usg = ""; varmap in{}; int in_cnt = 0; varmap out{}; int out_cnt = 0; std::vector prs_msg; bool prs_vld = false; void chk_vld(); void cln_varmap(bool prc_in); bool nil_in_varmap(bool prc_in) const; bool prc_varmap_rgx(bool prc_in, const std::string& ln_in, std::regex& rgx, locals& lcls); std::string str() const; std::string str_varmap(bool prc_in) const; FunctionInfo(); FunctionInfo(std::vector src); }; std::optional eval(std::string& infix, locals& lcls);