public Element _rightparen_(Object e) { return SELF; }
public PreSequence _amp_(PreSequence p, Object[] o) {
- p.needs.add(new PreSequence(o, null, true));
+ p.needs.add(new PreSequence(o, null, true).buildSequence(null, true, false));
return p;
}
public PreSequence _amp__tilde_(PreSequence p, Object[] o) {
- p.hates.add(new PreSequence(o, null, true));
+ p.hates.add(new PreSequence(o, null, true).buildSequence(null, true, false));
return p;
}
if (s[i]==null) continue;
HashSet<Sequence> temp = new HashSet<Sequence>();
for(PreSequence pre : s[i]) {
- pre.hatess.addAll(seqs);
+ pre.hates.addAll(seqs);
Sequence seq = pre.buildSequence(n, false, dropAll);
temp.add(seq);
- //for(Sequence dom : seqs) seq.hates.add(dom);
n.add(seq);
}
seqs.addAll(temp);
}
public static class PreSequence {
- public final HashSet<PreSequence> needs = new HashSet<PreSequence>();
- public final HashSet<PreSequence> hates = new HashSet<PreSequence>();
- public final HashSet<Sequence> hatess = new HashSet<Sequence>();
+ public final HashSet<Sequence> needs = new HashSet<Sequence>();
+ public final HashSet<Sequence> hates = new HashSet<Sequence>();
public /*final*/ String tag;
public final Object[] o;
public final boolean keeper;
}
public Sequence buildSequence(Union u) { return buildSequence(u, false, false); }
public Sequence buildSequence(Union u, boolean lame, boolean dropAll) {
-
- HashSet<Sequence> and = new HashSet<Sequence>();
- HashSet<Sequence> not = new HashSet<Sequence>();
- for(PreSequence p : needs) {
- Sequence ps = p.buildSequence(u, true, dropAll);
- u.add(ps);
- and.add(ps);
- }
- for(Sequence p : hatess) not.add(p);
- for(PreSequence p : hates) {
- Sequence ps = p.buildSequence(u, true, dropAll);
- u.add(ps);
- not.add(ps);
- }
-
+ HashSet<Sequence> and = needs;
+ HashSet<Sequence> not = hates;
+ for(Sequence s : and) u.add(s);
+ for(Sequence s : not) u.add(s);
HashSet<Sequence> set = new HashSet<Sequence>();
Element[] expansion = expand(u, set);
boolean keeper = this.keeper;
public static final Tree meta =
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
// DO NOT EDIT STUFF BELOW: IT IS AUTOMATICALLY GENERATED
new Tree(null, "gram", new Tree[] { new Tree(null, null, new Tree[] { }),
new Tree(null, "grammar", new Tree[] { new Tree(null, null, new Tree[] { new Tree(null, "::=", new Tree[] { new Tree(null, null, new Tree[] { new Tree(null, "s", new Tree[] { })}),