Package fj.parser
Class Parser.StreamParser
java.lang.Object
fj.parser.Parser.StreamParser
Parsers that accept
Stream
input.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionelement
(E e) Returns a parser that produces an element from the stream if it is available and fails otherwise.Returns a parser that produces an element from the stream if it is available and fails otherwise.Returns a parser that produces an element from the stream that satisfies the given predicate, or fails.Returns a parser that produces an element from the stream that satisfies the given predicate, or fails.
-
Constructor Details
-
StreamParser
private StreamParser()
-
-
Method Details
-
element
Returns a parser that produces an element from the stream if it is available and fails otherwise.- Parameters:
e
- The error to fail with if no element is available.- Returns:
- A parser that produces an element from the stream if it is available and fails otherwise.
-
element
Returns a parser that produces an element from the stream if it is available and fails otherwise.- Parameters:
e
- The error to fail with if no element is available.- Returns:
- A parser that produces an element from the stream if it is available and fails otherwise.
-
satisfy
Returns a parser that produces an element from the stream that satisfies the given predicate, or fails.- Parameters:
missing
- The error if no element is available.sat
- The error if the element does not satisfy the predicate.f
- The predicate that the element should satisfy.- Returns:
- A parser that produces an element from the stream that satisfies the given predicate, or fails.
-
satisfy
Returns a parser that produces an element from the stream that satisfies the given predicate, or fails.- Parameters:
missing
- The error if no element is available.sat
- The error if the element does not satisfy the predicate.f
- The predicate that the element should satisfy.- Returns:
- A parser that produces an element from the stream that satisfies the given predicate, or fails.
-