コード例 #1
0
  @Override
  protected void visit(RENode.Disjunction disjunction) throws RuntimeException {
    if (current != null) {
      RENode.Alternative alternative = disjunction.getAlternative();
      if (alternative != null) {
        alternative.accept(this);
      }
    } else {
      RENode.Alternative alternative = disjunction.getAlternative();
      if (alternative != null) {
        current = new Alternative();
        alternative.accept(this);
        current.suffix = current.buffer.toString();
        current.buffer.setLength(0);
        alternatives.add(current);
        current = null;
      }

      //
      RENode.Disjunction next = disjunction.getNext();
      if (next != null) {
        next.accept(this);
      }
    }
  }
コード例 #2
0
 @Override
 protected void visit(RENode.Alternative alternative) throws RuntimeException {
   alternative.getExpr().accept(this);
   RENode.Alternative next = alternative.getNext();
   if (next != null) {
     next.accept(this);
   }
 }