public final class ParseHelper extends Object
コンストラクタと説明 |
---|
ParseHelper() |
ParseHelper(ParseOptions options) |
修飾子とタイプ | メソッドと説明 |
---|---|
void |
check(Input in,
char expected)
現在位置の文字が期待通りの文字かチェックする.
|
void |
checkNext(Input in,
char expected)
現在位置の次の文字が期待通りの文字かチェックする.
|
void |
checkWord(Input in,
String expected)
現在位置から始まる文字列が期待通りの文字列で始まるかどうかチェックする.
|
String |
parseAbc(Input in)
'A' から'Z' もしくは'a' から'z' の
いずれかのみで構成される文字列を読み取って返す. |
String |
parseAbc123_$(Input in)
'A' から'Z' 、'a' から'z' 、
'0' から'9' もしくは'_' と'$' の
いずれかのみで構成される文字列を読み取って返す. |
String |
parseAbc123(Input in)
'A' から'Z' 、'a' から'z'
もしくは'0' から'9' の
いずれかのみで構成される文字列を読み取って返す. |
Double |
parseNumber(Input in)
浮動小数点数を読み取って返す.
|
String |
parseQuotedString(Input in)
引用符で囲われた文字列を読み取って返す.
|
String |
parseRawString(Input in)
空白文字以外から構成される文字列を読み取って返す.
|
String |
parseUntil(Input in,
char c0)
引数で指定された文字が現れる前の文字列を読み取ってを返す.
|
String |
parseUntil(Input in,
char c0,
char c1)
引数で指定された文字が現れる前の文字列を読み取ってを返す.
|
String |
parseUntil(Input in,
char c0,
char c1,
char c2)
引数で指定された文字が現れる前の文字列を読み取ってを返す.
|
void |
skipComment(Input in)
コメントをスキップする.
|
void |
skipWhitespace(Input in)
空白文字をスキップする.
|
void |
skipWhitespaceWith(Input in,
char ch)
引数で指定された文字とともに空白文字をスキップする.
|
void |
skipWhitespaceWith(Input in,
char ch0,
char ch1)
引数で指定された文字とともに空白文字をスキップする.
|
void |
skipWhitespaceWith(Input in,
char ch0,
char ch1,
char ch2)
引数で指定された文字とともに空白文字をスキップする.
|
void |
skipWord(Input in,
String word)
引数で指定された文字列をスキップする.
|
public ParseHelper()
public ParseHelper(ParseOptions options)
public void skipWhitespace(Input in) throws ParseException
ParseOptions.skipCommentWithWhitespace
がtrue
の場合コメントもスキップする。in
- 入力データParseException
- 空白文字のスキップ中にエラーが発生した場合public void skipWhitespaceWith(Input in, char ch) throws ParseException
in
- 入力データch
- スキップ対象文字ParseException
- 空白文字のスキップ中にエラーが発生した場合public void skipWhitespaceWith(Input in, char ch0, char ch1) throws ParseException
in
- 入力データch0
- スキップ対象文字ch1
- スキップ対象文字ParseException
- 空白文字のスキップ中にエラーが発生した場合public void skipWhitespaceWith(Input in, char ch0, char ch1, char ch2) throws ParseException
in
- 入力データch0
- スキップ対象文字ch1
- スキップ対象文字ch2
- スキップ対象文字ParseException
- 空白文字のスキップ中にエラーが発生した場合public void skipComment(Input in) throws ParseException
in
- 入力データParseException
- コメントのスキップ中にエラーが発生した場合public void skipWord(Input in, String word) throws ParseException
in
- 入力データword
- スキップする文字列ParseException
- 文字列のスキップ中にエラーが発生した場合public String parseRawString(Input in) throws ParseException
in
- 入力データParseException
- 文字列の読み取り中にエラーが発生した場合public Double parseNumber(Input in) throws ParseException
in
- 入力データParseException
- 浮動小数点数の読み取り中にエラーが発生した場合public String parseUntil(Input in, char c0) throws ParseException
in
- 入力データc0
- 読み取りを終える文字ParseException
- 文字列の読み取り中にエラーが発生した場合public String parseUntil(Input in, char c0, char c1) throws ParseException
in
- 入力データc0
- 読み取りを終える文字c1
- 読み取りを終える文字ParseException
- 文字列の読み取り中にエラーが発生した場合public String parseUntil(Input in, char c0, char c1, char c2) throws ParseException
in
- 入力データc0
- 読み取りを終える文字c1
- 読み取りを終える文字c2
- 読み取りを終える文字ParseException
- 文字列の読み取り中にエラーが発生した場合public String parseAbc(Input in) throws ParseException
'A'
から'Z'
もしくは'a'
から'z'
の
いずれかのみで構成される文字列を読み取って返す.in
- 入力データParseException
- 文字列の読み取り中にエラーが発生した場合public String parseAbc123(Input in) throws ParseException
'A'
から'Z'
、'a'
から'z'
もしくは'0'
から'9'
の
いずれかのみで構成される文字列を読み取って返す.in
- 入力データParseException
- 文字列の読み取り中にエラーが発生した場合public String parseAbc123_$(Input in) throws ParseException
'A'
から'Z'
、'a'
から'z'
、
'0'
から'9'
もしくは'_'
と'$'
の
いずれかのみで構成される文字列を読み取って返す.in
- 入力データParseException
- 文字列の読み取り中にエラーが発生した場合public String parseQuotedString(Input in) throws ParseException
in
- 入力データParseException
- 文字列の読み取り中にエラーが発生した場合public void check(Input in, char expected) throws ParseException
in
- 入力データexpected
- 期待される文字ParseException
- 期待通りでなかった場合public void checkNext(Input in, char expected) throws ParseException
in
- 入力データexpected
- 期待される文字ParseException
- 期待通りでなかった場合public void checkWord(Input in, String expected) throws ParseException
in
- 入力データexpected
- 期待される文字列ParseException
- 期待通りでなかった場合Copyright © 2016. All rights reserved.