#ifndef ACPA_ELEMENT_H #define ACPA_ELEMENT_H #include #include #include #include #include #include using std::map; using std::set; using std::pair; using std::shared_ptr; using std::string; using std::vector; using std::weak_ptr; struct Struct; struct ValType; struct TemplateType; struct StructType; struct FunctionType; struct Struct { weak_ptr fa; vector> c1; vector> c2; map> vars; map> structs; }; struct ValType { enum Type { TEMPLATE, STRUCT, FUNCTION }; virtual ValType::Type type() const = 0; virtual shared_ptr struct_replace(shared_ptr, map, shared_ptr>&) = 0; virtual shared_ptr function_replace(const map, shared_ptr>&, map, shared_ptr>&) = 0; virtual bool sameType(shared_ptr, set, shared_ptr>>&) = 0; virtual ~ValType() = default; }; struct TemplateType : ValType { ValType::Type type() const override; shared_ptr struct_replace(shared_ptr, map, shared_ptr>&) override; shared_ptr function_replace(const map, shared_ptr>&, map, shared_ptr>&) override; bool sameType(shared_ptr, set, shared_ptr>>&) override; }; struct StructType : ValType { ValType::Type type() const override; shared_ptr struct_replace(shared_ptr, map, shared_ptr>&) override; shared_ptr function_replace(const map, shared_ptr>&, map, shared_ptr>&) override; bool sameType(shared_ptr, set, shared_ptr>>&) override; shared_ptr str; map, shared_ptr> mp; }; struct FunctionType : ValType { ValType::Type type() const override; shared_ptr struct_replace(shared_ptr, map, shared_ptr>&) override; shared_ptr function_replace(const map, shared_ptr>&, map, shared_ptr>&) override; bool sameType(shared_ptr, set, shared_ptr>>&) override; vector> c1; vector> c2; shared_ptr c3; }; shared_ptr struct_replace(shared_ptr, shared_ptr); shared_ptr function_replace(shared_ptr, const map, shared_ptr>&); bool sameType(shared_ptr, shared_ptr); #endif