|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--coins.casttohir.ParseString
ParseString class Parse given String operand. Successive call of getNextToken() will return tokens in the given string successively. The token kind is one of DIGITS, IDENTIFIER, STRING, DELIMITER, UNKNOWN The token kind are listed up as public static final int item in this class. DIGITS is a string consisting of digit character only. IDENTIFIER is a string consisting of alphabet (upper case and lower case), digits, and special characters specified by the parameter pSpIdChars. IDENTIFIER does not begin with digit. STRING is a character string starting with '"' and ending with '"'. DELIMITER is a character specified by the parameter pDelimiters. Characters indicated by the parameter pSpaces are skipped in the parsing operation. To see if there is no more token left, call hasNext(). If there is no token remaining, getNextToken() will return ""; If token kind is undefined, getNextToken() will return "".
フィールドの概要 | |
(パッケージプライベート) static java.lang.String[] |
alphabetCharacters
|
static int |
DELIMITER
|
(パッケージプライベート) static java.lang.String[] |
digitCharacters
|
static int |
DIGITS
|
static int |
IDENTIFIER
|
static int |
STRING
|
static int |
UNDEFINED
|
コンストラクタの概要 | |
ParseString(java.lang.String pText,
java.util.Set pDelimiters,
java.util.Set pSpaces,
java.util.Set pIdSpChars)
ParseString constructor Example: ParseString lParseString = new ParseString( "#param %I32, %I32, w%I32\n", fromStringToSet("#%,\n"), fromStringToSet(" \t"), fromStringToSet("_")); |
メソッドの概要 | |
(パッケージプライベート) java.lang.String |
characterString()
|
(パッケージプライベート) java.lang.String |
digitString()
|
static java.util.Set |
fromStringToSet(java.lang.String pString)
Make a set of Strings by taking out characters contained in the parameter pString and changing each character to a string of length 1. |
java.lang.String |
getNextToken()
getNextToken Get the next token and advance the token position. |
int |
getTokenKind()
Get the token kind of the token returned by getNextToken(). |
boolean |
hasNext()
|
(パッケージプライベート) java.lang.String |
identifierString()
|
java.lang.String |
seeCurrentToken()
getNextToken Get the next token and advance the token position. |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
public static final int UNDEFINED
public static final int IDENTIFIER
public static final int DELIMITER
public static final int DIGITS
public static final int STRING
static final java.lang.String[] alphabetCharacters
static final java.lang.String[] digitCharacters
コンストラクタの詳細 |
public ParseString(java.lang.String pText, java.util.Set pDelimiters, java.util.Set pSpaces, java.util.Set pIdSpChars)
pText
- Text string to be parsed.pDelimiters
- Set of character strings (character in the form of String)
to be treated as a delimiting token.pSpaces
- Set of character strings to be treated
as a space (not a token).pIdSpChars
- Set of special character (non-alphanumeric character)
strings used in identifiers.メソッドの詳細 |
public boolean hasNext()
public java.lang.String getNextToken()
public java.lang.String seeCurrentToken()
public int getTokenKind()
public static java.util.Set fromStringToSet(java.lang.String pString)
pString
- specifies the characters to be included in the resultant set.
java.lang.String digitString()
java.lang.String characterString()
java.lang.String identifierString()
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |