summaryrefslogtreecommitdiff
path: root/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java
diff options
context:
space:
mode:
authorstudent <student@69.161.224.76>2018-03-29 11:38:02 -0400
committerstudent <student@69.161.224.76>2018-03-29 11:38:02 -0400
commit6aa15e30fa75211964428e386b4b6b0f2c66dbc5 (patch)
tree5beeb6016a94b284eeed80daf65b9c2800ec7e63 /RGens/src/main/java/bjc/rgens/newparser/RuleCase.java
parentc921b00c99cf46bc33f724581ab9bde2b0d8bb6a (diff)
Rename package
Diffstat (limited to 'RGens/src/main/java/bjc/rgens/newparser/RuleCase.java')
-rw-r--r--RGens/src/main/java/bjc/rgens/newparser/RuleCase.java87
1 files changed, 0 insertions, 87 deletions
diff --git a/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java b/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java
deleted file mode 100644
index 217d668..0000000
--- a/RGens/src/main/java/bjc/rgens/newparser/RuleCase.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package bjc.rgens.newparser;
-
-import bjc.utils.funcdata.IList;
-
-/*
- * @NOTE
- * If at some point we add new case types, they should go into subclasses,
- * not into this class.
- */
-/**
- * A case in a rule in a randomized grammar.
- *
- * @author EVE
- */
-public class RuleCase {
- /**
- * The possible types of a case.
- *
- * @author EVE
- */
- public static enum CaseType {
- /** A normal case, composed from a list of elements. */
- NORMAL,
- /** A case that doesn't insert spaces. */
- SPACEFLATTEN,
- /** A case that applies a regex after generation. */
- REGEX
- }
-
- /** The type of this case. */
- public final CaseType type;
-
- /**
- * The list of element values for this case.
- *
- * <h2>Used For</h2>
- * <dl>
- * <dt>NORMAL, SPACEFLATTEN</dt>
- * <dd>Used as the list of elementList the rule is composed of.</dd>
- * </dl>
- */
- protected IList<CaseElement> elementList;
-
- protected RuleCase(CaseType typ) {
- type = typ;
- }
-
- /**
- * Create a new case of the specified type that takes a element list
- * parameter.
- *
- * @param typ
- * The type of case to create.
- *
- * @param elements
- * The element list parameter of the case.
- *
- * @throws IllegalArgumentException
- * If this type doesn't take a element list parameter.
- */
- public RuleCase(CaseType typ, IList<CaseElement> elements) {
- this(typ);
-
- switch (typ) {
- case NORMAL:
- case SPACEFLATTEN:
- break;
- case REGEX:
- throw new IllegalArgumentException("This type requires an element list and a pattern");
- default:
- throw new IllegalArgumentException("This type doesn't have a element list parameter");
- }
-
- elementList = elements;
- }
-
- /**
- * Get the element list value of this type.
- *
- * @return
- * The element list value of this case, or null if this type
- * doesn't have one.
- */
- public IList<CaseElement> getElements() {
- return elementList;
- }
-}