85 #ifndef preprocessor_h
86 #define preprocessor_h
100 static std::unordered_map<std::string, RepliMacro *> RepliMacros_;
101 static std::unordered_map<std::string, int32> Counters_;
102 static std::list<RepliCondition *> Conditions_;
103 static uint32 GlobalLine_;
104 static std::vector<std::string> LoadedFilePaths_;
106 enum Type { Root, Structure, Set, Atom, Directive, Condition, Development };
113 std::list<RepliStruct *> args_;
115 std::string filePath_;
122 uint32 getIndent(std::istream *stream);
123 int32 parse(std::istream *stream,
const std::string& file_path, uint32 &cur_indent, uint32 &prev_indent, int32 param_expect = 0);
124 bool parseDirective(std::istream *stream,
const std::string& file_path, uint32 &cur_indent, uint32 &prev_indent);
149 std::string print()
const;
150 std::string printError()
const;
152 friend std::ostream& operator<<(std::ostream &os,
const RepliStruct &structure);
153 friend std::ostream& operator<<(std::ostream &os,
RepliStruct *structure);
178 bool isActive(std::unordered_map<std::string, RepliMacro*> &repli_macros, std::unordered_map<std::string, int32> &counters);
189 uint16 class_opcode_;
190 std::unordered_map<std::string, RepliStruct *> template_classes_;
191 void instantiateClass(
RepliStruct *tpl_class, std::list<RepliStruct *> &tpl_args, std::string &instantiated_class_name);
192 bool isSet(std::string class_name);
194 void getMember(std::vector<StructureMember> &members,
RepliStruct *m, std::list<RepliStruct *> &tpl_args,
bool instantiate);
195 void getMembers(
RepliStruct *s, std::vector<StructureMember> &members, std::list<RepliStruct *> &tpl_args,
bool instantiate);
197 void initialize(
Metadata *metadata);
203 bool process(std::istream *stream,
204 const std::string& filePath,
205 std::ostringstream *outstream,