blob: 505581027496c792fdb69a1b8572e7e5e6644498 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
package bjc.rgens.parser;
import bjc.rgens.parser.elements.CaseElement;
import java.util.List;
/**
* A rule case that inserts nothing in between case elements.
*
* @author Ben Culkin
*/
public class FlatRuleCase extends RuleCase {
/**
* Create a new flat rule case.
*
* @param elms
* The case elements that make up this case.
*/
public FlatRuleCase(List<CaseElement> elms) {
super(elms);
}
@Override
public void generate(GenerationState state) {
for(CaseElement elm : elementList) {
elm.generate(state);
}
}
/**
* Create a new flat rule case with the given case elements.
*
* @param elms
* The elements to use for the rule case.
*
* @return A flat rule case, with the given elements.
*/
public FlatRuleCase withElements(List<CaseElement> elms) {
return new FlatRuleCase(elms);
}
}
|