Top Fields Constructors Methods
com.fasterxml.jackson.dataformat.toml

pack-priv Class Lexer

extends Object
Class Inheritance
Annotations
@SuppressWarnings:fallthrough

Field Summary

Modifier and TypeField and Description
public static final int
private final TomlStreamReadException.ErrorContext
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
private final IOContext
public static final int
public static final int
public static final int
private int
pack-priv boolean
private boolean
private final StreamReadConstraints
pack-priv final TextBuffer
private boolean
private long
yychar

Number of characters up to the start of the matched text.

private int
yycolumn

Number of characters from the last newline up to the start of the matched text.

public static final int
YYEOF

This character denotes the end of file.

public static final int
private int
yyline

Number of newlines encountered up to the start of the matched text.

private static final int[]
ZZ_ACTION

Translates DFA states to action switch labels.

private static final String
private static final int[]
ZZ_ATTRIBUTE

ZZ_ATTRIBUTE[aState] contains the attributes of state aState

private static final String
private static final int
ZZ_BUFFERSIZE

Initial size of the lookahead buffer.

private static final int[]
ZZ_CMAP_BLOCKS

Second-level tables for translating characters to character classes

private static final String
private static final int[]
ZZ_CMAP_TOP

Top-level table for translating characters to character classes

private static final String
private static final String[]
ZZ_ERROR_MSG

Error messages for ZZ_UNKNOWN_ERROR, ZZ_NO_MATCH, and ZZ_PUSHBACK_2BIG respectively.

private static final int[]
ZZ_LEXSTATE

ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l at the beginning of a line l is of the form l = 2*k, k a non negative integer

private static final int
ZZ_NO_MATCH

Error code for "could not match input".

private static final int
ZZ_PUSHBACK_2BIG

Error code for "pushback value was too large".

private static final int[]
ZZ_ROWMAP

Translates a state to a row index in the transition table

private static final String
private static final int[]
ZZ_TRANS

The transition table of the DFA

private static final String
private static final int
ZZ_UNKNOWN_ERROR

Error code for "Unknown internal scanner error".

private boolean
zzAtBOL

Whether the scanner is currently at the beginning of a line.

private boolean
zzAtEOF

Whether the scanner is at the end of file.

private char[]
zzBuffer

This buffer contains the current text to be matched and is the source of the yytext() string.

private int
zzCurrentPos

Current text position in the buffer.

private int
zzEndRead

Marks the last character in the buffer, that has been read from input.

private boolean
zzEOFDone

Whether the user-EOF-code has already been executed.

private int
zzFinalHighSurrogate

The number of occupied positions in zzBuffer beyond zzEndRead.

private int
zzLexicalState

Current lexical state.

private int
zzMarkedPos

Text position at the last accepting state.

private Reader
zzReader

Input device.

private int
zzStartRead

Marks the beginning of the yytext() string in the buffer.

private int
zzState

Current state of the DFA.

Constructor Summary

AccessConstructor and Description
pack-priv
Lexer(Reader
the java.io.Reader to read input from.
in
,
IOContext ioContext, TomlStreamReadException.ErrorContext errorContext)

Creates a new scanner

Method Summary

Modifier and TypeMethod and Description
private void
private void
private void
private void
pack-priv long
pack-priv int
pack-priv int
public int
pack-priv char[]
pack-priv int
pack-priv int
public void
private void
private void
public final boolean

Returns:

whether the scanner has reached EOF.
yyatEOF
()

Returns whether the scanner has reached the end of the reader it reads from.

public final void
yybegin(int
the new lexical state
newState
)

Enters a new lexical state.

public final char

Returns:

the character at position.
yycharat
(int
the position of the character to fetch. A value from 0 to yylength()-1.
position
)

Returns the character at the given position from the matched text.

public final void
yyclose()

Closes the input reader.

public final int

Returns:

the length of the matched text region.
yylength
()

How many characters were matched.

public TomlToken

Returns:

the next token.
yylex
()

Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs.

