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(']'); } }
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(']'); } }
private void negate(RENode.CharacterClassExpr negated) throws RuntimeException { if (negated instanceof RENode.CharacterClassExpr.Not) { RENode.CharacterClassExpr nested = ((RENode.CharacterClassExpr.Not)negated).getNegated(); if (nested != null) { nested.accept(this);
private void negate(RENode.CharacterClassExpr negated) throws RuntimeException { if (negated instanceof RENode.CharacterClassExpr.Not) { RENode.CharacterClassExpr nested = ((RENode.CharacterClassExpr.Not)negated).getNegated(); if (nested != null) { nested.accept(this);
protected void visit(RENode.CharacterClassExpr.Not expr) throws E { RENode.CharacterClassExpr negated = expr.getNegated(); if (negated != null) { negated.accept(this); } }
@Override protected void visit(RENode.CharacterClassExpr.Not expr) throws RuntimeException { RENode.CharacterClassExpr negated = expr.getNegated(); if (negated == null) { // Do nothing ? } else { negate(negated); } }
protected void visit(RENode.CharacterClassExpr.Not expr) throws E { RENode.CharacterClassExpr negated = expr.getNegated(); if (negated != null) { negated.accept(this); } }
@Override protected void visit(RENode.CharacterClassExpr.Not expr) throws RuntimeException { RENode.CharacterClassExpr negated = expr.getNegated(); if (negated == null) { // Do nothing ? } else { negate(negated); } }