Class GrammarException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.nineml.coffeegrinder.exceptions.CoffeeGrinderException
org.nineml.coffeegrinder.exceptions.GrammarException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CompilerException
Grammar exceptions.
Grammar exceptions are generally errors in the grammar, use of a nonterminal that has no rule defining it, for example.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGrammarException(String code, String message) Grammar exception with a message.GrammarException(String code, String message, Throwable cause) Grammar exception with an underlying cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic GrammarExceptionRaised if an attempt is made to write to a closed grammar.static GrammarExceptioninvalidCharacterClass(String name) Raised if an invalid Unicode character class is specified.static GrammarExceptionRaised if a regular expression is used incorrectly.Methods inherited from class org.nineml.coffeegrinder.exceptions.CoffeeGrinderException
getCodeMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
GrammarException
Grammar exception with a message.- Parameters:
code- the codemessage- the message
-
GrammarException
Grammar exception with an underlying cause.- Parameters:
code- the codemessage- the messagecause- the cause
-
-
Method Details
-
grammarIsClosed
Raised if an attempt is made to write to a closed grammar.- Returns:
- a GrammarException
-
invalidCharacterClass
Raised if an invalid Unicode character class is specified.- Parameters:
name- the Unicode character class- Returns:
- a GrammarException.
-
invalidGrammarRegex
Raised if a regular expression is used incorrectly.Regular expressions must be the only symbol on the right hand side of a rule.
- Returns:
- a GrammarException.
-