public void
yypushback(int
the number of characters to be read again. This number must not be greater than yylength().
number
)

Pushes the specified amount of characters back into the input stream.

private final void
yyResetPosition()

Resets the input position.

public final int

Returns:

the current lexical state.
yystate
()

Returns the current lexical state.

public final String

Returns:

the matched text.
yytext
()

Returns the text matched by the current regular expression.

private boolean
zzCanGrow()

Whether the scanner buffer can grow to accommodate a larger token.

private static int
zzCMap(int input)

Translates raw input code points to DFA table row

private int
zzMaxBufferLen()

Returns the maximum size of the scanner buffer, which limits the size of tokens.

private boolean

Returns:

false iff there was new input.
zzRefill
()

Refills the input buffer.

private static void
zzScanError(int
the code of the error message to display.
errorCode
)

Reports an error that occurred while scanning.

private static int[]
private static int
zzUnpackAction(String packed, int offset, int[] result)

private static int[]
private static int
zzUnpackAttribute(String packed, int offset, int[] result)

private static int[]
private static int
zzUnpackcmap_blocks(String packed, int offset, int[] result)

private static int[]
private static int
zzUnpackcmap_top(String packed, int offset, int[] result)

private static int[]
private static int
zzUnpackRowMap(String packed, int offset, int[] result)

private static int[]
private static int
zzUnpacktrans(String packed, int offset, int[] result)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BASIC_STRINGback to summary
public static final int BASIC_STRING
errorContextback to summary
private final TomlStreamReadException.ErrorContext errorContext
EXPECT_ARRAY_SEPback to summary
public static final int EXPECT_ARRAY_SEP
EXPECT_EOLback to summary
public static final int EXPECT_EOL
EXPECT_EXPRESSIONback to summary
public static final int EXPECT_EXPRESSION
EXPECT_INLINE_KEYback to summary
public static final int EXPECT_INLINE_KEY
EXPECT_TABLE_SEPback to summary
public static final int EXPECT_TABLE_SEP
EXPECT_VALUEback to summary
public static final int EXPECT_VALUE
ioContextback to summary
private final IOContext ioContext
LITERAL_STRINGback to summary
public static final int LITERAL_STRING
ML_BASIC_STRINGback to summary
public static final int ML_BASIC_STRING
ML_LITERAL_STRINGback to summary
public static final int ML_LITERAL_STRING
nestingDepthback to summary
private int nestingDepth
prohibitInternalBufferAllocateback to summary
pack-priv boolean prohibitInternalBufferAllocate
releaseTokenBufferback to summary
private boolean releaseTokenBuffer
streamReadConstraintsback to summary
private final StreamReadConstraints streamReadConstraints
textBufferback to summary
pack-priv final TextBuffer textBuffer
trimmedNewlineback to summary
private boolean trimmedNewline
yycharback to summary
private long yychar

Number of characters up to the start of the matched text.

yycolumnback to summary
private int yycolumn

Number of characters from the last newline up to the start of the matched text.

YYEOFback to summary
public static final int YYEOF

This character denotes the end of file.

YYINITIALback to summary
public static final int YYINITIAL
yylineback to summary
private int yyline

Number of newlines encountered up to the start of the matched text.

ZZ_ACTIONback to summary
private static final int[] ZZ_ACTION

Translates DFA states to action switch labels.

ZZ_ACTION_PACKED_0back to summary
private static final String ZZ_ACTION_PACKED_0
ZZ_ATTRIBUTEback to summary
private static final int[] ZZ_ATTRIBUTE

ZZ_ATTRIBUTE[aState] contains the attributes of state aState

ZZ_ATTRIBUTE_PACKED_0back to summary
private static final String ZZ_ATTRIBUTE_PACKED_0
ZZ_BUFFERSIZEback to summary
private static final int ZZ_BUFFERSIZE

Initial size of the lookahead buffer.

ZZ_CMAP_BLOCKSback to summary
private static final int[] ZZ_CMAP_BLOCKS

