symbols.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #include <util/generic/strbuf.h>
  3. #include <util/system/types.h>
  4. namespace NYsonPull {
  5. namespace NDetail {
  6. namespace NSymbol {
  7. #define SYM(name, value) constexpr ui8 name = value
  8. //! Indicates the beginning of a list.
  9. SYM(begin_list, '[');
  10. //! Indicates the end of a list.
  11. SYM(end_list, ']');
  12. //! Indicates the beginning of a map.
  13. SYM(begin_map, '{');
  14. //! Indicates the end of a map.
  15. SYM(end_map, '}');
  16. //! Indicates the beginning of an attribute map.
  17. SYM(begin_attributes, '<');
  18. //! Indicates the end of an attribute map.
  19. SYM(end_attributes, '>');
  20. //! Separates items in lists and pairs in maps or attribute maps.
  21. SYM(item_separator, ';');
  22. //! Separates keys from values in maps and attribute maps.
  23. SYM(key_value_separator, '=');
  24. //! Indicates an entity.
  25. SYM(entity, '#');
  26. //! Indicates end of stream.
  27. SYM(eof, '\0');
  28. //! Marks the beginning of a binary string literal.
  29. SYM(string_marker, '\x01');
  30. //! Marks the beginning of a binary int64 literal.
  31. SYM(int64_marker, '\x02');
  32. //! Marks the beginning of a binary uint64 literal.
  33. SYM(uint64_marker, '\x06');
  34. //! Marks the beginning of a binary double literal.
  35. SYM(double_marker, '\x03');
  36. //! Marks a binary `false' boolean value.
  37. SYM(false_marker, '\x04');
  38. //! Marks a binary `true' boolean value.
  39. SYM(true_marker, '\x05');
  40. //! Text string quote symbol
  41. SYM(quote, '"');
  42. #undef SYM
  43. }
  44. }
  45. }