- static class Constant extends Sequence {
- private final Object result;
- public Constant(Element[] e, Object result) {
- super(e);
- if (result==null) throw new Error("constant sequences may not have result==null");
- this.result = result;
- }
- Sequence _clone() { return new Constant(elements, result); }
- public <T> Forest<T> postReduce(Input.Region loc, Forest<T>[] args, Position p) {
- return (Forest<T>)Forest.create(loc, result, null, false);
- }
- Forest epsilonForm(Input.Region loc, Grammar cache) {
- return Forest.create(loc, result, null, false);
- }
- }
-