C# Класс Antlr4.Runtime.DiagnosticErrorListener

This implementation of IAntlrErrorListener{Symbol} can be used to identify certain potential correctness and performance problems in grammars. "Reports" are made by calling Parser.NotifyErrorListeners(string) with the appropriate message.
  • Ambiguities: These are cases where more than one path through the grammar can match the input.
  • Weak context sensitivity: These are cases where full-context prediction resolved an SLL conflict to a unique alternative which equaled the minimum alternative of the SLL conflict.
  • Strong (forced) context sensitivity: These are cases where the full-context prediction resolved an SLL conflict to a unique alternative, and the minimum alternative of the SLL conflict was found to not be a truly viable alternative. Two-stage parsing cannot be used for inputs where this situation occurs.
Наследование: BaseErrorListener
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
exactOnly bool

Открытые методы

Метод Описание
DiagnosticErrorListener ( ) : Antlr4.Runtime

Initializes a new instance of DiagnosticErrorListener which only reports exact ambiguities.

DiagnosticErrorListener ( bool exactOnly ) : Antlr4.Runtime

Initializes a new instance of DiagnosticErrorListener , specifying whether all ambiguities or only exact ambiguities are reported.

ReportAmbiguity ( Parser recognizer, DFA dfa, int startIndex, int stopIndex, bool exact, BitSet ambigAlts, ATNConfigSet configs ) : void
ReportAttemptingFullContext ( Parser recognizer, DFA dfa, int startIndex, int stopIndex, BitSet conflictingAlts, SimulatorState conflictState ) : void
ReportContextSensitivity ( Parser recognizer, DFA dfa, int startIndex, int stopIndex, int prediction, SimulatorState acceptState ) : void

Защищенные методы

Метод Описание
GetDecisionDescription ( Parser recognizer, DFA dfa ) : string

Приватные методы

Метод Описание
GetConflictingAlts ( BitSet reportedAlts, ATNConfigSet configSet ) : BitSet

Описание методов

DiagnosticErrorListener() публичный Метод

Initializes a new instance of DiagnosticErrorListener which only reports exact ambiguities.
public DiagnosticErrorListener ( ) : Antlr4.Runtime
Результат Antlr4.Runtime

DiagnosticErrorListener() публичный Метод

Initializes a new instance of DiagnosticErrorListener , specifying whether all ambiguities or only exact ambiguities are reported.
public DiagnosticErrorListener ( bool exactOnly ) : Antlr4.Runtime
exactOnly bool /// /// /// to report only exact ambiguities, otherwise /// /// to report all ambiguities. ///
Результат Antlr4.Runtime

GetDecisionDescription() защищенный Метод

protected GetDecisionDescription ( Parser recognizer, DFA dfa ) : string
recognizer Parser
dfa Antlr4.Runtime.Dfa.DFA
Результат string

ReportAmbiguity() публичный Метод

public ReportAmbiguity ( Parser recognizer, DFA dfa, int startIndex, int stopIndex, bool exact, BitSet ambigAlts, ATNConfigSet configs ) : void
recognizer Parser
dfa Antlr4.Runtime.Dfa.DFA
startIndex int
stopIndex int
exact bool
ambigAlts Antlr4.Runtime.Sharpen.BitSet
configs ATNConfigSet
Результат void

ReportAttemptingFullContext() публичный Метод

public ReportAttemptingFullContext ( Parser recognizer, DFA dfa, int startIndex, int stopIndex, BitSet conflictingAlts, SimulatorState conflictState ) : void
recognizer Parser
dfa Antlr4.Runtime.Dfa.DFA
startIndex int
stopIndex int
conflictingAlts Antlr4.Runtime.Sharpen.BitSet
conflictState Antlr4.Runtime.Atn.SimulatorState
Результат void

ReportContextSensitivity() публичный Метод

public ReportContextSensitivity ( Parser recognizer, DFA dfa, int startIndex, int stopIndex, int prediction, SimulatorState acceptState ) : void
recognizer Parser
dfa Antlr4.Runtime.Dfa.DFA
startIndex int
stopIndex int
prediction int
acceptState Antlr4.Runtime.Atn.SimulatorState
Результат void

Описание свойств

exactOnly защищенное свойство

When , only exactly known ambiguities are reported.
protected bool exactOnly
Результат bool