From 5c416488ef63b5004ca424de56894eb17712f116 Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Sun, 3 Jun 2018 23:59:30 -0300 Subject: Add recurrance limit This controls the number of times a rule can be entered into during a single generations, and is set to 5 by default --- .../java/bjc/rgens/parser/RecurLimitException.java | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/main/java/bjc/rgens/parser/RecurLimitException.java (limited to 'src/main/java/bjc/rgens/parser/RecurLimitException.java') diff --git a/src/main/java/bjc/rgens/parser/RecurLimitException.java b/src/main/java/bjc/rgens/parser/RecurLimitException.java new file mode 100644 index 0000000..faeffb3 --- /dev/null +++ b/src/main/java/bjc/rgens/parser/RecurLimitException.java @@ -0,0 +1,35 @@ +package bjc.rgens.parser; + +/** + * The exception thrown when a rule exceeds its recurrence limit + * + * @author student + */ +public class RecurLimitException extends GrammarException { + /* Serialization ID. */ + private static final long serialVersionUID = -7287427479316953668L; + + /** + * Create a new grammar exception with the specified message. + * + * @param msg + * The message for this exception. + */ + public RecurLimitException(String msg) { + super(msg); + } + + /** + * Create a new grammar exception with the specified message and + * cause. + * + * @param msg + * The message for this exception. + * + * @param cause + * The cause of this exception. + */ + public RecurLimitException(String msg, Exception cause) { + super(msg, cause); + } +} -- cgit v1.2.3