1 /* 2 * Copyright (c) 2012-2018 The ANTLR Project. All rights reserved. 3 * Use of this file is governed by the BSD 3-clause license that 4 * can be found in the LICENSE.txt file in the project root. 5 */ 6 7 module antlr.v4.runtime.atn.LexerMoreAction; 8 9 import antlr.v4.runtime.InterfaceLexer; 10 import antlr.v4.runtime.atn.LexerAction; 11 import antlr.v4.runtime.atn.LexerActionType; 12 import antlr.v4.runtime.misc; 13 14 /** 15 * Provides a singleton instance of this parameterless lexer action. 16 */ 17 class LexerMoreAction : LexerAction 18 { 19 20 /** 21 * The single instance of LexerMoreAction. 22 */ 23 private static __gshared LexerMoreAction instance_; 24 25 /** 26 * @uml 27 * {@inheritDoc} 28 * @return This method returns {@link LexerActionType#MORE}. 29 * @safe 30 * @nothrow 31 */ 32 public LexerActionType getActionType() @safe nothrow 33 { 34 return LexerActionType.MORE; 35 } 36 37 public bool isPositionDependent() 38 { 39 return false; 40 } 41 42 public void execute(InterfaceLexer lexer) 43 { 44 lexer.more(); 45 } 46 47 /** 48 * @uml 49 * @safe 50 * @nothrow 51 * @override 52 */ 53 public override size_t toHash() @safe nothrow 54 { 55 size_t hash = MurmurHash.initialize(); 56 hash = MurmurHash.update(hash, Utils.rank(getActionType)); 57 return MurmurHash.finish(hash, 1); 58 } 59 60 /** 61 * @uml 62 * - @SuppressWarnings("EqualsWhichDoesntCheckParameterClass") 63 */ 64 public bool equals(Object obj) 65 { 66 return obj == this; 67 } 68 69 /** 70 * @uml 71 * @override 72 */ 73 public override string toString() 74 { 75 return "more"; 76 } 77 78 /** 79 * Creates the single instance of LexerMoreAction. 80 */ 81 private shared static this() 82 { 83 instance_ = new LexerMoreAction; 84 } 85 86 /** 87 * Returns: A single instance of LexerMoreAction. 88 */ 89 public static LexerMoreAction instance() 90 { 91 return instance_; 92 } 93 94 }