Ejemplo n.º 1
0
 /**
  * Increment the string pointer by each character in
  *
  * <pre>st</pre>
  *
  * that matches a non-escaped character.
  */
 public boolean incMatch(String st) {
   StrPos sp = new StrPos(this);
   int i;
   for (i = 0; i < st.length(); i++) {
     if (!sp.match(st.charAt(i))) return false;
     sp.inc();
   }
   dup(sp);
   return true;
 }
Ejemplo n.º 2
0
 /** Read in an integer. */
 public patInt getPatInt() {
   patInt pi = null;
   if (incMatch("inf")) return new patInf();
   int i, cnt = 0;
   StrPos sp = new StrPos(this);
   for (i = 0; !sp.eos && sp.c >= '0' && sp.c <= '9'; i++) {
     cnt = 10 * cnt + sp.c - '0';
     sp.inc();
   }
   if (i == 0) return null;
   dup(sp);
   return new patInt(cnt);
 }