Beispiel #1
0
        public override int GetHashCode()
        {
            int hash = MurmurHash.Initialize();

            hash = MurmurHash.Update(hash, (int)(ActionType));
            return(MurmurHash.Finish(hash, 1));
        }
Beispiel #2
0
        public override int GetHashCode()
        {
            int hash = MurmurHash.Initialize();

            hash = MurmurHash.Update(hash, offset);
            hash = MurmurHash.Update(hash, action);
            return(MurmurHash.Finish(hash, 2));
        }
Beispiel #3
0
        public override int GetHashCode()
        {
            int hash = MurmurHash.Initialize();

            hash = MurmurHash.Update(hash, (int)(GetActionType()));
            hash = MurmurHash.Update(hash, channel);
            return(MurmurHash.Finish(hash, 2));
        }
Beispiel #4
0
        public override int GetHashCode()
        {
            int hash = MurmurHash.Initialize(7);

            hash = MurmurHash.Update(hash, configs.GetHashCode());
            hash = MurmurHash.Finish(hash, 1);
            return(hash);
        }
Beispiel #5
0
            /// <summary>
            /// The hash code is only a function of the
            /// <see cref="ATNState.stateNumber"/>
            /// and
            /// <see cref="ATNConfig.context"/>
            /// .
            /// </summary>
            public override int GetHashCode(ATNConfig o)
            {
                int hashCode = MurmurHash.Initialize(7);

                hashCode = MurmurHash.Update(hashCode, o.state.stateNumber);
                hashCode = MurmurHash.Update(hashCode, o.context);
                hashCode = MurmurHash.Finish(hashCode, 2);
                return(hashCode);
            }
Beispiel #6
0
        protected internal static int CalculateHashCode(PredictionContext parent, int returnState)
        {
            int hash = MurmurHash.Initialize(INITIAL_HASH);

            hash = MurmurHash.Update(hash, parent);
            hash = MurmurHash.Update(hash, returnState);
            hash = MurmurHash.Finish(hash, 2);
            return(hash);
        }
Beispiel #7
0
        protected internal static int CalculateHashCode(Antlr4.Runtime.Atn.PredictionContext parent, int returnState)
        {
            int hash = MurmurHash.Initialize(InitialHash);

            hash = MurmurHash.Update(hash, parent);
            hash = MurmurHash.Update(hash, returnState);
            hash = MurmurHash.Finish(hash, 2);
            return(hash);
        }
        public override int GetHashCode()
        {
            int hash = MurmurHash.Initialize();

            hash = MurmurHash.Update(hash, name);
            hash = MurmurHash.Update(hash, GetArgType());
            hash = MurmurHash.Finish(hash, 2);
            return(hash);
        }
Beispiel #9
0
        public override int GetHashCode()
        {
            int hash = MurmurHash.Initialize();

            hash = MurmurHash.Update(hash, (int)(GetActionType()));
            hash = MurmurHash.Update(hash, ruleIndex);
            hash = MurmurHash.Update(hash, actionIndex);
            return(MurmurHash.Finish(hash, 3));
        }
            public override int GetHashCode()
            {
                int hashCode = MurmurHash.Initialize();

                hashCode = MurmurHash.Update(hashCode, ruleIndex);
                hashCode = MurmurHash.Update(hashCode, predIndex);
                hashCode = MurmurHash.Update(hashCode, isCtxDependent ? 1 : 0);
                hashCode = MurmurHash.Finish(hashCode, 3);
                return(hashCode);
            }
Beispiel #11
0
        /// <summary>
        /// Constructs an executor for a sequence of
        /// <see cref="ILexerAction"/>
        /// actions.
        /// </summary>
        /// <param name="lexerActions">The lexer actions to execute.</param>
        public LexerActionExecutor(ILexerAction[] lexerActions)
        {
            this.lexerActions = lexerActions;
            int hash = MurmurHash.Initialize();

            foreach (ILexerAction lexerAction in lexerActions)
            {
                hash = MurmurHash.Update(hash, lexerAction);
            }
            this.hashCode = MurmurHash.Finish(hash, lexerActions.Length);
        }
Beispiel #12
0
        public override int GetHashCode()
        {
            int hashCode = MurmurHash.Initialize(7);

            hashCode = MurmurHash.Update(hashCode, state.stateNumber);
            hashCode = MurmurHash.Update(hashCode, alt);
            hashCode = MurmurHash.Update(hashCode, context);
            hashCode = MurmurHash.Update(hashCode, semanticContext);
            hashCode = MurmurHash.Finish(hashCode, 4);
            return(hashCode);
        }
Beispiel #13
0
        public override int GetHashCode()
        {
            int hashCode = MurmurHash.Initialize(7);

            hashCode = MurmurHash.Update(hashCode, State.stateNumber);
            hashCode = MurmurHash.Update(hashCode, Alt);
            hashCode = MurmurHash.Update(hashCode, ReachesIntoOuterContext ? 1 : 0);
            hashCode = MurmurHash.Update(hashCode, Context);
            hashCode = MurmurHash.Update(hashCode, SemanticContext);
            hashCode = MurmurHash.Finish(hashCode, 5);
            return(hashCode);
        }
Beispiel #14
0
        public override int GetHashCode()
        {
            int hashCode = MurmurHash.Initialize(7);

            hashCode = MurmurHash.Update(hashCode, state.stateNumber);
            hashCode = MurmurHash.Update(hashCode, alt);
            hashCode = MurmurHash.Update(hashCode, context);
            hashCode = MurmurHash.Update(hashCode, semanticContext);
            hashCode = MurmurHash.Update(hashCode, passedThroughNonGreedyDecision ? 1 : 0);
            hashCode = MurmurHash.Update(hashCode, lexerActionExecutor);
            hashCode = MurmurHash.Finish(hashCode, 6);
            return(hashCode);
        }
Beispiel #15
0
        public override int GetHashCode()
        {
            int hashCode = MurmurHash.Initialize(7);

            hashCode = MurmurHash.Update(hashCode, State.stateNumber);
            hashCode = MurmurHash.Update(hashCode, Alt);
            hashCode = MurmurHash.Update(hashCode, ReachesIntoOuterContext ? 1 : 0);
            hashCode = MurmurHash.Update(hashCode, Context);
            hashCode = MurmurHash.Update(hashCode, SemanticContext);
            hashCode = MurmurHash.Update(hashCode, PassedThroughNonGreedyDecision ? 1 : 0);
            hashCode = MurmurHash.Update(hashCode, ActionExecutor);
            hashCode = MurmurHash.Finish(hashCode, 7);
            return(hashCode);
        }
Beispiel #16
0
        protected internal static int CalculateHashCode(PredictionContext[] parents, int[] returnStates)
        {
            int hash = MurmurHash.Initialize(INITIAL_HASH);

            foreach (PredictionContext parent in parents)
            {
                hash = MurmurHash.Update(hash, parent);
            }
            foreach (int returnState in returnStates)
            {
                hash = MurmurHash.Update(hash, returnState);
            }
            hash = MurmurHash.Finish(hash, 2 * parents.Length);
            return(hash);
        }