blob: 595397b4007bbb732bb5417045efbf4ad8e39f26 (
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
|
package bjc.rgens.parser.elements.vars;
import bjc.rgens.parser.GenerationState;
/**
* Case element which references a literal variable.
*
* @author Ben Culkin
*
*/
public class LiteralVariableElement extends VariableElement {
/**
* The name for the variable.
*/
public String val;
/**
* Create a case element which references a literal variable.
*
* @param forbidSpaces Whether to forbid spaces in the result.
* @param val The name of the literal variable.
*/
public LiteralVariableElement(boolean forbidSpaces, String val) {
super(forbidSpaces);
this.val = val;
}
@Override
public void generate(GenerationState state) {
state.appendContents(val);
}
}
|