]> gitweb.ps.run Git - toc/blob - antlr4-cpp-runtime-4.9.2-source/runtime/src/atn/LexerSkipAction.h
add antlr source code and ReadMe
[toc] / antlr4-cpp-runtime-4.9.2-source / runtime / src / atn / LexerSkipAction.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 skip} lexer action by calling <seealso cref="Lexer#skip"/>.
16   ///
17   /// <para>The {@code skip} 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 LexerSkipAction final : public LexerAction {
24   public:
25     /// Provides a singleton instance of this parameterless lexer action.
26     static const Ref<LexerSkipAction> getInstance();
27
28     /// <summary>
29     /// {@inheritDoc} </summary>
30     /// <returns> This method returns <seealso cref="LexerActionType#SKIP"/>. </returns>
31     virtual LexerActionType getActionType() const override;
32
33     /// <summary>
34     /// {@inheritDoc} </summary>
35     /// <returns> This method returns {@code false}. </returns>
36     virtual bool isPositionDependent() const override;
37
38     /// <summary>
39     /// {@inheritDoc}
40     ///
41     /// <para>This action is implemented by calling <seealso cref="Lexer#skip"/>.</para>
42     /// </summary>
43     virtual void execute(Lexer *lexer) override;
44
45     virtual size_t hashCode() const override;
46     virtual bool operator == (const LexerAction &obj) const override;
47     virtual std::string toString() const override;
48
49   private:
50     /// Constructs the singleton instance of the lexer {@code skip} command.
51     LexerSkipAction();
52   };
53
54 } // namespace atn
55 } // namespace antlr4