diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2018-06-07 20:37:51 -0300 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2018-06-07 20:37:51 -0300 |
| commit | 44a8d9d2d56a311293ec86ea40df7126748300a1 (patch) | |
| tree | cc53c34a97a403ddb4a8d112f09124ee42c4507a /src/main/java/bjc/rgens/parser/RegexRuleCase.java | |
| parent | 7422af49fa5c4da57323abe676a99468d401c44b (diff) | |
Refactoring
The main refactoring here is removing the type field from the various
classes, but there are a few other smaller ones.
This also contains the grounds for a refactoring on variable use
Diffstat (limited to 'src/main/java/bjc/rgens/parser/RegexRuleCase.java')
| -rwxr-xr-x | src/main/java/bjc/rgens/parser/RegexRuleCase.java | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/src/main/java/bjc/rgens/parser/RegexRuleCase.java b/src/main/java/bjc/rgens/parser/RegexRuleCase.java index 3a8a8ad..3c57489 100755 --- a/src/main/java/bjc/rgens/parser/RegexRuleCase.java +++ b/src/main/java/bjc/rgens/parser/RegexRuleCase.java @@ -6,31 +6,22 @@ import bjc.utils.funcdata.IList; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; +/* + * @TODO + * + * Actually implement this + */ public class RegexRuleCase extends RuleCase { - private Pattern patt; + public RegexRuleCase(IList<CaseElement> elements) { + super(elements); - public RegexRuleCase(IList<CaseElement> elements, String pattern) { - super(CaseType.REGEX, elements); - - elementList = elements; - - try { - patt = Pattern.compile(pattern); - } catch (PatternSyntaxException psex) { - IllegalArgumentException iaex = - new IllegalArgumentException("This type requires a valid regular expression parameter"); - - iaex.initCause(psex); - - throw iaex; - } - } - - public Pattern getPattern() { - return patt; } public void generate(GenerationState state) { } + + public RegexRuleCase withElements(IList<CaseElement> elements) { + return new RegexRuleCase(elements); + } } |
