Class TsonFlex
java.lang.Object
net.thevpc.tson.impl.parser.jflex.TsonFlex
- All Implemented Interfaces:
TsonLexicalAnalyzer
This class is a scanner generated by
JFlex 1.7.0
from the specification file tson.flex
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intcharstatic final intstatic final intstatic final intThis character denotes the end of filestatic final intlexical states -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncharintfinal voidyybegin(int newState) Enters a new lexical statefinal charyycharat(int pos) Returns the character at position pos from the matched text.final voidyyclose()Closes the input stream.final intyylength()Returns the length of the matched text region.intyylex()Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs.voidyypushback(int number) Pushes the specified amount of characters back into the input stream.final voidResets the scanner to read from a new input stream.final intyystate()Returns the current lexical state.final Stringyytext()Returns the text matched by the current regular expression.
-
Field Details
-
YYEOF
public static final int YYEOFThis character denotes the end of file- See Also:
-
YYINITIAL
public static final int YYINITIALlexical states- See Also:
-
STRING
public static final int STRING- See Also:
-
CHARLITERAL
public static final int CHARLITERAL- See Also:
-
REGEX
public static final int REGEX- See Also:
-
CHARSTREAM
public static final int CHARSTREAM- See Also:
-
CHARSTREAM_CODE
public static final int CHARSTREAM_CODE- See Also:
-
BINARYSTREAM
public static final int BINARYSTREAM- See Also:
-
string
-
stringVal
-
charVal
public char charVal -
charStream
-
binaryStream
-
kmp
-
code
-
-
Constructor Details
-
TsonFlex
Creates a new scanner- Parameters:
in- the java.io.Reader to read input from.
-
-
Method Details
-
nextToken
public int nextToken()- Specified by:
nextTokenin interfaceTsonLexicalAnalyzer
-
currentReader
- Specified by:
currentReaderin interfaceTsonLexicalAnalyzer
-
currentInputStream
- Specified by:
currentInputStreamin interfaceTsonLexicalAnalyzer
-
currentImage
- Specified by:
currentImagein interfaceTsonLexicalAnalyzer
-
currentString
- Specified by:
currentStringin interfaceTsonLexicalAnalyzer
-
currentChar
public char currentChar()- Specified by:
currentCharin interfaceTsonLexicalAnalyzer
-
yyclose
-
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.
Internal scan buffer is resized down to its initial length, if it has grown.
- Parameters:
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- Parameters:
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's equivalent to yytext().charAt(pos), but faster
- Parameters:
pos- the position of the character to fetch. A value from 0 to yylength()-1.- Returns:
- 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
- Parameters:
number- the number of characters to be read again. This number must not be greater than yylength()!
-
yylex
Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs.- Returns:
- the next token
- Throws:
IOException- if any I/O-Error occurs
-