[−][src]Enum antlr_rust::prediction_mode::PredictionMode
This enum defines the prediction modes available in ANTLR 4 along with utility methods for analyzing configuration sets for conflicts and/or ambiguities.
Variants
The SLL(*) prediction mode. This prediction mode ignores the current parser context when making predictions. This is the fastest prediction mode, and provides correct results for many grammars. This prediction mode is more powerful than the prediction mode provided by ANTLR 3, but may result in syntax errors for grammar and input combinations which are not SLL.
When using this prediction mode, the parser will either return a correct parse tree (i.e. the same parse tree that would be returned with the {@link #LL} prediction mode), or it will report a syntax error. If a syntax error is encountered when using the {@link #SLL} prediction mode, it may be due to either an actual syntax error in the input or indicate that the particular combination of grammar and input requires the more powerful {@link #LL} prediction abilities to complete successfully.
This prediction mode does not provide any guarantees for prediction behavior for syntactically-incorrect inputs.
The LL(*) prediction mode. This prediction mode allows the current parser context to be used for resolving SLL conflicts that occur during prediction. This is the fastest prediction mode that guarantees correct parse results for all combinations of grammars with syntactically correct inputs.
When using this prediction mode, the parser will make correct decisions for all syntactically-correct grammar and input combinations. However, in cases where the grammar is truly ambiguous this prediction mode might not report a precise answer for exactly which alternatives are ambiguous.
This prediction mode does not provide any guarantees for prediction behavior for syntactically-incorrect inputs.
The LL(*) prediction mode with exact ambiguity detection. In addition to the correctness guarantees provided by the {@link #LL} prediction mode, this prediction mode instructs the prediction algorithm to determine the complete and exact set of ambiguous alternatives for every ambiguous decision encountered while parsing.
This prediction mode may be used for diagnosing ambiguities during grammar development. Due to the performance overhead of calculating sets of ambiguous alternatives, this prediction mode should be avoided when the exact results are not necessary.
This prediction mode does not provide any guarantees for prediction behavior for syntactically-incorrect inputs.
Trait Implementations
impl Clone for PredictionMode
[src]
fn clone(&self) -> PredictionMode
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PredictionMode
[src]
impl Eq for PredictionMode
[src]
impl PartialEq<PredictionMode> for PredictionMode
[src]
fn eq(&self, other: &PredictionMode) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for PredictionMode
[src]
impl StructuralPartialEq for PredictionMode
[src]
Auto Trait Implementations
impl RefUnwindSafe for PredictionMode
impl Send for PredictionMode
impl Sync for PredictionMode
impl Unpin for PredictionMode
impl UnwindSafe for PredictionMode
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,