aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yson/token.h
diff options
context:
space:
mode:
authormonster <monster@yandex-team.ru>2022-02-10 16:47:19 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:19 +0300
commitb23c1d7a8015c2006a148fd93b84cdeb0aee17a3 (patch)
tree9814fbd1c3effac9b8377c5d604b367b14e2db55 /library/cpp/yson/token.h
parentdd76ae1f6213d065375ab296699f764faafbe5bd (diff)
downloadydb-b23c1d7a8015c2006a148fd93b84cdeb0aee17a3.tar.gz
Restoring authorship annotation for <monster@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yson/token.h')
-rw-r--r--library/cpp/yson/token.h52
1 files changed, 26 insertions, 26 deletions
diff --git a/library/cpp/yson/token.h b/library/cpp/yson/token.h
index ee455a29ca..7283e56950 100644
--- a/library/cpp/yson/token.h
+++ b/library/cpp/yson/token.h
@@ -1,21 +1,21 @@
-#pragma once
-
-#include "public.h"
-
-#include <util/generic/strbuf.h>
-
+#pragma once
+
+#include "public.h"
+
+#include <util/generic/strbuf.h>
+
namespace NYson {
////////////////////////////////////////////////////////////////////////////////
-
+
enum ETokenType {
EndOfStream,
-
+
String,
Int64,
Uint64,
Double,
Boolean,
-
+
// Special values:
// YSON
Semicolon, // ;
@@ -27,7 +27,7 @@ namespace NYson {
RightBrace, // }
LeftAngle, // <
RightAngle, // >
-
+
// Table ranges
LeftParenthesis, // (
RightParenthesis, // )
@@ -35,23 +35,23 @@ namespace NYson {
Colon, // :
Comma, // ,
};
-
+
////////////////////////////////////////////////////////////////////////////////
-
+
ETokenType CharToTokenType(char ch);
char TokenTypeToChar(ETokenType type);
TString TokenTypeToString(ETokenType type);
-
+
////////////////////////////////////////////////////////////////////////////////
-
+
class TLexerImpl;
-
+
////////////////////////////////////////////////////////////////////////////////
-
+
class TToken {
public:
static const TToken EndOfStream;
-
+
TToken();
TToken(ETokenType type);
explicit TToken(const TStringBuf& stringValue);
@@ -59,35 +59,35 @@ namespace NYson {
explicit TToken(ui64 int64Value);
explicit TToken(double doubleValue);
explicit TToken(bool booleanValue);
-
+
ETokenType GetType() const {
return Type_;
}
-
+
bool IsEmpty() const;
const TStringBuf& GetStringValue() const;
i64 GetInt64Value() const;
ui64 GetUint64Value() const;
double GetDoubleValue() const;
bool GetBooleanValue() const;
-
+
void CheckType(ETokenType expectedType) const;
void Reset();
-
+
private:
friend class TLexerImpl;
-
+
ETokenType Type_;
-
+
TStringBuf StringValue;
i64 Int64Value;
ui64 Uint64Value;
double DoubleValue;
bool BooleanValue;
};
-
+
TString ToString(const TToken& token);
-
+
////////////////////////////////////////////////////////////////////////////////
-
+
} // namespace NYson