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.
8 #include "atn/LexerActionType.h"
9 #include "atn/LexerAction.h"
14 /// Implements the {@code type} lexer action by calling <seealso cref="Lexer#setType"/>
15 /// with the assigned type.
16 class ANTLR4CPP_PUBLIC LexerTypeAction : public LexerAction {
19 /// Constructs a new {@code type} action with the specified token type value. </summary>
20 /// <param name="type"> The type to assign to the token using <seealso cref="Lexer#setType"/>. </param>
21 LexerTypeAction(int type);
24 /// Gets the type to assign to a token created by the lexer. </summary>
25 /// <returns> The type to assign to a token created by the lexer. </returns>
26 virtual int getType() const;
29 /// {@inheritDoc} </summary>
30 /// <returns> This method returns <seealso cref="LexerActionType#TYPE"/>. </returns>
31 virtual LexerActionType getActionType() const override;
34 /// {@inheritDoc} </summary>
35 /// <returns> This method returns {@code false}. </returns>
36 virtual bool isPositionDependent() const override;
41 /// <para>This action is implemented by calling <seealso cref="Lexer#setType"/> with the
42 /// value provided by <seealso cref="#getType"/>.</para>
44 virtual void execute(Lexer *lexer) override;
46 virtual size_t hashCode() const override;
47 virtual bool operator == (const LexerAction &obj) const override;
48 virtual std::string toString() const override;