public class StrPos extends Object
Modifier and Type | Field and Description |
---|---|
char |
esc
This contains the escape character, which is \ by default.
|
Constructor and Description |
---|
StrPos(String s,
int pos)
Initialize a StrPos by giving it a String, and a
position within the String.
|
StrPos(StrPos sp)
initialize a StrPos from another StrPos.
|
Modifier and Type | Method and Description |
---|---|
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.
|
String |
getString()
get the string that we are processing.
|
StrPos |
inc()
Advance the place where StrPos points within the String.
|
boolean |
incMatch(String st)
Increment the string pointer by each character in
st that matches a non-escaped
character.
|
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.
|
public StrPos(StrPos sp)
public StrPos(String s, int pos)
public int pos()
public char thisChar()
public boolean eos()
public void dup(StrPos sp)
public StrPos inc()
public boolean match(char ch)
public boolean escMatch(char ch)
public boolean escaped()
public boolean incMatch(String st)
stthat matches a non-escaped character.
public patInt getPatInt()
public String getString()