aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/antlr4_cpp_runtime/src/atn/LexerPushModeAction.h
diff options
context:
space:
mode:
authorvitalyisaev <vitalyisaev@ydb.tech>2023-11-30 13:26:22 +0300
committervitalyisaev <vitalyisaev@ydb.tech>2023-11-30 15:44:45 +0300
commit0a98fece5a9b54f16afeb3a94b3eb3105e9c3962 (patch)
tree291d72dbd7e9865399f668c84d11ed86fb190bbf /contrib/libs/antlr4_cpp_runtime/src/atn/LexerPushModeAction.h
parentcb2c8d75065e5b3c47094067cb4aa407d4813298 (diff)
downloadydb-0a98fece5a9b54f16afeb3a94b3eb3105e9c3962.tar.gz
YQ Connector:Use docker-compose in integrational tests
Diffstat (limited to 'contrib/libs/antlr4_cpp_runtime/src/atn/LexerPushModeAction.h')
-rw-r--r--contrib/libs/antlr4_cpp_runtime/src/atn/LexerPushModeAction.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/contrib/libs/antlr4_cpp_runtime/src/atn/LexerPushModeAction.h b/contrib/libs/antlr4_cpp_runtime/src/atn/LexerPushModeAction.h
new file mode 100644
index 0000000000..32b706b583
--- /dev/null
+++ b/contrib/libs/antlr4_cpp_runtime/src/atn/LexerPushModeAction.h
@@ -0,0 +1,57 @@
+/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+ * Use of this file is governed by the BSD 3-clause license that
+ * can be found in the LICENSE.txt file in the project root.
+ */
+
+#pragma once
+
+#include "atn/LexerAction.h"
+#include "atn/LexerActionType.h"
+
+namespace antlr4 {
+namespace atn {
+
+ /// <summary>
+ /// Implements the {@code pushMode} lexer action by calling
+ /// <seealso cref="Lexer#pushMode"/> with the assigned mode.
+ ///
+ /// @author Sam Harwell
+ /// @since 4.2
+ /// </summary>
+ class ANTLR4CPP_PUBLIC LexerPushModeAction final : public LexerAction {
+ public:
+ static bool is(const LexerAction &lexerAction) { return lexerAction.getActionType() == LexerActionType::PUSH_MODE; }
+
+ static bool is(const LexerAction *lexerAction) { return lexerAction != nullptr && is(*lexerAction); }
+
+ /// <summary>
+ /// Constructs a new {@code pushMode} action with the specified mode value. </summary>
+ /// <param name="mode"> The mode value to pass to <seealso cref="Lexer#pushMode"/>. </param>
+ explicit LexerPushModeAction(int mode);
+
+ /// <summary>
+ /// Get the lexer mode this action should transition the lexer to.
+ /// </summary>
+ /// <returns> The lexer mode for this {@code pushMode} command. </returns>
+ int getMode() const { return _mode; }
+
+ /// <summary>
+ /// {@inheritDoc}
+ ///
+ /// <para>This action is implemented by calling <seealso cref="Lexer#pushMode"/> with the
+ /// value provided by <seealso cref="#getMode"/>.</para>
+ /// </summary>
+ void execute(Lexer *lexer) const override;
+
+ bool equals(const LexerAction &obj) const override;
+ std::string toString() const override;
+
+ protected:
+ size_t hashCodeImpl() const override;
+
+ private:
+ const int _mode;
+ };
+
+} // namespace atn
+} // namespace antlr4