]> gitweb.ps.run Git - toc/blob - antlr4-cpp-runtime-4.9.2-source/runtime/src/atn/LexerPopModeAction.h
add antlr source code and ReadMe
[toc] / antlr4-cpp-runtime-4.9.2-source / runtime / src / atn / LexerPopModeAction.h
1 /* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
2  * Use of this file is governed by the BSD 3-clause license that
3  * can be found in the LICENSE.txt file in the project root.
4  */
5
6 #pragma once
7
8 #include "atn/LexerAction.h"
9 #include "atn/LexerActionType.h"
10
11 namespace antlr4 {
12 namespace atn {
13
14   /// <summary>
15   /// Implements the {@code popMode} lexer action by calling <seealso cref="Lexer#popMode"/>.
16   ///
17   /// <para>The {@code popMode} command does not have any parameters, so this action is
18   /// implemented as a singleton instance exposed by <seealso cref="#INSTANCE"/>.</para>
19   ///
20   /// @author Sam Harwell
21   /// @since 4.2
22   /// </summary>
23   class ANTLR4CPP_PUBLIC LexerPopModeAction final : public LexerAction {
24   public:
25     /// <summary>
26     /// Provides a singleton instance of this parameterless lexer action.
27     /// </summary>
28     static const Ref<LexerPopModeAction> getInstance();
29
30     /// <summary>
31     /// {@inheritDoc} </summary>
32     /// <returns> This method returns <seealso cref="LexerActionType#POP_MODE"/>. </returns>
33     virtual LexerActionType getActionType() const override;
34
35     /// <summary>
36     /// {@inheritDoc} </summary>
37     /// <returns> This method returns {@code false}. </returns>
38     virtual bool isPositionDependent() const override;
39
40     /// <summary>
41     /// {@inheritDoc}
42     ///
43     /// <para>This action is implemented by calling <seealso cref="Lexer#popMode"/>.</para>
44     /// </summary>
45     virtual void execute(Lexer *lexer) override;
46
47     virtual size_t hashCode() const override;
48     virtual bool operator == (const LexerAction &obj) const override;
49     virtual std::string toString() const override;
50
51   private:
52     /// Constructs the singleton instance of the lexer {@code popMode} command.
53     LexerPopModeAction();
54   };
55
56 } // namespace atn
57 } // namespace antlr4