类 Scanner
java.lang.Object
weka.core.mathematicalexpression.Scanner
- 所有已实现的接口:
java_cup.runtime.Scanner
A scanner for mathematical expressions.
- 版本:
- $Revision: 4942 $
- 作者:
- FracPete (fracpete at waikato dot ac dot nz)
-
字段概要
字段 -
构造器概要
构造器构造器说明Scanner
(InputStream in) Creates a new scanner.Scanner
(InputStream r, java_cup.runtime.SymbolFactory sf) Creates a new scanner There is also a java.io.InputStream version of this constructor. -
方法概要
修饰符和类型方法说明java_cup.runtime.Symbol
Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs.final void
yybegin
(int newState) Enters a new lexical statefinal char
yycharat
(int pos) Returns the character at position pos from the matched text.final void
yyclose()
Closes the input stream.final int
yylength()
Returns the length of the matched text region.void
yypushback
(int number) Pushes the specified amount of characters back into the input stream.final void
Resets the scanner to read from a new input stream.final int
yystate()
Returns the current lexical state.final String
yytext()
Returns the text matched by the current regular expression.
-
字段详细资料
-
构造器详细资料
-
Scanner
-
Scanner
Creates a new scanner There is also a java.io.InputStream version of this constructor.- 参数:
in
- the java.io.Reader to read input from.
-
Scanner
Creates a new scanner. There is also java.io.Reader version of this constructor.- 参数:
in
- the java.io.Inputstream to read input from.
-
-
方法详细资料
-
yyclose
Closes the input stream.- 抛出:
IOException
-
yyreset
Resets the scanner to read from a new input stream. Does not close the old reader. All internal variables are reset, the old input stream cannot be reused (internal buffer is discarded and lost). Lexical state is set to ZZ_INITIAL.- 参数:
reader
- the new input stream
-
yystate
public final int yystate()Returns the current lexical state. -
yybegin
public final void yybegin(int newState) Enters a new lexical state- 参数:
newState
- the new lexical state
-
yytext
Returns the text matched by the current regular expression. -
yycharat
public final char yycharat(int pos) Returns the character at position pos from the matched text. It is equivalent to yytext().charAt(pos), but faster- 参数:
pos
- the position of the character to fetch. A value from 0 to yylength()-1.- 返回:
- the character at position pos
-
yylength
public final int yylength()Returns the length of the matched text region. -
yypushback
public void yypushback(int number) Pushes the specified amount of characters back into the input stream. They will be read again by then next call of the scanning method- 参数:
number
- the number of characters to be read again. This number must not be greater than yylength()!
-
next_token
Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs.- 指定者:
next_token
在接口中java_cup.runtime.Scanner
- 返回:
- the next token
- 抛出:
IOException
- if any I/O-Error occurs
-