/** * Get the start state for a specific precedence value. * * @param precedence The current precedence. * @return The start state corresponding to the specified precedence, or * {@code null} if no start state exists for the specified precedence. * * @throws IllegalStateException if this is not a precedence DFA. * @see #isPrecedenceDfa() */ @SuppressWarnings("null") public final DFAState getPrecedenceStartState(int precedence) { if (!isPrecedenceDfa()) { throw new IllegalStateException("Only precedence DFAs may contain a precedence start state."); } // s0.edges is never null for a precedence DFA if (precedence < 0 || precedence >= s0.edges.length) { return null; } return s0.edges[precedence]; }
/** * Sets whether this is a precedence DFA. * * @param precedenceDfa {@code true} if this is a precedence DFA; otherwise, * {@code false} * * @throws UnsupportedOperationException if {@code precedenceDfa} does not * match the value of {@link #isPrecedenceDfa} for the current DFA. * * @deprecated This method no longer performs any action. */ @Deprecated public final void setPrecedenceDfa(boolean precedenceDfa) { if (precedenceDfa != isPrecedenceDfa()) { throw new UnsupportedOperationException("The precedenceDfa field cannot change after a DFA is constructed."); } }
/** * Set the start state for a specific precedence value. * * @param precedence The current precedence. * @param startState The start state corresponding to the specified * precedence. * * @throws IllegalStateException if this is not a precedence DFA. * @see #isPrecedenceDfa() */ @SuppressWarnings({"SynchronizeOnNonFinalField", "null"}) public final void setPrecedenceStartState(int precedence, DFAState startState) { if (!isPrecedenceDfa()) { throw new IllegalStateException("Only precedence DFAs may contain a precedence start state."); } if (precedence < 0) { return; } // synchronization on s0 here is ok. when the DFA is turned into a // precedence DFA, s0 will be initialized once and not updated again synchronized (s0) { // s0.edges is never null for a precedence DFA if (precedence >= s0.edges.length) { s0.edges = Arrays.copyOf(s0.edges, precedence + 1); } s0.edges[precedence] = startState; } }
if (_dfa != null && _dfa.isPrecedenceDfa()) { int outermostPrecedenceReturn = ((EpsilonTransition)t).outermostPrecedenceReturn(); if (outermostPrecedenceReturn == _dfa.atnStartState.ruleIndex) {
/** * Sets whether this is a precedence DFA. * * @param precedenceDfa {@code true} if this is a precedence DFA; otherwise, * {@code false} * * @throws UnsupportedOperationException if {@code precedenceDfa} does not * match the value of {@link #isPrecedenceDfa} for the current DFA. * * @deprecated This method no longer performs any action. */ @Deprecated public final void setPrecedenceDfa(boolean precedenceDfa) { if (precedenceDfa != isPrecedenceDfa()) { throw new UnsupportedOperationException("The precedenceDfa field cannot change after a DFA is constructed."); } }
/** * Get the start state for a specific precedence value. * * @param precedence The current precedence. * @return The start state corresponding to the specified precedence, or * {@code null} if no start state exists for the specified precedence. * * @throws IllegalStateException if this is not a precedence DFA. * @see #isPrecedenceDfa() */ @SuppressWarnings("null") public final DFAState getPrecedenceStartState(int precedence) { if (!isPrecedenceDfa()) { throw new IllegalStateException("Only precedence DFAs may contain a precedence start state."); } // s0.edges is never null for a precedence DFA if (precedence < 0 || precedence >= s0.edges.length) { return null; } return s0.edges[precedence]; }
/** * Get the start state for a specific precedence value. * * @param precedence The current precedence. * @return The start state corresponding to the specified precedence, or * {@code null} if no start state exists for the specified precedence. * * @throws IllegalStateException if this is not a precedence DFA. * @see #isPrecedenceDfa() */ @SuppressWarnings("null") public final DFAState getPrecedenceStartState(int precedence) { if (!isPrecedenceDfa()) { throw new IllegalStateException("Only precedence DFAs may contain a precedence start state."); } // s0.edges is never null for a precedence DFA if (precedence < 0 || precedence >= s0.edges.length) { return null; } return s0.edges[precedence]; }
/** * Get the start state for a specific precedence value. * * @param precedence The current precedence. * @return The start state corresponding to the specified precedence, or * {@code null} if no start state exists for the specified precedence. * * @throws IllegalStateException if this is not a precedence DFA. * @see #isPrecedenceDfa() */ @SuppressWarnings("null") public final DFAState getPrecedenceStartState(int precedence) { if (!isPrecedenceDfa()) { throw new IllegalStateException("Only precedence DFAs may contain a precedence start state."); } // s0.edges is never null for a precedence DFA if (precedence < 0 || precedence >= s0.edges.length) { return null; } return s0.edges[precedence]; }
if (dfa.isPrecedenceDfa()) { fullCtx); if (dfa.isPrecedenceDfa()) {
/** * Sets whether this is a precedence DFA. * * @param precedenceDfa {@code true} if this is a precedence DFA; otherwise, * {@code false} * * @throws UnsupportedOperationException if {@code precedenceDfa} does not * match the value of {@link #isPrecedenceDfa} for the current DFA. * * @deprecated This method no longer performs any action. */ @Deprecated public final void setPrecedenceDfa(boolean precedenceDfa) { if (precedenceDfa != isPrecedenceDfa()) { throw new UnsupportedOperationException("The precedenceDfa field cannot change after a DFA is constructed."); } }
/** * Sets whether this is a precedence DFA. * * @param precedenceDfa {@code true} if this is a precedence DFA; otherwise, * {@code false} * * @throws UnsupportedOperationException if {@code precedenceDfa} does not * match the value of {@link #isPrecedenceDfa} for the current DFA. * * @deprecated This method no longer performs any action. */ @Deprecated public final void setPrecedenceDfa(boolean precedenceDfa) { if (precedenceDfa != isPrecedenceDfa()) { throw new UnsupportedOperationException("The precedenceDfa field cannot change after a DFA is constructed."); } }
public boolean isContextSensitive() { if (isPrecedenceDfa()) { return !s0full.get().getEdgeMap().isEmpty(); } return s0full.get() != null; }
/** * Set the start state for a specific precedence value. * * @param precedence The current precedence. * @param startState The start state corresponding to the specified * precedence. * * @throws IllegalStateException if this is not a precedence DFA. * @see #isPrecedenceDfa() */ @SuppressWarnings({"SynchronizeOnNonFinalField", "null"}) public final void setPrecedenceStartState(int precedence, DFAState startState) { if (!isPrecedenceDfa()) { throw new IllegalStateException("Only precedence DFAs may contain a precedence start state."); } if (precedence < 0) { return; } // synchronization on s0 here is ok. when the DFA is turned into a // precedence DFA, s0 will be initialized once and not updated again synchronized (s0) { // s0.edges is never null for a precedence DFA if (precedence >= s0.edges.length) { s0.edges = Arrays.copyOf(s0.edges, precedence + 1); } s0.edges[precedence] = startState; } }
/** * Set the start state for a specific precedence value. * * @param precedence The current precedence. * @param startState The start state corresponding to the specified * precedence. * * @throws IllegalStateException if this is not a precedence DFA. * @see #isPrecedenceDfa() */ @SuppressWarnings({"SynchronizeOnNonFinalField", "null"}) public final void setPrecedenceStartState(int precedence, DFAState startState) { if (!isPrecedenceDfa()) { throw new IllegalStateException("Only precedence DFAs may contain a precedence start state."); } if (precedence < 0) { return; } // synchronization on s0 here is ok. when the DFA is turned into a // precedence DFA, s0 will be initialized once and not updated again synchronized (s0) { // s0.edges is never null for a precedence DFA if (precedence >= s0.edges.length) { s0.edges = Arrays.copyOf(s0.edges, precedence + 1); } s0.edges[precedence] = startState; } }
/** * Set the start state for a specific precedence value. * * @param precedence The current precedence. * @param startState The start state corresponding to the specified * precedence. * * @throws IllegalStateException if this is not a precedence DFA. * @see #isPrecedenceDfa() */ @SuppressWarnings({"SynchronizeOnNonFinalField", "null"}) public final void setPrecedenceStartState(int precedence, DFAState startState) { if (!isPrecedenceDfa()) { throw new IllegalStateException("Only precedence DFAs may contain a precedence start state."); } if (precedence < 0) { return; } // synchronization on s0 here is ok. when the DFA is turned into a // precedence DFA, s0 will be initialized once and not updated again synchronized (s0) { // s0.edges is never null for a precedence DFA if (precedence >= s0.edges.length) { s0.edges = Arrays.copyOf(s0.edges, precedence + 1); } s0.edges[precedence] = startState; } }
public boolean isEmpty() { if (isPrecedenceDfa()) { return s0.get().getEdgeMap().isEmpty() && s0full.get().getEdgeMap().isEmpty(); } return s0.get() == null && s0full.get() == null; }
/** * Get the start state for a specific precedence value. * * @param precedence The current precedence. * @return The start state corresponding to the specified precedence, or * {@code null} if no start state exists for the specified precedence. * * @throws IllegalStateException if this is not a precedence DFA. * @see #isPrecedenceDfa() */ @SuppressWarnings("null") public final DFAState getPrecedenceStartState(int precedence, boolean fullContext) { if (!isPrecedenceDfa()) { throw new IllegalStateException("Only precedence DFAs may contain a precedence start state."); } // s0.get() and s0full.get() are never null for a precedence DFA if (fullContext) { return s0full.get().getTarget(precedence); } else { return s0.get().getTarget(precedence); } }
if (!isPrecedenceDfa()) { throw new IllegalStateException("Only precedence DFAs may contain a precedence start state.");
if (dfa.isPrecedenceDfa()) { assert outerContext != null; DFAState s0; if (dfa.isPrecedenceDfa()) { s0 = dfa.getPrecedenceStartState(parser.getPrecedence(), true);
if (optimize_ll1 && !dfa.isPrecedenceDfa() && !dfa.isEmpty()) { int ll_1 = input.LA(1); if (ll_1 >= 0 && ll_1 <= Short.MAX_VALUE) {