Token ch2 = this.getChild(1); if (ch2.type == CLOSURE && ch2.getChild(0) == ch) { ret = ch.toString(options)+"+"; } else if (ch2.type == NONGREEDYCLOSURE && ch2.getChild(0) == ch) { ret = ch.toString(options)+"+?"; } else ret = ch.toString(options)+ch2.toString(options); } else { StringBuffer sb = new StringBuffer(); for (int i = 0; i < this.children.size(); i ++) { sb.append(((Token)this.children.elementAt(i)).toString(options)); ret = this.getChild(0).toString(options)+"?"; } else if (this.children.size() == 2 && this.getChild(0).type == EMPTY) { ret = this.getChild(1).toString(options)+"??"; } else { StringBuffer sb = new StringBuffer(); sb.append(((Token)this.children.elementAt(0)).toString(options)); for (int i = 1; i < this.children.size(); i ++) { sb.append((char)'|'); sb.append(((Token)this.children.elementAt(i)).toString(options));
if (ch2.type == CLOSURE && ch2.getChild(0) == ch) ret = ch.toString(options) + "+"; ret = ch.toString(options) + "+?"; ret = ch.toString(options) + ch2.toString(options); for (int i = 0; i < this.children.size(); i++) sb.append(this.children.elementAt(i).toString(options)); ret = this.getChild(0).toString(options) + "?"; ret = this.getChild(1).toString(options) + "??"; sb.append(this.children.elementAt(0).toString(options)); for (int i = 1; i < this.children.size(); i++) sb.append(this.children.elementAt(i).toString(options));
public String toString(int options) { String ret; if (this.type == CLOSURE) { if (this.getMin() < 0 && this.getMax() < 0) { ret = this.child.toString(options)+"*"; } else if (this.getMin() == this.getMax()) { ret = this.child.toString(options)+"{"+this.getMin()+"}"; } else if (this.getMin() >= 0 && this.getMax() >= 0) { ret = this.child.toString(options)+"{"+this.getMin()+","+this.getMax()+"}"; } else if (this.getMin() >= 0 && this.getMax() < 0) { ret = this.child.toString(options)+"{"+this.getMin()+",}"; } else throw new RuntimeException("Token#toString(): CLOSURE " +this.getMin()+", "+this.getMax()); } else { if (this.getMin() < 0 && this.getMax() < 0) { ret = this.child.toString(options)+"*?"; } else if (this.getMin() == this.getMax()) { ret = this.child.toString(options)+"{"+this.getMin()+"}?"; } else if (this.getMin() >= 0 && this.getMax() >= 0) { ret = this.child.toString(options)+"{"+this.getMin()+","+this.getMax()+"}?"; } else if (this.getMin() >= 0 && this.getMax() < 0) { ret = this.child.toString(options)+"{"+this.getMin()+",}?"; } else throw new RuntimeException("Token#toString(): NONGREEDYCLOSURE " +this.getMin()+", "+this.getMax()); } return ret; } }
if (this.parennumber == 0) ret = "(?:" + this.child.toString(options) + ")"; ret = "(" + this.child.toString(options) + ")"; ret = "(?=" + this.child.toString(options) + ")"; break; case NEGATIVELOOKAHEAD: ret = "(?!" + this.child.toString(options) + ")"; break; case LOOKBEHIND: ret = "(?<=" + this.child.toString(options) + ")"; break; case NEGATIVELOOKBEHIND: ret = "(?<!" + this.child.toString(options) + ")"; break; case INDEPENDENT: ret = "(?>" + this.child.toString(options) + ")"; break;
if (this.type == CLOSURE) { if (this.getMin() < 0 && this.getMax() < 0) { ret = this.child.toString(options)+"*"; } else if (this.getMin() == this.getMax()) { ret = this.child.toString(options)+"{"+this.getMin()+"}"; } else if (this.getMin() >= 0 && this.getMax() >= 0) { ret = this.child.toString(options)+"{"+this.getMin()+","+this.getMax()+"}"; } else if (this.getMin() >= 0 && this.getMax() < 0) { ret = this.child.toString(options)+"{"+this.getMin()+",}"; } else throw new RuntimeException("Token#toString(): CLOSURE " } else { if (this.getMin() < 0 && this.getMax() < 0) { ret = this.child.toString(options)+"*?"; } else if (this.getMin() == this.getMax()) { ret = this.child.toString(options)+"{"+this.getMin()+"}?"; } else if (this.getMin() >= 0 && this.getMax() >= 0) { ret = this.child.toString(options)+"{"+this.getMin()+","+this.getMax()+"}?"; } else if (this.getMin() >= 0 && this.getMax() < 0) { ret = this.child.toString(options)+"{"+this.getMin()+",}?"; } else throw new RuntimeException("Token#toString(): NONGREEDYCLOSURE "
public String toString(int options) { String ret = null; switch (this.type) { case PAREN: if (this.parennumber == 0) { ret = "(?:"+this.child.toString(options)+")"; } else { ret = "("+this.child.toString(options)+")"; } break; case LOOKAHEAD: ret = "(?="+this.child.toString(options)+")"; break; case NEGATIVELOOKAHEAD: ret = "(?!"+this.child.toString(options)+")"; break; case LOOKBEHIND: ret = "(?<="+this.child.toString(options)+")"; break; case NEGATIVELOOKBEHIND: ret = "(?<!"+this.child.toString(options)+")"; break; case INDEPENDENT: ret = "(?>"+this.child.toString(options)+")"; break; } return ret; } }
public String toString() { return this.toString(0); } public String toString(int options) {
/** * Represents this instance in String. */ @Override public String toString() { return this.tokentree.toString(this.options); }
@Override public String toString(int options) { return "(?" + (this.add == 0 ? "" : REUtil.createOptionString(this.add)) + (this.mask == 0 ? "" : REUtil.createOptionString(this.mask)) + ":" + this.child.toString(options) + ")"; } }
@Override public String toString() { return this.toString(0); } public String toString(int options) {
@Override public String toString(int options) { String ret; if (this.child2.type == CLOSURE && this.child2.getChild(0) == this.child) { ret = this.child.toString(options)+"+"; } else if (this.child2.type == NONGREEDYCLOSURE && this.child2.getChild(0) == this.child) { ret = this.child.toString(options)+"+?"; } else ret = this.child.toString(options)+this.child2.toString(options); return ret; } }
public String toString(int options) { return "(?" +(this.add == 0 ? "" : REUtil.createOptionString(this.add)) +(this.mask == 0 ? "" : REUtil.createOptionString(this.mask)) +":" +this.child.toString(options) +")"; } }
/** * Represents this instence in String. */ public String toString() { return this.tokentree.toString(this.options); }
public String toString(int options) { String ret; if (this.child2.type == CLOSURE && this.child2.getChild(0) == this.child) { ret = this.child.toString(options)+"+"; } else if (this.child2.type == NONGREEDYCLOSURE && this.child2.getChild(0) == this.child) { ret = this.child.toString(options)+"+?"; } else ret = this.child.toString(options)+this.child2.toString(options); return ret; } }