return ret.toString();
}
- // FIXME
private static HashSet<Element> dropAll = new HashSet<Element>();
// Statics //////////////////////////////////////////////////////////////////////////////
public Union nonTerminal(String s) { return nonTerminal(s, null, false, false); }
public Union _colon__colon__equals_(String s, PreSequence[][] p) { return nonTerminal(s, p, false, false); }
public Union _bang__colon__colon__equals_(String s, PreSequence[][] p) { return nonTerminal(s, p, false, true); }
- public Union _colon__colon__equals_(boolean q, String s, PreSequence[][] p) { return nonTerminal(s, p, false, q); }
public Object _leftparen_(PreSequence[][] p) { return nonTerminal("anon"+(anon++), p, false, false); }
public Union nonTerminal(String str, PreSequence[][] s, boolean synthetic, boolean dropAll) {
Union n = str.equals(startSymbol) ? g : nt.get(str);
if (o2==null) o2 = new Object[0];
Object[] o3 = new Object[o1.length + o2.length + 1];
System.arraycopy(o1, 0, o3, 0, o1.length);
- o3[o1.length] = new MyLift(s);
+ o3[o1.length] = string(s);
System.arraycopy(o2, 0, o3, o1.length+1, o2.length);
- return new PreSequence(o3);
+ PreSequence ret = new PreSequence(o3, s);
+ ret.drops[o1.length] = o3.length>1;
+ return ret;
}
public PreSequence _slash_(PreSequence p, Object sep) { return p.sparse(sep); }
return set(ret);
}
- public class MyLift {
- public final String s;
- public MyLift(String s) { this.s = s; }
- }
-
public class PreSequence {
public final HashSet<Sequence> and = new HashSet<Sequence>();
public final HashSet<Sequence> not = new HashSet<Sequence>();
for(int i=0; i<o.length; i++) {
Object oi = o[i];
if (oi==SELF) o2[j] = u.new Subset("(("+u+"))", set);
- else if (oi instanceof MyLift) { o2[j] = string(tag = ((MyLift)oi).s); drops[j] = o.length>1; }
else o2[j] = (Element)oi;
if (MetaGrammar.dropAll.contains(o2[j])) drops[j] = true;