Second-level tables for translating characters to character classes

ZZ_CMAP_BLOCKS_PACKED_0back to summary
private static final String ZZ_CMAP_BLOCKS_PACKED_0
ZZ_CMAP_TOPback to summary
private static final int[] ZZ_CMAP_TOP

Top-level table for translating characters to character classes

ZZ_CMAP_TOP_PACKED_0back to summary
private static final String ZZ_CMAP_TOP_PACKED_0
ZZ_ERROR_MSGback to summary
private static final String[] ZZ_ERROR_MSG

Error messages for ZZ_UNKNOWN_ERROR, ZZ_NO_MATCH, and ZZ_PUSHBACK_2BIG respectively.

ZZ_LEXSTATEback to summary
private static final int[] ZZ_LEXSTATE

ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l at the beginning of a line l is of the form l = 2*k, k a non negative integer

ZZ_NO_MATCHback to summary
private static final int ZZ_NO_MATCH

Error code for "could not match input".

ZZ_PUSHBACK_2BIGback to summary
private static final int ZZ_PUSHBACK_2BIG

Error code for "pushback value was too large".

ZZ_ROWMAPback to summary
private static final int[] ZZ_ROWMAP

Translates a state to a row index in the transition table

ZZ_ROWMAP_PACKED_0back to summary
private static final String ZZ_ROWMAP_PACKED_0
ZZ_TRANSback to summary
private static final int[] ZZ_TRANS

The transition table of the DFA

ZZ_TRANS_PACKED_0back to summary
private static final String ZZ_TRANS_PACKED_0
ZZ_UNKNOWN_ERRORback to summary
private static final int ZZ_UNKNOWN_ERROR

Error code for "Unknown internal scanner error".

zzAtBOLback to summary
private boolean zzAtBOL

Whether the scanner is currently at the beginning of a line.

Annotations
@SuppressWarnings:unused
zzAtEOFback to summary
private boolean zzAtEOF

Whether the scanner is at the end of file.

See Also
yyatEOF
zzBufferback to summary
private char[] zzBuffer

This buffer contains the current text to be matched and is the source of the yytext() string.

zzCurrentPosback to summary
private int zzCurrentPos

Current text position in the buffer.

zzEndReadback to summary
private int zzEndRead

Marks the last character in the buffer, that has been read from input.

zzEOFDoneback to summary
private boolean zzEOFDone

Whether the user-EOF-code has already been executed.

Annotations
@SuppressWarnings:unused
zzFinalHighSurrogateback to summary
private int zzFinalHighSurrogate

The number of occupied positions in zzBuffer beyond zzEndRead.

When a lead/high surrogate has been read from the input stream into the final zzBuffer position, this will have a value of 1; otherwise, it will have a value of 0.

zzLexicalStateback to summary
private int zzLexicalState

Current lexical state.

zzMarkedPosback to summary
private int zzMarkedPos

Text position at the last accepting state.

zzReaderback to summary
private Reader zzReader

Input device.

zzStartReadback to summary
private int zzStartRead

Marks the beginning of the yytext() string in the buffer.

zzStateback to summary
private int zzState

Current state of the DFA.

Constructor Detail

Lexerback to summary
pack-priv Lexer(Reader in, IOContext ioContext, TomlStreamReadException.ErrorContext errorContext)

Creates a new scanner

Parameters
in:Reader

the java.io.Reader to read input from.

Method Detail

