Package org.oristool.lello.parse
Class ListTerminalStream
java.lang.Object
org.oristool.lello.parse.ListTerminalStream
- All Implemented Interfaces:
TerminalStream
An list-based implementation of TerminalStream.
-
Constructor Summary
ConstructorDescriptionListTerminalStream
(List<Terminal> terminals) Initializes a stream of symbols based on a list; the symbols will be received from the stream in the same order they appear in the list. -
Method Summary
-
Constructor Details
-
ListTerminalStream
Initializes a stream of symbols based on a list; the symbols will be received from the stream in the same order they appear in the list.- Parameters:
terminals
- The list of symbols.
-
-
Method Details
-
getCurrent
Description copied from interface:TerminalStream
Retrieves the current symbol in the stream, without advancing the cursor.- Specified by:
getCurrent
in interfaceTerminalStream
- Returns:
- The current symbol.
-
moveNext
public void moveNext()Description copied from interface:TerminalStream
Advances the cursor to the next symbol in the stream.- Specified by:
moveNext
in interfaceTerminalStream
-
hasNext
public boolean hasNext()Description copied from interface:TerminalStream
Tells whether there is another symbol in the stream or not.- Specified by:
hasNext
in interfaceTerminalStream
- Returns:
- true if there is another symbol, false if not.
-