parser.h 558 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef HM_JSON_PARSER_H
  2. #define HM_JSON_PARSER_H
  3. #include "value.h"
  4. namespace json {
  5. class Parser {
  6. private:
  7. std::string _str;
  8. unsigned _idx;
  9. char next_real();
  10. bool is_str_end(unsigned const &pos);
  11. Value _parse();
  12. Value parse_null();
  13. Value parse_bool();
  14. Value parse_number();
  15. Value parse_string();
  16. Value parse_list();
  17. Value parse_dict();
  18. public:
  19. Parser();
  20. Value parse(const std::string &str);
  21. };
  22. }
  23. #endif //HM_JSON_PARSER_H