String literal starting end-of-line comments.
String literal starting a multi-line comment.
String literal closing a multi-line comment.
String literal starting a multi-line special comment block opening ( must be a one character extension of the multiline comment start ).
Parser for the contents of an annotation block (user defined).
A parser that matches any element, failing if the end of input is reached.
A parser that matches any element, failing if the end of input is reached.
Matches everything except end of line.
Any comment.
Convenience conversion to allow arity two functions to be used directly in tree construction actions.
Convenience conversion to allow arity two functions to be used directly in tree construction actions.
Convenience conversion to allow arity three functions to be used directly in tree construction actions.
Convenience conversion to allow arity three functions to be used directly in tree construction actions.
Convenience conversion to allow arity four functions to be used directly in tree construction actions.
Convenience conversion to allow arity four functions to be used directly in tree construction actions.
Convenience conversion to allow arity five functions to be used directly in tree construction actions.
Convenience conversion to allow arity five functions to be used directly in tree construction actions.
Convenience conversion to allow arity six functions to be used directly in tree construction actions.
Convenience conversion to allow arity six functions to be used directly in tree construction actions.
Parse digit strings that are constrained to fit into an Int
value.
Parse digit strings that are constrained to fit into an Int
value.
If the digit string is too big, a parse error results.
End of line comments.
Return an error after skipping white space.
Return an error after skipping white space.
Return a failure after skipping white space.
Return a failure after skipping white space.
Version of handleWhiteSpace
that accepts an Input
value rather
than separate source and offset.
Version of handleWhiteSpace
that accepts an Input
value rather
than separate source and offset. By default, just delegates to the
handleWhiteSpace
of RegexParsers
.
Parser for keywords.
Parser for keywords. The list of string arguments gives the text
of the keywords in a language. The regular expression gives the
possible extension of the keyword to stop the keyword being seen as
an identifier instead. For example, the keyword list might contain
"begin"
and "end"
and the extension regular expression might
be [^a-zA-Z0-9]
. Thus,
begin followed by something other than
a letter or digit is a keyword, but
beginfoo8 is an identifier.
This parser succeeds if any of the keywords is present, provided
that it's not immediately followed by something that extends it.
A parser that matches a literal string after skipping any
whitespace that is parsed by whitespaceParser
.
A parser that matches a literal string after skipping any
whitespace that is parsed by whitespaceParser
.
Nested multiline comments.
Multiline comment start delimiter.
Convenience conversion to lift parsers that return 2-tilde-tuples to parsers that return regular 2-tuples.
Convenience conversion to lift parsers that return 2-tilde-tuples to parsers that return regular 2-tuples.
Convenience conversion to lift parsers that return 3-tilde-tuples to parsers that return regular 3-tuples.
Convenience conversion to lift parsers that return 3-tilde-tuples to parsers that return regular 3-tuples.
Convenience conversion to lift parsers that return 4-tilde-tuples to parsers that return regular 4-tuples.
Convenience conversion to lift parsers that return 4-tilde-tuples to parsers that return regular 4-tuples.
Convenience conversion to lift parsers that return 5-tilde-tuples to parsers that return regular 5-tuples.
Convenience conversion to lift parsers that return 5-tilde-tuples to parsers that return regular 5-tuples.
Convenience conversion to lift parsers that return 6-tilde-tuples to parsers that return regular 6-tuples.
Convenience conversion to lift parsers that return 6-tilde-tuples to parsers that return regular 6-tuples.
Use parser
to parse the string str
.
Use parser
to parse the string str
. If the parse is sucessful and produces
the value t
, return Left ( t )
. Otherwise, return Right ( msg )
where msg
is the mesage produced by the parser.
If we are parsing whitespace already, fail if we are the end of the input, otherwise succeed with no progress.
If we are parsing whitespace already, fail if we are the end of the input, otherwise succeed with no progress. If we are not already parsing whitespace, then apply the whitespace parser, swallowing any errors from it unless they occur at the end of the input. In other words, an error not at the end is treated as the absence of whitespace.
Are we currently parsing whitespace?
Are we currently parsing whitespace?
As for positioned in RegexParsers
, but uses parseWhitespace
to skip whitespace.
As for positioned in RegexParsers
, but uses parseWhitespace
to skip whitespace.
A parser that matches a regex string after skipping any
whitespace that is parsed by whitespaceParser
.
A parser that matches a regex string after skipping any
whitespace that is parsed by whitespaceParser
.
Create a parser that matches a regex string, but doesn't skip whitespace first.
Create a parser that matches a regex string, but doesn't skip whitespace
first. This operation is useful if you want to recognise parts of a lexical
symbol with different regular expressions so you can use the parts
separately. Otherwise you have to parse with one regex and then split the
resulting string to get at its parts. Based on RegexParser.regex
in the
Scala library.
(Changed in version 2.9.0) The p0
call-by-name arguments is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.
Construct a parser that always succeeds and returns value v
.
Construct a parser that always succeeds and returns value v
. See
also the success
combinator in the Scala library that does something
similar but always returns the same value each time since the parameter
is not passed by name.
Annotation blocks with user defined contents.
Convert the digit string s
to an Int
if it's in range, but return an
error message if it's too big.
Convert the digit string s
to an Int
if it's in range, but return an
error message if it's too big.
The whitespace parser, swallows both true whitespace and comments.
The whitespace parser, swallows both true whitespace and comments.
Wrap a parser p
that produces a value of type T
to produce a
parser returning values of type U
.
Wrap a parser p
that produces a value of type T
to produce a
parser returning values of type U
. Whitespace is skipped ( if
we are skipping white space ) before p
is applied, so that we
have access to the first non-whitespace position.
The function f
is responsible for converting the T
value into
either a U
value or a string that indicates what went wrong.
In the latter case, the resulting parser will error at the
original position with the message, ignoring any other errors
at that position. Failures or errors of p
will be lifted to
the returned type.
A parser offering end of line comments, nested multi-line comments and special comment blocks containing end-of-line and multi-line comments.