| 344 | }; |
| 345 | |
| 346 | class TemplateParser |
| 347 | { |
| 348 | std::string m_text; |
| 349 | node_vector &m_top_nodes; |
| 350 | uint32_t m_current_line; |
| 351 | std::stack<std::pair<node_ptr, token_type_t> > m_node_stack; |
| 352 | node_ptr m_current_node; |
| 353 | node_vector *m_current_nodes; |
| 354 | bool m_eol_precedes; |
| 355 | bool m_last_was_eol; |
| 356 | token_type_t m_until; |
| 357 | |
| 358 | public: |
| 359 | TemplateParser(const std::string &text, node_vector &nodes); |
| 360 | |
| 361 | node_vector &parse(); |
| 362 | |
| 363 | private: |
| 364 | void parse_var(); |
| 365 | void parse_stmt(); |
| 366 | void parse_comment(); |
| 367 | |
| 368 | void push_node(Node *new_node, token_type_t until); |
| 369 | void check_omit_eol(size_t pos, bool force_omit); |
| 370 | }; |
| 371 | |
| 372 | std::string indent(int level); |
| 373 | inline bool is_key_path_char(char c); |
no outgoing calls