/*! * Copyright 2016 The ANTLR Project. All rights reserved. * Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information. */ import { ATN } from './ATN'; import { ATNStateType } from './ATNStateType'; import { IntervalSet } from '../misc/IntervalSet'; import { Transition } from './Transition'; /** * The following images show the relation of states and * {@link ATNState#transitions} for various grammar constructs. * * * *

Basic Blocks

* *

Rule

* * * *

Block of 1 or more alternatives

* * * *

Greedy Loops

* *

Greedy Closure: {@code (...)*}

* * * *

Greedy Positive Closure: {@code (...)+}

* * * *

Greedy Optional: {@code (...)?}

* * * *

Non-Greedy Loops

* *

Non-Greedy Closure: {@code (...)*?}

* * * *

Non-Greedy Positive Closure: {@code (...)+?}

* * * *

Non-Greedy Optional: {@code (...)??}

* * */ export declare abstract class ATNState { private static readonly serializationNames; /** Which ATN are we in? */ atn?: ATN; stateNumber: number; ruleIndex: number; epsilonOnlyTransitions: boolean; /** Track the transitions emanating from this ATN state. */ protected transitions: Transition[]; protected optimizedTransitions: Transition[]; /** Used to cache lookahead during parsing, not used during construction */ nextTokenWithinRule?: IntervalSet; /** * Gets the state number. * * @return the state number */ getStateNumber(): number; /** * For all states except {@link RuleStopState}, this returns the state * number. Returns -1 for stop states. * * @return -1 for {@link RuleStopState}, otherwise the state number */ readonly nonStopStateNumber: number; hashCode(): number; equals(o: any): boolean; readonly isNonGreedyExitState: boolean; toString(): string; getTransitions(): Transition[]; readonly numberOfTransitions: number; addTransition(e: Transition, index?: number): void; transition(i: number): Transition; setTransition(i: number, e: Transition): void; removeTransition(index: number): Transition; readonly abstract stateType: ATNStateType; readonly onlyHasEpsilonTransitions: boolean; setRuleIndex(ruleIndex: number): void; readonly isOptimized: boolean; readonly numberOfOptimizedTransitions: number; getOptimizedTransition(i: number): Transition; addOptimizedTransition(e: Transition): void; setOptimizedTransition(i: number, e: Transition): void; removeOptimizedTransition(i: number): void; } export declare namespace ATNState { const INVALID_STATE_NUMBER: number; }