Class EarleySet
java.lang.Object
org.libxmq.imp.ixml.earley.EarleySet
The Earley set for one input position: the items that are alive there.
Set k holds the items whose matched part ends at position k.
The items are kept in the order they were added, so the parser can work
through the set with an index while new items are appended to it.
An item is only added once.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the item is in the set.get(int i) The item at index i, in the order the items were added.booleanisEmpty()Returns true if there are no items: the parse died before this position.items()The items, in the order they were added.intsize()The number of items.
-
Field Details
-
position
public final int positionThe input position of this set. -
token
public final int tokenThe token read at this position (see Tokens), -1 in the last set, at the end of the input.
-
-
Method Details
-
contains
Returns true if the item is in the set.- Parameters:
item- the item- Returns:
- true if present
-
get
The item at index i, in the order the items were added.- Parameters:
i- the index- Returns:
- the item
-
size
public int size()The number of items.- Returns:
- the size
-
isEmpty
public boolean isEmpty()Returns true if there are no items: the parse died before this position.- Returns:
- true if empty
-
items
-