protected void visit(RENode.CharacterClassExpr.Not expr) throws IOException { boolean needBrace = false; for (RENode current = expr.getParent();current != null;current = current.getParent()) { if (current instanceof RENode.CharacterClassExpr.Or) { needBrace = true; break; } else if (current instanceof RENode.CharacterClassExpr.And) { needBrace = true; break; } else if (current instanceof RENode.CharacterClassExpr.Not) { needBrace = true; break; } } if (needBrace) { appendable.append("["); } appendable.append("^"); expr.getNegated().accept(this); if (needBrace) { appendable.append(']'); } }
RENode.CharacterClassExpr nested = ((RENode.CharacterClassExpr.Not)negated).getNegated(); if (nested != null) { nested.accept(this);
RENode.CharacterClassExpr nested = ((RENode.CharacterClassExpr.Not)negated).getNegated(); if (nested != null) { nested.accept(this);
protected void visit(RENode.CharacterClassExpr.Not expr) throws IOException { boolean needBrace = false; for (RENode current = expr.getParent();current != null;current = current.getParent()) { if (current instanceof RENode.CharacterClassExpr.Or) { needBrace = true; break; } else if (current instanceof RENode.CharacterClassExpr.And) { needBrace = true; break; } else if (current instanceof RENode.CharacterClassExpr.Not) { needBrace = true; break; } } if (needBrace) { appendable.append("["); } appendable.append("^"); expr.getNegated().accept(this); if (needBrace) { appendable.append(']'); } }
@Override protected void visit(RENode.CharacterClass expr) throws RuntimeException { expr.getExpr().accept(this); for (int i = expr.getMin();i > 0;i--) { if (solver.hasNext()) { char c = solver.next(); current.resolvingExpression.append(c); current.buffer.append(c); solver.reset(); } else { throw new UnsupportedOperationException("wtf?"); } } }
@Override protected void visit(RENode.CharacterClass expr) throws RuntimeException { expr.getExpr().accept(this); for (int i = expr.getMin();i > 0;i--) { if (solver.hasNext()) { char c = solver.next(); current.resolvingExpression.append(c); current.buffer.append(c); solver.reset(); } else { throw new UnsupportedOperationException("wtf?"); } } }
protected void visit(RENode.CharacterClass expr) throws E { expr.getExpr().accept(this); }
protected void visit(RENode.CharacterClass expr) throws E { expr.getExpr().accept(this); }
@Override public CharacterClassExpr remove(char c) { this.negated.get().remove(c); return this; }
@Override public CharacterClassExpr replace(char src, char dst) { CharacterClassExpr repl = remove(src); if (repl != this) { Or or = new Or(null, new Char(dst)); repl.replaceBy(or); or.setLeft(repl); repl = or; } return repl; }
protected void visit(RENode.CharacterClass expr) throws IOException { appendable.append("["); expr.getExpr().accept(this); appendable.append("]"); if (expr.getQuantifier() != null) { expr.getQuantifier().toString(appendable); } }
@Override protected void visit(RENode.CharacterClass expr) throws MalformedRouteException { RENode.CharacterClassExpr ccExpr = expr.getExpr(); ccExpr = ccExpr.replace(src, dst); // RENode.CharacterClassExpr.And ccRepl = new RENode.CharacterClassExpr.And(null, new RENode.CharacterClassExpr.Not(new RENode.CharacterClassExpr.Char('/'))); // ccExpr.replaceBy(ccRepl); // ccRepl.setLeft(ccExpr); } }
protected void visit(RENode.CharacterClassExpr.Not expr) throws E { RENode.CharacterClassExpr negated = expr.getNegated(); if (negated != null) { negated.accept(this); } }