- public Union nonTerminal(String str, PreSequence[][] s, boolean synthetic, boolean dropAll) {
- Union n = nonTerminal(str, synthetic, dropAll);
- if (s == null || s.length==0) { n.add(Sequence.empty); return n; }
- HashSet<Sequence> seqs = new HashSet<Sequence>();
- for(int i=0; i<s.length; i++) {
- if (s[i]==null) continue;
- HashSet<Sequence> temp = new HashSet<Sequence>();
- for(PreSequence pre : s[i]) {
- pre.not.addAll(seqs);
- Sequence seq = pre.buildSequence(n, false, dropAll);
- temp.add(seq);
- n.add(seq);
- }
- seqs.addAll(temp);
- }
- return n;
- }
-
- public String stringify(String s) { return StringUtil.unescapify(s); }
- public char unescape(char x, char c) { return unescape(c); }
- public char unescape(char c) { return StringUtil.unescapify("\\"+c).charAt(0); }