Package org.nineml.coffeegrinder.parser
Class HygieneReport
- java.lang.Object
-
- org.nineml.coffeegrinder.parser.HygieneReport
-
public class HygieneReport extends java.lang.ObjectA report on the hygiene of a grammar.A grammar is considered "unhygienic" if it contains any of the following features: unreachable (i.e., unused) nonterminals, unproductive nonterminals, or unproductive rules.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Stringlogcategory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanambiguityChecked()Did the dk.brics.grammar.ambiguity analyzer run successfully?voidcheckAmbiguity()voidcheckGrammar()java.lang.StringgetAmbiguityReport()Get the dk.brics.grammar.ambiguity analyzer report.ParserGrammargetCompiledGrammar()Get the grammar associated with this report.java.util.Set<NonterminalSymbol>getUndefinedSymbols()Get the unreachable symbols.java.util.Set<Rule>getUnproductiveRules()Get the unproductive rules.java.util.Set<NonterminalSymbol>getUnproductiveSymbols()Get the unproductive symbols.java.util.Set<NonterminalSymbol>getUnreachableSymbols()Get the unreachable symbols.booleanisClean()Is this grammar "clean"?booleanprovablyUnambiguous()Did the dk.brics.grammar.ambiguity analyzer report the grammar unambiguous?booleanreliablyUnambiguous()Did the dk.brics.grammar.ambiguity analyzer run reliably?
-
-
-
Field Detail
-
logcategory
public static final java.lang.String logcategory
- See Also:
- Constant Field Values
-
-
Method Detail
-
checkGrammar
public void checkGrammar()
-
checkAmbiguity
public void checkAmbiguity()
-
isClean
public boolean isClean()
Is this grammar "clean"?- Returns:
- true iff the grammar has no unhygienic features
-
getCompiledGrammar
public ParserGrammar getCompiledGrammar()
Get the grammar associated with this report.Note that if the grammar was open when the report was created, it may have changed since this report was created.
- Returns:
- the grammar.
-
getUnproductiveRules
public java.util.Set<Rule> getUnproductiveRules()
Get the unproductive rules.- Returns:
- the unproductive rules.
-
getUnproductiveSymbols
public java.util.Set<NonterminalSymbol> getUnproductiveSymbols()
Get the unproductive symbols.- Returns:
- the unproductive symbols.
-
getUnreachableSymbols
public java.util.Set<NonterminalSymbol> getUnreachableSymbols()
Get the unreachable symbols.- Returns:
- the unreachable symbols.
-
getUndefinedSymbols
public java.util.Set<NonterminalSymbol> getUndefinedSymbols()
Get the unreachable symbols.- Returns:
- the unreachable symbols.
-
ambiguityChecked
public boolean ambiguityChecked()
Did the dk.brics.grammar.ambiguity analyzer run successfully?- Returns:
- true, if the analyzer ran successfully
-
provablyUnambiguous
public boolean provablyUnambiguous()
Did the dk.brics.grammar.ambiguity analyzer report the grammar unambiguous?- Returns:
- true, if the grammar is unambiguous
-
reliablyUnambiguous
public boolean reliablyUnambiguous()
Did the dk.brics.grammar.ambiguity analyzer run reliably?- Returns:
- true, if the analyzer detected no uncheckable characters or character classes
-
getAmbiguityReport
public java.lang.String getAmbiguityReport()
Get the dk.brics.grammar.ambiguity analyzer report.- Returns:
- the report, or null if no report is available
-
-