#ifndef ETHSERP_PREPROCESSOR #define ETHSERP_PREPROCESSOR #include #include #include #include #include "util.h" #include "rewriteutils.h" // Storage variable index storing object struct svObj { std::map offsets; std::map indices; std::map > coefficients; std::map nonfinal; std::string globalOffset; }; // Preprocessing result storing object class preprocessAux { public: preprocessAux() { globalExterns = std::map(); localExterns = std::map >(); localExterns["self"] = std::map(); } std::map globalExterns; std::map globalExternSigs; std::map > localExterns; std::map > localExternSigs; std::map customMacros; std::map types; svObj storageVars; }; #define preprocessResult std::pair // Populate an svObj with the arguments needed to determine // the storage position of a node svObj getStorageVars(svObj pre, Node node, std::string prefix="", int index=0); // Preprocess a function (see cpp for details) preprocessResult preprocess(Node inp); #endif