blob: efd900781ba678a32b4307d5eb7412edf4faf6f3 (
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.elements.vars;
import bjc.rgens.parser.GenerationState;
/*
* @TODO
*
* finish when template vars are implemented.
*/
@SuppressWarnings("javadoc")
public class TRefVariableElement extends VariableElement {
public String value;
public TRefVariableElement(boolean forbidSpaces, String val) {
super(forbidSpaces);
value = val;
}
@Override
public void generate(GenerationState state) {
/*
if(!state.rlVars.containsKey(val)) {
throw new GrammarException("No rule variable named " + val);
}
Rule rl = state.rlVars.get(val);
GenerationState newState = state.newBuf();
rl.generate(newState);
String res = newState.contents.toString();
if(forbidSpaces && res.contains(" ")) {
throw new GrammarException("Spaces not allowed in this context (rule-var %s)");
}
return res;
*/
}
}
|