- public Constant(Element[] e, Object result, HashSet<Sequence> and, HashSet<Sequence> not) { super(e, and, not); this.result = result; }
- public Sequence and(Sequence s) { Sequence ret = new Constant(elements, result, needs, hates); ret.needs(s); return ret; }
- public Sequence not(Sequence s) { Sequence ret = new Constant(elements, result, needs, hates); ret.hates(s); return ret; }
- public <T> Forest<T> postReduce(Input.Location loc, Forest<T>[] args) {
- return (Forest<T>)Forest.leaf(loc, result);
- }
- static class Drop extends Constant {
- public Drop(Element[] e, HashSet<Sequence> and, HashSet<Sequence> not, boolean lame) {
- super(e, null, and, not);
- this.lame = lame;
- }
+ 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);