Package fj.parser
Class Parser.CharsParser
java.lang.Object
fj.parser.Parser.CharsParser
Parsers that accept
Stream<Character>
input.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a parser that produces an alpha character.Returns a parser that produces an alpha character.Returns a parser that produces an alpha-numeric character.Returns a parser that produces an alpha-numeric character.character
(E e) Returns a parser that produces a character if one is available or fails with the given error.Returns a parser that produces the given character or fails otherwise.Returns a parser that produces a character if one is available or fails with the given error.Returns a parser that produces the given character or fails otherwise.characters
(E missing, int n) Returns a parser that produces the given number of characters, or fails with the given error.characters
(E missing, F<Character, E> sat, Stream<Character> cs) Returns a parser that produces the given stream of characters or fails otherwise.characters
(F0<E> missing, int n) Returns a parser that produces the given number of characters, or fails with the given error.Returns a parser that produces the given stream of characters or fails otherwise.Returns a parser that produces a defined character.Returns a parser that produces a defined character.Returns a parser that produces a digit (0 to 9).Returns a parser that produces a digit (0 to 9).highSurrogate
(E missing, F<Character, E> sat) Returns a parser that produces a high-surrogate character.highSurrogate
(F0<E> missing, F<Character, E> sat) Returns a parser that produces a high-surrogate character.identifierIgnorable
(E missing, F<Character, E> sat) Returns a parser that produces an identifier-ignorable character.identifierIgnorable
(F0<E> missing, F<Character, E> sat) Returns a parser that produces an identifier-ignorable character.isoControl
(E missing, F<Character, E> sat) Returns a parser that produces an ISO control character.isoControl
(F0<E> missing, F<Character, E> sat) Returns a parser that produces an ISO control character.javaIdentifierPart
(E missing, F<Character, E> sat) Returns a parser that produces a Java identifier part character.javaIdentifierPart
(F0<E> missing, F<Character, E> sat) Returns a parser that produces a Java identifier part character.javaIdentifierStart
(E missing, F<Character, E> sat) Returns a parser that produces a Java identifier start character.javaIdentifierStart
(F0<E> missing, F<Character, E> sat) Returns a parser that produces a Java identifier start character.Returns a parser that produces a lower-case character.Returns a parser that produces a lower-case character.lowSurrogate
(E missing, F<Character, E> sat) Returns a parser that produces a low-surrogate character.lowSurrogate
(F0<E> missing, F<Character, E> sat) Returns a parser that produces a low-surrogate character.Returns a parser that produces a mirrored character.Returns a parser that produces a mirrored character.Returns a parser that produces a space character.Returns a parser that produces a space character.Returns a parser that produces the given string or fails otherwise.Returns a parser that produces the given string or fails otherwise.Returns a parser that produces a title-case character.Returns a parser that produces a title-case character.unicodeIdentiferPart
(E missing, F<Character, E> sat) Returns a parser that produces a unicode identifier part character.unicodeIdentiferPart
(F0<E> missing, F<Character, E> sat) Returns a parser that produces a unicode identifier part character.unicodeIdentiferStart
(E missing, F<Character, E> sat) Returns a parser that produces a unicode identifier start character.unicodeIdentiferStart
(F0<E> missing, F<Character, E> sat) Returns a parser that produces a unicode identifier start character.Returns a parser that produces a upper-case character.Returns a parser that produces a upper-case character.whitespace
(E missing, F<Character, E> sat) Returns a parser that produces a white-space character.whitespace
(F0<E> missing, F<Character, E> sat) Returns a parser that produces a white-space character.
-
Constructor Details
-
CharsParser
private CharsParser()
-
-
Method Details
-
character
Returns a parser that produces a character if one is available or fails with the given error.- Parameters:
e
- The error to fail with if a character is unavailable.- Returns:
- A parser that produces a character if one is available or fails with the given error.
-
character
Returns a parser that produces a character if one is available or fails with the given error.- Parameters:
e
- The error to fail with if a character is unavailable.- Returns:
- A parser that produces a character if one is available or fails with the given error.
-
character
public static <E> Parser<Stream<Character>,Character, characterE> (F0<E> missing, F<Character, E> sat, char c) Returns a parser that produces the given character or fails otherwise.- Parameters:
missing
- The error if no character is available.sat
- The error if the produced character is not the one given.c
- The character to produce in the parser.- Returns:
- A parser that produces the given character or fails otherwise.
-
character
public static <E> Parser<Stream<Character>,Character, characterE> (E missing, F<Character, E> sat, char c) Returns a parser that produces the given character or fails otherwise.- Parameters:
missing
- The error if no character is available.sat
- The error if the produced character is not the one given.c
- The character to produce in the parser.- Returns:
- A parser that produces the given character or fails otherwise.
-
characters
Returns a parser that produces the given number of characters, or fails with the given error.- Parameters:
missing
- The error if the given number of characters is unavailable.n
- The number of characters to produce in the parse result.- Returns:
- A parser that produces the given number of characters, or fails with the given error.
-
characters
Returns a parser that produces the given number of characters, or fails with the given error.- Parameters:
missing
- The error if the given number of characters is unavailable.n
- The number of characters to produce in the parse result.- Returns:
- A parser that produces the given number of characters, or fails with the given error.
-
characters
public static <E> Parser<Stream<Character>,Stream<Character>, charactersE> (F0<E> missing, F<Character, E> sat, Stream<Character> cs) Returns a parser that produces the given stream of characters or fails otherwise.- Parameters:
missing
- The error if the producing stream could not supply more characters.sat
- The error if a character was produced that is not the given stream of characters.cs
- The stream of characters to produce.- Returns:
- A parser that produces the given stream of characters or fails otherwise.
-
characters
public static <E> Parser<Stream<Character>,Stream<Character>, charactersE> (E missing, F<Character, E> sat, Stream<Character> cs) Returns a parser that produces the given stream of characters or fails otherwise.- Parameters:
missing
- The error if the producing stream could not supply more characters.sat
- The error if a character was produced that is not the given stream of characters.cs
- The stream of characters to produce.- Returns:
- A parser that produces the given stream of characters or fails otherwise.
-
string
public static <E> Parser<Stream<Character>,String, stringE> (F0<E> missing, F<Character, E> sat, String s) Returns a parser that produces the given string or fails otherwise.- Parameters:
missing
- The error if the producing stream could not supply more characters.sat
- The error if a character was produced that is not the given string.s
- The string to produce.- Returns:
- A parser that produces the given string or fails otherwise.
-
string
public static <E> Parser<Stream<Character>,String, stringE> (E missing, F<Character, E> sat, String s) Returns a parser that produces the given string or fails otherwise.- Parameters:
missing
- The error if the producing stream could not supply more characters.sat
- The error if a character was produced that is not the given string.s
- The string to produce.- Returns:
- A parser that produces the given string or fails otherwise.
-
digit
Returns a parser that produces a digit (0 to 9).- Parameters:
missing
- The error if there is no character on the stream to produce a digit with.sat
- The error if the produced character is not a digit.- Returns:
- A parser that produces a digit (0 to 9).
-
digit
Returns a parser that produces a digit (0 to 9).- Parameters:
missing
- The error if there is no character on the stream to produce a digit with.sat
- The error if the produced character is not a digit.- Returns:
- A parser that produces a digit (0 to 9).
-
lower
Returns a parser that produces a lower-case character.- Parameters:
missing
- The error if there is no character on the stream to produce a lower-case character with.sat
- The error if the produced character is not a lower-case character.- Returns:
- A parser that produces a lower-case character.
- See Also:
-
lower
Returns a parser that produces a lower-case character.- Parameters:
missing
- The error if there is no character on the stream to produce a lower-case character with.sat
- The error if the produced character is not a lower-case character.- Returns:
- A parser that produces a lower-case character.
- See Also:
-
upper
Returns a parser that produces a upper-case character.- Parameters:
missing
- The error if there is no character on the stream to produce a upper-case character with.sat
- The error if the produced character is not a upper-case character.- Returns:
- A parser that produces a upper-case character.
- See Also:
-
upper
Returns a parser that produces a upper-case character.- Parameters:
missing
- The error if there is no character on the stream to produce a upper-case character with.sat
- The error if the produced character is not a upper-case character.- Returns:
- A parser that produces a upper-case character.
- See Also:
-
defined
Returns a parser that produces a defined character.- Parameters:
missing
- The error if there is no character on the stream to produce a defined character with.sat
- The error if the produced character is not a defined character.- Returns:
- A parser that produces a defined character.
- See Also:
-
defined
Returns a parser that produces a defined character.- Parameters:
missing
- The error if there is no character on the stream to produce a defined character with.sat
- The error if the produced character is not a defined character.- Returns:
- A parser that produces a defined character.
- See Also:
-
highSurrogate
public static <E> Parser<Stream<Character>,Character, highSurrogateE> (F0<E> missing, F<Character, E> sat) Returns a parser that produces a high-surrogate character.- Parameters:
missing
- The error if there is no character on the stream to produce a high-surrogate character with.sat
- The error if the produced character is not a high-surrogate character.- Returns:
- A parser that produces a high-surrogate character.
- See Also:
-
highSurrogate
public static <E> Parser<Stream<Character>,Character, highSurrogateE> (E missing, F<Character, E> sat) Returns a parser that produces a high-surrogate character.- Parameters:
missing
- The error if there is no character on the stream to produce a high-surrogate character with.sat
- The error if the produced character is not a high-surrogate character.- Returns:
- A parser that produces a high-surrogate character.
- See Also:
-
identifierIgnorable
public static <E> Parser<Stream<Character>,Character, identifierIgnorableE> (F0<E> missing, F<Character, E> sat) Returns a parser that produces an identifier-ignorable character.- Parameters:
missing
- The error if there is no character on the stream to produce an identifier-ignorable character with.sat
- The error if the produced character is not an identifier-ignorable character.- Returns:
- A parser that produces an identifier-ignorable character.
- See Also:
-
identifierIgnorable
public static <E> Parser<Stream<Character>,Character, identifierIgnorableE> (E missing, F<Character, E> sat) Returns a parser that produces an identifier-ignorable character.- Parameters:
missing
- The error if there is no character on the stream to produce an identifier-ignorable character with.sat
- The error if the produced character is not an identifier-ignorable character.- Returns:
- A parser that produces an identifier-ignorable character.
- See Also:
-
isoControl
public static <E> Parser<Stream<Character>,Character, isoControlE> (F0<E> missing, F<Character, E> sat) Returns a parser that produces an ISO control character.- Parameters:
missing
- The error if there is no character on the stream to produce an ISO control character with.sat
- The error if the produced character is not an ISO control character.- Returns:
- A parser that produces an ISO control character.
- See Also:
-
isoControl
Returns a parser that produces an ISO control character.- Parameters:
missing
- The error if there is no character on the stream to produce an ISO control character with.sat
- The error if the produced character is not an ISO control character.- Returns:
- A parser that produces an ISO control character.
- See Also:
-
javaIdentifierPart
public static <E> Parser<Stream<Character>,Character, javaIdentifierPartE> (F0<E> missing, F<Character, E> sat) Returns a parser that produces a Java identifier part character.- Parameters:
missing
- The error if there is no character on the stream to produce a Java identifier part character with.sat
- The error if the produced character is not a Java identifier part character.- Returns:
- A parser that produces a Java identifier part character.
- See Also:
-
javaIdentifierPart
public static <E> Parser<Stream<Character>,Character, javaIdentifierPartE> (E missing, F<Character, E> sat) Returns a parser that produces a Java identifier part character.- Parameters:
missing
- The error if there is no character on the stream to produce a Java identifier part character with.sat
- The error if the produced character is not a Java identifier part character.- Returns:
- A parser that produces a Java identifier part character.
- See Also:
-
javaIdentifierStart
public static <E> Parser<Stream<Character>,Character, javaIdentifierStartE> (F0<E> missing, F<Character, E> sat) Returns a parser that produces a Java identifier start character.- Parameters:
missing
- The error if there is no character on the stream to produce a Java identifier start character with.sat
- The error if the produced character is not a Java identifier start character.- Returns:
- A parser that produces a Java identifier start character.
- See Also:
-
javaIdentifierStart
public static <E> Parser<Stream<Character>,Character, javaIdentifierStartE> (E missing, F<Character, E> sat) Returns a parser that produces a Java identifier start character.- Parameters:
missing
- The error if there is no character on the stream to produce a Java identifier start character with.sat
- The error if the produced character is not a Java identifier start character.- Returns:
- A parser that produces a Java identifier start character.
- See Also:
-
alpha
Returns a parser that produces an alpha character.- Parameters:
missing
- The error if there is no character on the stream to produce an alpha character with.sat
- The error if the produced character is not an alpha character.- Returns:
- A parser that produces an alpha character.
- See Also:
-
alpha
Returns a parser that produces an alpha character.- Parameters:
missing
- The error if there is no character on the stream to produce an alpha character with.sat
- The error if the produced character is not an alpha character.- Returns:
- A parser that produces an alpha character.
- See Also:
-
alphaNum
Returns a parser that produces an alpha-numeric character.- Parameters:
missing
- The error if there is no character on the stream to produce an alpha-numeric character with.sat
- The error if the produced character is not an alpha-numeric character.- Returns:
- A parser that produces an alpha-numeric character.
- See Also:
-
alphaNum
Returns a parser that produces an alpha-numeric character.- Parameters:
missing
- The error if there is no character on the stream to produce an alpha-numeric character with.sat
- The error if the produced character is not an alpha-numeric character.- Returns:
- A parser that produces an alpha-numeric character.
- See Also:
-
lowSurrogate
public static <E> Parser<Stream<Character>,Character, lowSurrogateE> (F0<E> missing, F<Character, E> sat) Returns a parser that produces a low-surrogate character.- Parameters:
missing
- The error if there is no character on the stream to produce a low-surrogate character with.sat
- The error if the produced character is not a low-surrogate character.- Returns:
- A parser that produces a low-surrogate character.
- See Also:
-
lowSurrogate
Returns a parser that produces a low-surrogate character.- Parameters:
missing
- The error if there is no character on the stream to produce a low-surrogate character with.sat
- The error if the produced character is not a low-surrogate character.- Returns:
- A parser that produces a low-surrogate character.
- See Also:
-
mirrored
Returns a parser that produces a mirrored character.- Parameters:
missing
- The error if there is no character on the stream to produce a mirrored character with.sat
- The error if the produced character is not a mirrored character.- Returns:
- A parser that produces a mirrored character.
- See Also:
-
mirrored
Returns a parser that produces a mirrored character.- Parameters:
missing
- The error if there is no character on the stream to produce a mirrored character with.sat
- The error if the produced character is not a mirrored character.- Returns:
- A parser that produces a mirrored character.
- See Also:
-
space
Returns a parser that produces a space character.- Parameters:
missing
- The error if there is no character on the stream to produce a space character with.sat
- The error if the produced character is not a space character.- Returns:
- A parser that produces a space character.
- See Also:
-
space
Returns a parser that produces a space character.- Parameters:
missing
- The error if there is no character on the stream to produce a space character with.sat
- The error if the produced character is not a space character.- Returns:
- A parser that produces a space character.
- See Also:
-
titleCase
public static <E> Parser<Stream<Character>,Character, titleCaseE> (F0<E> missing, F<Character, E> sat) Returns a parser that produces a title-case character.- Parameters:
missing
- The error if there is no character on the stream to produce a title-case character with.sat
- The error if the produced character is not a title-case character.- Returns:
- A parser that produces a title-case character.
- See Also:
-
titleCase
Returns a parser that produces a title-case character.- Parameters:
missing
- The error if there is no character on the stream to produce a title-case character with.sat
- The error if the produced character is not a title-case character.- Returns:
- A parser that produces a title-case character.
- See Also:
-
unicodeIdentiferPart
public static <E> Parser<Stream<Character>,Character, unicodeIdentiferPartE> (F0<E> missing, F<Character, E> sat) Returns a parser that produces a unicode identifier part character.- Parameters:
missing
- The error if there is no character on the stream to produce a unicode identifier part character with.sat
- The error if the produced character is not a unicode identifier part character.- Returns:
- A parser that produces a unicode identifier part character.
- See Also:
-
unicodeIdentiferPart
public static <E> Parser<Stream<Character>,Character, unicodeIdentiferPartE> (E missing, F<Character, E> sat) Returns a parser that produces a unicode identifier part character.- Parameters:
missing
- The error if there is no character on the stream to produce a unicode identifier part character with.sat
- The error if the produced character is not a unicode identifier part character.- Returns:
- A parser that produces a unicode identifier part character.
- See Also:
-
unicodeIdentiferStart
public static <E> Parser<Stream<Character>,Character, unicodeIdentiferStartE> (F0<E> missing, F<Character, E> sat) Returns a parser that produces a unicode identifier start character.- Parameters:
missing
- The error if there is no character on the stream to produce a unicode identifier start character with.sat
- The error if the produced character is not a unicode identifier start character.- Returns:
- A parser that produces a unicode identifier start character.
- See Also:
-
unicodeIdentiferStart
public static <E> Parser<Stream<Character>,Character, unicodeIdentiferStartE> (E missing, F<Character, E> sat) Returns a parser that produces a unicode identifier start character.- Parameters:
missing
- The error if there is no character on the stream to produce a unicode identifier start character with.sat
- The error if the produced character is not a unicode identifier start character.- Returns:
- A parser that produces a unicode identifier start character.
- See Also:
-
whitespace
public static <E> Parser<Stream<Character>,Character, whitespaceE> (F0<E> missing, F<Character, E> sat) Returns a parser that produces a white-space character.- Parameters:
missing
- The error if there is no character on the stream to produce a white-space character with.sat
- The error if the produced character is not a white-space character.- Returns:
- A parser that produces a white-space character.
- See Also:
-
whitespace
Returns a parser that produces a white-space character.- Parameters:
missing
- The error if there is no character on the stream to produce a white-space character with.sat
- The error if the produced character is not a white-space character.- Returns:
- A parser that produces a white-space character.
- See Also:
-