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:
java.io.Serializable
- Direct Known Subclasses:
CompilerException
public class GrammarException extends CoffeeGrinderException
Grammar exceptions.Grammar exceptions are generally errors in the grammar, use of a nonterminal that has no rule defining it, for example.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GrammarException(java.lang.String code, java.lang.String message)
Grammar exception with a message.GrammarException(java.lang.String code, java.lang.String message, java.lang.Throwable cause)
Grammar exception with an underlying cause.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GrammarException
grammarIsClosed()
Raised if an attempt is made to write to a closed grammar.static GrammarException
invalidCharacterClass(java.lang.String name)
Raised if an invalid Unicode character class is specified.static GrammarException
invalidGrammarRegex()
Raised if a regular expression is used incorrectly.-
Methods inherited from class org.nineml.coffeegrinder.exceptions.CoffeeGrinderException
getCode
-
-
-
-
Constructor Detail
-
GrammarException
public GrammarException(java.lang.String code, java.lang.String message)
Grammar exception with a message.- Parameters:
code
- the codemessage
- the message
-
GrammarException
public GrammarException(java.lang.String code, java.lang.String message, java.lang.Throwable cause)
Grammar exception with an underlying cause.- Parameters:
code
- the codemessage
- the messagecause
- the cause
-
-
Method Detail
-
grammarIsClosed
public static GrammarException grammarIsClosed()
Raised if an attempt is made to write to a closed grammar.- Returns:
- a GrammarException
-
invalidCharacterClass
public static GrammarException invalidCharacterClass(java.lang.String name)
Raised if an invalid Unicode character class is specified.- Parameters:
name
- the Unicode character class- Returns:
- a GrammarException.
-
invalidGrammarRegex
public static 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.
-
-