1 8 13 package jfun.parsec.pattern; 14 15 31 public abstract class Pattern implements java.io.Serializable { 32 35 public static final int MISMATCH = -1; 36 44 public abstract int match(CharSequence src, int len, int from); 45 54 public final Pattern seq(final Pattern p2){ 55 return Patterns.seq(this, p2); 56 } 57 61 public final Pattern optional(){ 62 return Patterns.optional(this); 63 } 64 69 public final Pattern many(){ 70 return Patterns.many(this); 71 } 72 78 public final Pattern many(int min){ 79 return Patterns.many(min, this); 80 } 81 86 public final Pattern many1(){ 87 return Patterns.many(1, this); 88 } 89 95 public final Pattern some(final int max){ 96 return Patterns.some(max, this); 97 } 98 106 public final Pattern some(final int min, final int max){ 107 return Patterns.some(min, max, this); 108 } 109 114 public final Pattern not(){ 115 return Patterns.not(this); 116 } 117 122 public final Pattern peek(){ 123 return Patterns.peek(this); 124 } 125 126 134 public final Pattern ifelse(final Pattern yes, final Pattern no){ 135 return Patterns.ifelse(this, yes, no); 136 } 137 142 public final Pattern repeat(final int n){ 143 return Patterns.repeat(n, this); 144 } 145 } 146 | Popular Tags |