1 /* 2 * Copyright (c) 2012-2017 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 package org.antlr.v4.runtime.atn; 8 9 import org.antlr.v4.runtime.TokenStream; 10 11 /** 12 * This class represents profiling event information for tracking the lookahead 13 * depth required in order to make a prediction. 14 * 15 * @since 4.3 16 */ 17 public class LookaheadEventInfo extends DecisionEventInfo { 18 /** The alternative chosen by adaptivePredict(), not necessarily 19 * the outermost alt shown for a rule; left-recursive rules have 20 * user-level alts that differ from the rewritten rule with a (...) block 21 * and a (..)* loop. 22 */ 23 public int predictedAlt; 24 25 /** 26 * Constructs a new instance of the {@link LookaheadEventInfo} class with 27 * the specified detailed lookahead information. 28 * 29 * @param decision The decision number 30 * @param configs The final configuration set containing the necessary 31 * information to determine the result of a prediction, or {@code null} if 32 * the final configuration set is not available 33 * @param input The input token stream 34 * @param startIndex The start index for the current prediction 35 * @param stopIndex The index at which the prediction was finally made 36 * @param fullCtx {@code true} if the current lookahead is part of an LL 37 * prediction; otherwise, {@code false} if the current lookahead is part of 38 * an SLL prediction 39 */ LookaheadEventInfo(int decision, ATNConfigSet configs, int predictedAlt, TokenStream input, int startIndex, int stopIndex, boolean fullCtx)40 public LookaheadEventInfo(int decision, 41 ATNConfigSet configs, 42 int predictedAlt, 43 TokenStream input, int startIndex, int stopIndex, 44 boolean fullCtx) 45 { 46 super(decision, configs, input, startIndex, stopIndex, fullCtx); 47 this.predictedAlt = predictedAlt; 48 } 49 } 50