Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD


Class COM.stevesoft.pat.StrPos

java.lang.Object
  |
  +--COM.stevesoft.pat.StrPos

public class StrPos
extends java.lang.Object

StrPos is used internally by regex to parse the regular expression.


Field Summary
char esc
          This contains the escape character, which is \ by default.
 
Constructor Summary
StrPos(StrPos sp)
          initialize a StrPos from another StrPos.
StrPos(java.lang.String s, int pos)
          Initialize a StrPos by giving it a String, and a position within the String.

 
Method Summary
void dup(StrPos sp)
          copy a StrPos from sp to this.
boolean eos()
          tell whether we are at end of string
boolean escaped()
          Returns true if the current character is escaped (preceeded by "\").
boolean escMatch(char ch)
          As match, but only matches if the character is escaped.
patInt getPatInt()
          Read in an integer.
java.lang.String getString()
          get the string that we are processing.
boolean incMatch(java.lang.String st)
          Increment the string pointer by each character in
st
that matches a non-escaped character.
StrPos inc()
          Advance the place where StrPos points within the String.
boolean match(char ch)
          Compare the (possibly escaped) character pointed to by StrPos.
int pos()
          Return the position in the string pointed to
char thisChar()
          Returns the current, possibly escaped, character.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

esc

public char esc
This contains the escape character, which is \ by default.
Constructor Detail

StrPos

public StrPos(StrPos sp)
initialize a StrPos from another StrPos.

StrPos

public StrPos(java.lang.String s,
              int pos)
Initialize a StrPos by giving it a String, and a position within the String.
Method Detail

pos

public int pos()
Return the position in the string pointed to

thisChar

public char thisChar()
Returns the current, possibly escaped, character.

eos

public boolean eos()
tell whether we are at end of string

dup

public void dup(StrPos sp)
copy a StrPos from sp to this.

inc

public StrPos inc()
Advance the place where StrPos points within the String. Counts a backslash as part of the next character.

match

public boolean match(char ch)
Compare the (possibly escaped) character pointed to by StrPos. Return true if they are the same, but lways return if character pointed to is escaped.

escMatch

public boolean escMatch(char ch)
As match, but only matches if the character is escaped.

escaped

public boolean escaped()
Returns true if the current character is escaped (preceeded by "\").

incMatch

public boolean incMatch(java.lang.String st)
Increment the string pointer by each character in
st
that matches a non-escaped character.

getPatInt

public patInt getPatInt()
Read in an integer.

getString

public java.lang.String getString()
get the string that we are processing.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD