C# Class 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.
Inheritance: BaseErrorListener
ファイルを表示 Open project: antlr/antlr4

Protected Properties

Property Type Description
exactOnly bool

Public Methods

Method Description
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

Protected Methods

Method Description
GetDecisionDescription ( Parser recognizer, DFA dfa ) : string

Private Methods

Method Description
GetConflictingAlts ( BitSet reportedAlts, ATNConfigSet configSet ) : BitSet

Method Details

DiagnosticErrorListener() public method

Initializes a new instance of DiagnosticErrorListener which only reports exact ambiguities.
public DiagnosticErrorListener ( ) : Antlr4.Runtime
return Antlr4.Runtime

DiagnosticErrorListener() public method

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. ///
return Antlr4.Runtime

GetDecisionDescription() protected method

protected GetDecisionDescription ( Parser recognizer, DFA dfa ) : string
recognizer Parser
dfa Antlr4.Runtime.Dfa.DFA
return string

ReportAmbiguity() public method

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
return void

ReportAttemptingFullContext() public method

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
return void

ReportContextSensitivity() public method

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
return void

Property Details

exactOnly protected_oe property

When , only exactly known ambiguities are reported.
protected bool exactOnly
return bool