|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Object | +--TopLevelClass.LexicalAnalyzer | +--TopLevelClass.Default.LexicalAnalyzer
TopLevelClass.LexicalAnalyzer のデフォルト実装。
| フィールドの概要 | |
protected int |
column
次のトークンが始まる桁。 |
protected int |
end
text のパース対象の領域の最後の次の文字のインデックス。 |
protected int |
index
次のトークンが始まるインデックス。 |
protected int |
line
次のトークンが始まる行。 |
protected String |
sourceName
コンストラクタに渡されたソースの名前。 |
protected int |
tabStop
コンストラクタに渡されたタブストップ。 |
protected CharSequence |
text
コンストラクタに渡されたテキスト。 |
| コンストラクタの概要 | |
TopLevelClass.Default.LexicalAnalyzer(String sourceName,
CharSequence text,
int tabStop)
字句解析器を構築します。 |
|
TopLevelClass.Default.LexicalAnalyzer(String sourceName,
CharSequence text,
int tabStop,
int start,
int end,
int line,
int column)
字句解析器を構築します。 |
|
| メソッドの概要 | |
TopLevelClass.Token |
next()
次のトークンを返します。 |
protected char |
nextChar()
次の文字を返します。 |
protected char |
nextExactChar()
次の1文字を返し、 index、line、columnを更新します。 |
protected char |
nextUnicodeEscapedChar()
次の1文字を返し、 index、line、columnを更新します。 |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
protected final String sourceName
protected final CharSequence text
protected final int end
text のパース対象の領域の最後の次の文字のインデックス。
protected final int tabStop
protected int index
protected int line
protected int column
| コンストラクタの詳細 |
public TopLevelClass.Default.LexicalAnalyzer(String sourceName,
CharSequence text,
int tabStop)
sourceName - 解析対象のテキストの名前。text - 解析対象のテキスト。tabStop - テキストに含まれるタブ文字が、以降のテキストを何文字単位に桁揃えするか。
public TopLevelClass.Default.LexicalAnalyzer(String sourceName,
CharSequence text,
int tabStop,
int start,
int end,
int line,
int column)
sourceName - 解析対象のテキストの名前。text - 解析対象のテキスト。tabStop - テキストに含まれるタブ文字が、以降のテキストを何文字単位に桁揃えするか。start - text 中の、解析対象の領域の先頭の添え字。end - text 中の、解析対象の領域の最後の次の文字の添え字。line - 解析対象の領域の先頭の文字が、何行目にあるか(zero based)。column - 解析対象の領域の先頭の文字が、何カラム目にあたるか(zero based)。| メソッドの詳細 |
public TopLevelClass.Token next() throws TopLevelClass.ParseException
TopLevelClass.LexicalAnalyzer の記述: TopLevelClass.Token.getSymbolID() が TopLevelClass.EOF_TOKEN を返すオブジェクトを返します。
TopLevelClass.LexicalAnalyzer 内の nextTopLevelClass.ParseException - パース対象のテキストが、文法上あるいは意味論上の誤りを含む場合。
protected char nextChar()
throws TopLevelClass.ParseException
このメソッドは、解析対象のテキストの位置 index から始まる文字を返し、index、line、column をその次の文字を指すように更新します。このメソッドは、Javaのユニコード・エスケープのように、テキストを通じて文字列を文字として扱うためにオーバーライドされます。
デフォルトの実装は、nextExactChar()を呼び出します。
IndexOutOfBoundsException - index >= endの場合
TopLevelClass.ParseException
protected final char nextUnicodeEscapedChar()
throws TopLevelClass.ParseException,
IndexOutOfBoundsException
index、line、columnを更新します。Unicodeエスケープならば、そのUnicodeエスケープによって表されている文字を返します。
TopLevelClass.ParseException
IndexOutOfBoundsException
protected final char nextExactChar()
throws TopLevelClass.ParseException,
IndexOutOfBoundsException
index、line、columnを更新します。
TopLevelClass.ParseException
IndexOutOfBoundsException
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||