Class Chart
java.lang.Object
org.libxmq.imp.ixml.earley.Chart
The result of the Earley recognizer: one Earley set for each input position, from 0
(before the first code point) to n (after the last).
The input is read from its UTF-8 bytes, it is never turned into a String or an array
of code points. The chart is built by a single scan of the bytes, like
scan_content_fixup_charsets in the C version (see doc/parse_ixml_fast.md): every code
point is decoded, gets its token (Tokens) and the set of its position remembers the
token. The code points that the grammar has not seen in an input before are then added
to the token sets of the charsets that contain them (Grammar.addUsed).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe input is not valid UTF-8. -
Field Summary
Fields -
Method Summary
-
Field Details
-
tokens
The tokens of the grammar, to find the code point of a token. -
sets
-
-
Method Details
-
set
The set at position k.- Parameters:
k- the input position, 0 to length()- Returns:
- the set
-
token
public int token(int k) The token at position k.- Parameters:
k- the input position, 0 to length()-1- Returns:
- the token
-
codepoint
public int codepoint(int k) The code point at position k.- Parameters:
k- the input position, 0 to length()-1- Returns:
- the code point
-
length
public int length()The number of code points in the input.- Returns:
- the input length
-