Package jjparse
Class StringParsing
An extension of the basic
Parsing class that provides basic Parsing.Parsers for Parsing with
Strings. This class fixes any Input to an Input of Characters.- Author:
- Björn Lötters
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class jjparse.Parsing
Parsing.Abort<T>, Parsing.Error<T>, Parsing.Failure<T>, Parsing.Parser<T>, Parsing.Result<T>, Parsing.Success<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionAParsing.Parserwhich parses a single digit (0 - 9).AParsing.Parserwhich parses a 32-bit IEEE 754 floating point number.AParsing.Parserwhich parses a 64-bit IEEE 754 floating point number.AParsing.Parserwhich parses the traditional C identifier.AParsing.Parserwhich parses a signed 32-bit integer.AParsing.Parserwhich parses a signed 64-bit integer.final Parsing<Character>.Parser<BigInteger> AParsing.Parserwhich parses a signed integer.AParsing.Parserwhich parses a Latin lowercase letter (a - z).AParsing.Parserwhich parses an unsigned 32-bit integer.AParsing.Parserwhich parses a Latin uppercase letter (A - Z). -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of thisStringParsingclass and provides access to allParsing.Parsers andParsing.Parsercombinators in that way. -
Method Summary
Modifier and TypeMethodDescriptioncharacter(char character) Creates a primitiveParsing.Parserthat attempts to parse the providedCharacter.Creates a primitiveParsing.Parserthat attempts to parse the providedStringliteral.Creates a primitiveParsing.Parserthat attempts to match the provided regular expression (which must be a validPattern).
-
Field Details
-
lowercase
AParsing.Parserwhich parses a Latin lowercase letter (a - z). -
uppercase
AParsing.Parserwhich parses a Latin uppercase letter (A - Z). -
identifier
AParsing.Parserwhich parses the traditional C identifier. -
digit
AParsing.Parserwhich parses a single digit (0 - 9). -
number
AParsing.Parserwhich parses an unsigned 32-bit integer. -
int32
AParsing.Parserwhich parses a signed 32-bit integer. -
int64
AParsing.Parserwhich parses a signed 64-bit integer. -
integer
AParsing.Parserwhich parses a signed integer. -
float32
AParsing.Parserwhich parses a 32-bit IEEE 754 floating point number. -
float64
AParsing.Parserwhich parses a 64-bit IEEE 754 floating point number.
-
-
Constructor Details
-
StringParsing
public StringParsing()Creates an instance of thisStringParsingclass and provides access to allParsing.Parsers andParsing.Parsercombinators in that way. Additionally, the skipParsing.Parseris initialized in order to skip any white space as defined by the regular expression \s.- See Also:
-
-
Method Details
-
literal
Creates a primitiveParsing.Parserthat attempts to parse the providedStringliteral.- Parameters:
literal- TheStringliteral which shall be parsed.- Returns:
- A
Parsing.Parserwhich parses the providedStringliteral. - See Also:
-
regex
Creates a primitiveParsing.Parserthat attempts to match the provided regular expression (which must be a validPattern).
Implementation Note: Be careful of applying the returnedParsing.Parserto an infiniteInput, as this might not terminate depending on the regular expression.- Parameters:
pattern- The regular expression which shall be used for matching.- Returns:
- A
Parsing.Parserthat attempts to parse the provided regular expression. - See Also:
-
character
Creates a primitiveParsing.Parserthat attempts to parse the providedCharacter.- Parameters:
character- TheCharacterwhich shall be parsed.- Returns:
- A
Parsing.Parserwhich parses the providedCharacter.
-