// MetaGrammar //////////////////////////////////////////////////////////////////////////////
- public PreSequence _amp_(PreSequence p, Object[] o) { return p.and(new PreSequence(o, null).buildSequence(null, true, false, true)); }
- public PreSequence _amp__tilde_(PreSequence p, Object[] o) { return p.not(new PreSequence(o, null).buildSequence(null, true, false, true)); }
+ public PreSequence _amp_(PreSequence p, Object[] o) { return p.and(new PreSequence(o, null).buildSequence(null, true, false)); }
+ public PreSequence _amp__tilde_(PreSequence p, Object[] o) { return p.not(new PreSequence(o, null).buildSequence(null, true, false)); }
public Element epsilon(Object o, Object b) { return Union.epsilon; }
public Object _leftparen__rightparen_(Object o) { return Union.epsilon; }
public Element _rightparen_(Object e) { return SELF; }
HashSet<Sequence> temp = new HashSet<Sequence>();
for(PreSequence pre : s[i]) {
pre.not.addAll(seqs);
- Sequence seq = pre.buildSequence(n, false, dropAll, false);
+ Sequence seq = pre.buildSequence(n, false, dropAll);
temp.add(seq);
n.add(seq);
}
u.add(buildSequence(u));
return u;
}
- public Sequence buildSequence(Union u) { return buildSequence(u, false, false, false); }
- public Sequence buildSequence(Union u, boolean lame, boolean dropAll, boolean keeper) {
+ public Sequence buildSequence(Union u) { return buildSequence(u, false, false); }
+ public Sequence buildSequence(Union u, boolean lame, boolean dropAll) {
for(Sequence s : and) u.add(s);
for(Sequence s : not) u.add(s);
HashSet<Sequence> set = new HashSet<Sequence>();
}
}
Element[] expansion = o2;
- Sequence ret = dropAll || lame || keeper ? Sequence.drop(expansion, and, not, lame) : null;
- if (ret==null && tag!=null) ret = Sequence.rewritingSequence(tag, expansion, drops, and, not);
- if (ret==null) {
+ Sequence ret = null;
+ if (dropAll || lame) ret = Sequence.drop(expansion, and, not, lame);
+ else if (tag!=null) ret = Sequence.rewritingSequence(tag, expansion, drops, and, not);
+ else {
int idx = -1;
for(int i=0; i<expansion.length; i++) {
if (!drops[i]) idx = i;