summaryrefslogtreecommitdiff
path: root/src/main/java/bjc/rgens/parser/RuleCase.java
diff options
context:
space:
mode:
authorBenjamin J. Culkin <bjculkin@mix.wvu.edu>2020-11-11 12:29:59 -0400
committerBenjamin J. Culkin <bjculkin@mix.wvu.edu>2020-11-11 12:29:59 -0400
commit80aa147aedc91356276d4346efb1ea62ea5b06f9 (patch)
treea57c8f2ad3a7e68ba1c0a5a2bea573a8da277ab6 /src/main/java/bjc/rgens/parser/RuleCase.java
parentc88c846b75dbc806db19a2e3a907bff21fd0c273 (diff)
parente9e0ca7bfe722375e7ccb25d2bafbe395b6c6a59 (diff)
Merge branch 'master' of https://github.com/bculkin2442/rgens
Diffstat (limited to 'src/main/java/bjc/rgens/parser/RuleCase.java')
-rwxr-xr-xsrc/main/java/bjc/rgens/parser/RuleCase.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/main/java/bjc/rgens/parser/RuleCase.java b/src/main/java/bjc/rgens/parser/RuleCase.java
index dacb16e..3cfe81d 100755
--- a/src/main/java/bjc/rgens/parser/RuleCase.java
+++ b/src/main/java/bjc/rgens/parser/RuleCase.java
@@ -15,14 +15,25 @@ import java.util.List;
* @author EVE
*/
public abstract class RuleCase {
+ /**
+ * Debugging name for this case.
+ */
public String debugName;
+ /**
+ * Serial number for this case.
+ */
public final int serial;
-
private static int nextSerial = 0;
+ /**
+ * The rule this case belongs to.
+ */
public Rule belongsTo;
+ /**
+ * The elements that make up this case.
+ */
public List<CaseElement> elementList;
/**
@@ -40,10 +51,23 @@ public abstract class RuleCase {
nextSerial += 1;
}
+ /**
+ * Generate this case.
+ *
+ * @param state The state to use.
+ */
public abstract void generate(GenerationState state);
+ /**
+ * Create a new case with a different set of elements.
+ *
+ * @param elements The elements for this case.
+ *
+ * @return The case with the same settings, but a different set of elements.
+ */
public abstract RuleCase withElements(List<CaseElement> elements);
+ @Override
public String toString() {
if(debugName != null) {
return String.format("Case %s (#%d) of %s", debugName, serial, belongsTo);