appendNewlineWithPossibleTrimback to summary
private void appendNewlineWithPossibleTrim() throws IOException
appendNormalTextTokenback to summary
private void appendNormalTextToken() throws IOException
appendUnicodeEscapeLongback to summary
private void appendUnicodeEscapeLong() throws IOException
appendUnicodeEscapeShortback to summary
private void appendUnicodeEscapeShort() throws IOException
getCharPosback to summary
pack-priv long getCharPos()
getColumnback to summary
pack-priv int getColumn()
getLineback to summary
pack-priv int getLine()
getNestingDepthback to summary
public int getNestingDepth()
getTextBufferback to summary
pack-priv char[] getTextBuffer()
getTextBufferEndback to summary
pack-priv int getTextBufferEnd()
getTextBufferStartback to summary
pack-priv int getTextBufferStart()
releaseBuffersback to summary
public void releaseBuffers()
requestLargerBufferback to summary
private void requestLargerBuffer() throws TomlStreamReadException
startStringback to summary
private void startString()
yyatEOFback to summary
public final boolean yyatEOF()

Returns whether the scanner has reached the end of the reader it reads from.

Returns:boolean

whether the scanner has reached EOF.

yybeginback to summary
public final void yybegin(int newState)

Enters a new lexical state.

Parameters
newState:int

the new lexical state

yycharatback to summary
public final char yycharat(int position)

Returns the character at the given position from the matched text.

It is equivalent to yytext().charAt(pos), but faster.

Parameters
position:int

the position of the character to fetch. A value from 0 to yylength()-1.

Returns:char

the character at position.

yycloseback to summary
public final void yyclose() throws IOException

Closes the input reader.

Exceptions
IOException:
if the reader could not be closed.
yylengthback to summary
public final int yylength()

How many characters were matched.

Returns:int

the length of the matched text region.

yylexback to summary
public TomlToken yylex() throws IOException

Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs.

Returns:TomlToken

the next token.

Exceptions
IOException:
if any I/O-Error occurs.
yypushbackback to summary
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:int

the number of characters to be read again. This number must not be greater than yylength().

yyResetPositionback to summary
private final void yyResetPosition()

Resets the input position.

yystateback to summary
public final int yystate()

Returns the current lexical state.

Returns:int

the current lexical state.

yytextback to summary
public final String yytext()

Returns the text matched by the current regular expression.

Returns:String

the matched text.

zzCanGrowback to summary
private boolean zzCanGrow()

Whether the scanner buffer can grow to accommodate a larger token.

zzCMapback to summary
private static int zzCMap(int input)

Translates raw input code points to DFA table row

zzMaxBufferLenback to summary
private int zzMaxBufferLen()

Returns the maximum size of the scanner buffer, which limits the size of tokens.

zzRefillback to summary
private boolean zzRefill() throws IOException

Refills the input buffer.

Returns:boolean

false iff there was new input.

Exceptions
IOException:
if any I/O-Error occurs
zzScanErrorback to summary
private static void zzScanError(int errorCode)

Reports an error that occurred while scanning.

In a well-formed scanner (no or only correct usage of yypushback(int) and a match-all fallback rule) this method will only be called with things that "Can't Possibly Happen".

If this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty scanner etc.).

Usual syntax/scanner level error handling should be done in error fallback rules.

Parameters
errorCode:int

the code of the error message to display.

zzUnpackActionback to summary
private static int[] zzUnpackAction()
zzUnpackActionback to summary
private static int zzUnpackAction(String packed, int offset, int[] result)
zzUnpackAttributeback to summary
private static int[] zzUnpackAttribute()
zzUnpackAttributeback to summary
private static int zzUnpackAttribute(String packed, int offset, int[] result)
zzUnpackcmap_blocksback to summary
private static int[] zzUnpackcmap_blocks()
zzUnpackcmap_blocksback to summary
private static int zzUnpackcmap_blocks(String packed, int offset, int[] result)
zzUnpackcmap_topback to summary
private static int[] zzUnpackcmap_top()
zzUnpackcmap_topback to summary
private static int zzUnpackcmap_top(String packed, int offset, int[] result)
zzUnpackRowMapback to summary
private static int[] zzUnpackRowMap()
zzUnpackRowMapback to summary
private static int zzUnpackRowMap(String packed, int offset, int[] result)
zzUnpacktransback to summary
private static int[] zzUnpacktrans()
zzUnpacktransback to summary
private static int zzUnpacktrans(String packed, int offset, int[] result)