Package com.blazebit.regex.node

Examples of com.blazebit.regex.node.Node


    return rootNode;
  }

  private Node parseTerm() {
    Node e = parseRepeat();

    if (hasNext() && !peek(")|")) {
      e.setNext(parseTerm());
    }

    return e;
  }
View Full Code Here


    return e;
  }

  private Node parseRepeat() {
    Node e = parseCharacterClass();
    char c;

    while ((c = next("?*+{")) != 0) {
      switch (c) {
      case '?':
View Full Code Here

      if (match('^')) {
        negate = true;
      }

      Node node = parseCharacterClasses();

      if (negate) {
        node = new ComplementNode(node);
      }
View Full Code Here

    } else if (match('(')) {
      if (match(')')) {
        return new EmptyNode();
      }

      Node e = parseUnion();

      if (!match(')')) {
        throw new IllegalArgumentException("expected ')' at position "
            + cursor);
      }
View Full Code Here

      this.hasMoreRequired = hasMoreRequired;
    }
  }

  private boolean moreRequiredExists(Node node, TraverseContext<V> context) {
    Node nextNode = node.getNext();

    while (nextNode != null) {
      if (!(nextNode instanceof OptionalNode)
          && (!(nextNode instanceof RepeatNode) || ((RepeatNode) nextNode)
              .getMin() == 0)) {
        return true;
      }

      nextNode = nextNode.getNext();
    }

    return false;
  }
View Full Code Here

TOP

Related Classes of com.blazebit.regex.node.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.