- Common
- getDefPos = inp => ConsumedOK(inp.DefPos, inp)
- setDefPos <T> (Pos defpos, Parser<T> p)
- onside (Pos pos, Pos delta)
- mergeError (ParserError? err1, ParserError? err2)
- mergeErrorReply <T> (ParserError err, Reply<T> reply)
- ParserException
- ParserException ()
- ParserException (string message)
- ParserException (string message, Exception innerException)
- GenLanguageDef
- CommentStart
- CommentEnd
- CommentLine
- NestedComments
- IdentStart
- IdentLetter
- OpStart
- OpLetter
- ReservedNames
- ReservedOpNames
- CaseSensitive
- (), zero
(), zero (), zero (), List.empty (), List.empty (), true)_0" class="link"> Empty = new ("", "", "", true, zero<char>(), zero<char>(), zero<char>(), zero<char>(), List.empty<string>(), List.empty<string>(), true) - With ( string? CommentStart = null, string? CommentEnd = null, string? CommentLine = null, bool? NestedComments = null, Parser<char>? IdentStart = null, Parser<char>? IdentLetter = null, Parser<char>? OpStart = null, Parser<char>? OpLetter = null, Lst<string>? ReservedNames = null, Lst<string>? ReservedOpNames = null, bool? CaseSensitive = null )
- GenTokenParser
- Identifier
- Reserved
- Operator
- ReservedOp
- CharLiteral
- StringLiteral
- Natural
- Integer
- Float
- NaturalOrFloat
- Decimal
- Hexadecimal
- Octal
- Symbol
- Lexeme <T> (Parser<T> p)
- WhiteSpace
- Parens <T> (Parser<T> p)
- Braces <T> (Parser<T> p)
- Angles <T> (Parser<T> p)
- Brackets <T> (Parser<T> p)
- Semi
- Comma
- Colon
- Dot
- SemiSep <T> (Parser<T> p)
- SemiSep1 <T> (Parser<T> p)
- CommaSep <T> (Parser<T> p)
- CommaSep1 <T> (Parser<T> p)
- BracketsCommaSep1 <T> (Parser<T> p)
- BracketsCommaSep <T> (Parser<T> p)
- ParensCommaSep1 <T> (Parser<T> p)
- ParensCommaSep <T> (Parser<T> p)
- AnglesCommaSep1 <T> (Parser<T> p)
- AnglesCommaSep <T> (Parser<T> p)
- BracesCommaSep1 <T> (Parser<T> p)
- BracesCommaSep <T> (Parser<T> p)
- BracketsSemiSep1 <T> (Parser<T> p)
- BracketsSemiSep <T> (Parser<T> p)
- ParensSemiSep1 <T> (Parser<T> p)
- ParensSemiSep <T> (Parser<T> p)
- AnglesSemiSep1 <T> (Parser<T> p)
- AnglesSemiSep <T> (Parser<T> p)
- BracesSemiSep1 <T> (Parser<T> p)
- BracesSemiSep <T> (Parser<T> p)
- GenTokenParser2
- Identifier
- Reserved
- Operator
- ReservedOp
- CharLiteral
- StringLiteral
- Natural
- Integer
- Float
- NaturalOrFloat
- Decimal
- Hexadecimal
- Octal
- Symbol
- Lexeme <A> (Parser<A> p)
- WhiteSpace
- Parens <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- Braces <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- Angles <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- Brackets <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- Semi
- Comma
- Colon
- Dot
- SepBy <A, S> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p, Parser<S> sep)
- SepBy1 <A, S> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p, Parser<S> sep)
- SemiSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- SemiSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- CommaSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- CommaSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- BracketsCommaSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- BracketsCommaSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- ParensCommaSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- ParensCommaSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- AnglesCommaSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- AnglesCommaSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- BracesCommaSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- BracesCommaSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- BracketsSemiSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- BracketsSemiSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- ParensSemiSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- ParensSemiSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- AnglesSemiSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- AnglesSemiSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- BracesSemiSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- BracesSemiSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p)
- Language
- ?@\\^|-~"),
OpLetter: oneOf(":!#$%&*+./<=>?@\\^|-~"),
ReservedOpNames: List
(), ReservedNames: List (), CaseSensitive: true )_0" class="link"> HaskellStyle = GenLanguageDef.Empty.With( CommentStart: "{-", CommentEnd: "-}", CommentLine: "--", NestedComments: true, IdentStart: letter, IdentLetter: either(alphaNum, oneOf("_'")), OpStart: oneOf(":!#$%&*+./<=>?@\\^|-~"), OpLetter: oneOf(":!#$%&*+./<=>?@\\^|-~"), ReservedOpNames: List<string>(), ReservedNames: List<string>(), CaseSensitive: true ) - ?@\^|-~"),
OpLetter: oneOf(@"!%&*+.<=>?@\^|-~"),
ReservedOpNames: List
(), ReservedNames: List (), CaseSensitive: true )_0" class="link"> JavaStyle = GenLanguageDef.Empty.With( CommentStart: "/*", CommentEnd: "*/", CommentLine: "//", NestedComments: true, IdentStart: letter, IdentLetter: either(alphaNum, oneOf("_'")), OpStart: oneOf(@"!%&*+.<=>?@\^|-~"), OpLetter: oneOf(@"!%&*+.<=>?@\^|-~"), ReservedOpNames: List<string>(), ReservedNames: List<string>(), CaseSensitive: true ) - ", "@", "~", "=>"),
ReservedNames: List.create(
"let", "in", "case", "of", "if", "then", "else",
"data", "type",
"class", "default", "deriving", "do", "import",
"infix", "infixl", "infixr", "instance", "module",
"newtype", "where",
"primitive"))_0" class="link">Haskell98Def = HaskellStyle.With( ReservedOpNames: List.create("::", "..", "=", "\\", "|", "<-", "->", "@", "~", "=>"), ReservedNames: List.create( "let", "in", "case", "of", "if", "then", "else", "data", "type", "class", "default", "deriving", "do", "import", "infix", "infixl", "infixr", "instance", "module", "newtype", "where", "primitive"))
- Operator
- Infix <I, O> (Assoc assoc, Parser<I, Func<O, O, O>> p)
- Prefix <I, O> (Parser<I, Func<O, O>> p)
- Postfix <I, O> (Parser<I, Func<O, O>> p)
- Operator <I, O>
- Tag
- Operator (OperatorTag tag)
- SplitOp ( (Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O>>>, Seq<Parser<I, Func<O, O>>>) state)
- InfixOp <I, O>
- Assoc
- Op
- SplitOp ( (Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O>>>, Seq<Parser<I, Func<O, O>>>) state)
- PrefixOp <I, O>
- Op
- SplitOp ( (Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O>>>, Seq<Parser<I, Func<O, O>>>) state)
- PostfixOp <I, O>
- Op
- SplitOp ( (Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O>>>, Seq<Parser<I, Func<O, O>>>) state)
- Assoc
- OperatorTag
- Operator
- Infix <A> (Assoc assoc, Parser<Func<A, A, A>> p)
- Prefix <A> (Parser<Func<A, A>> p)
- Postfix <A> (Parser<Func<A, A>> p)
- Operator <A>
- Tag
- Operator (OperatorTag tag)
- SplitOp ( (Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A>>>, Seq<Parser<Func<A, A>>>) state)
- InfixOp <A>
- Assoc
- Op
- SplitOp ( (Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A>>>, Seq<Parser<Func<A, A>>>) state)
- PrefixOp <A>
- Op
- SplitOp ( (Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A>>>, Seq<Parser<Func<A, A>>>) state)
- PostfixOp <A>
- Op
- SplitOp ( (Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A>>>, Seq<Parser<Func<A, A>>>) state)
- Parser <T>
- ParserExtensions
- label <T> (this Parser<T> p, string expected)
- Parse <T> (this Parser<T> self, PString input)
- Parse <T> (this Parser<T> self, string input)
- Filter <T> (this Parser<T> self, Func<T, bool> pred)
- Where <T> (this Parser<T> self, Func<T, bool> pred)
- Map <T, U> (this Parser<T> self, Func<T, U> map)
- Select <T, U> (this Parser<T> self, Func<T, U> map)
- Bind <A, B> (this Parser<A> self, Func<A, Parser<B>> f)
- SelectMany <A, B> ( this Parser<A> self, Func<A, Parser<B>> f)
- SelectMany <T, U, V> ( this Parser<T> self, Func<T, Parser<U>> bind, Func<T, U, V> project)
- Flatten <A> (this Parser<Parser<A>> mma)
- Flatten <T> (this Parser<Option<T>> p, Func<string> failureText)
- Flatten <L, R> (this Parser<Either<L, R>> p, Func<L, string> failureText)
- Flatten <R> (this Parser<Either<string,R>> p)
- ParserErrorTag
- ParserError
- Tag
- Pos
- Msg
- Expected
- Inner
- ParserError (ParserErrorTag tag, Pos pos, string message, Lst<string> expected, ParserError? inner = null)
- Unknown (Pos pos)
- SysUnexpect (Pos pos, string message)
- Unexpect (Pos pos, string message)
- Expect (Pos pos, string message, string expected)
- Message (Pos pos, string message)
- ToString ()
- ToStringNoPosition ()
- Equals (ParserError? other)
- Equals (object? obj)
- GetHashCode ()
- CompareTo (ParserError? other)
- == (ParserError lhs, ParserError rhs)
- != (ParserError lhs, ParserError rhs)
- < (ParserError lhs, ParserError rhs)
- > (ParserError lhs, ParserError rhs)
- <= (ParserError lhs, ParserError rhs)
- >= (ParserError lhs, ParserError rhs)
- Compare <R> ( ParserError lhs, ParserError rhs, Func<R> EQ, Func<R> GT, Func<R> LT )
- Parser <I, O>
- ParserIOExtensions
- label <I, O> (this Parser<I, O> p, string expected)
- Parse <I, O> (this Parser<I, O> self, PString<I> input)
- Parse <I, O> (this Parser<I, O> self, Seq<I> input, Func<I, Pos> tokenPos)
- Parse <I, O> (this Parser<I, O> self, IEnumerable<I> input, Func<I, Pos> tokenPos)
- Filter <I, O> (this Parser<I, O> self, Func<O, bool> pred)
- Where <I, O> (this Parser<I, O> self, Func<O, bool> pred)
- Map <I, O, U> (this Parser<I, O> self, Func<O, U> map)
- Select <I, O, U> (this Parser<I, O> self, Func<O, U> map)
- Bind <I, A, B> (this Parser<I, A> self, Func<A, Parser<I, B>> f)
- SelectMany <I, A, B> ( this Parser<I, A> self, Func<A, Parser<I, B>> f)
- SelectMany <I, O, U, V> ( this Parser<I, O> self, Func<O, Parser<I, U>> bind, Func<O, U, V> project)
- Flatten <I, A> (this Parser<I, Parser<I, A>> mma)
- ResultTag
- ParserResult
- Consumed <T> (Reply<T> reply)
- Empty <T> (Reply<T> reply)
- EmptyOK <T> (T value, PString input, ParserError? error = null)
- EmptyError <T> (ParserError error)
- ConsumedOK <T> (T value, PString input)
- ConsumedOK <T> (T value, PString input, ParserError error)
- ConsumedError <T> (ParserError error)
- ParserResult <T>
- Tag
- Reply
- SetEndIndex (int endIndex)
- Project <S, U> (S s, Func<S, T, U> project)
- ToString ()
- IsFaulted
- Match <R> ( Func<ParserError, R> EmptyError, Func<ParserError, R> ConsumedError, Func<ParserResult<T>, R> Otherwise )
- Match <R> ( Func<ParserError, R> EmptyError, Func<ParserResult<T>, R> Otherwise )
- Match <R> ( Func<Reply<T>, R> Empty, Func<ParserResult<T>, R> Otherwise )
- Match <R> ( Func<Reply<T>, R> Empty, Func<Reply<T>, R> Consumed )
- Match <R> ( Func<T, PString, ParserError, R> ConsumedOK, Func<ParserError, R> ConsumedError, Func<T, PString, ParserError, R> EmptyOK, Func<ParserError, R> EmptyError )
- Select <U> (Func<T,U> map)
- ToEither ()
- ToEither <ERROR> (Func<string, ERROR> f)
- ToOption ()
- ParserResultIO
- Consumed <I, O> (Reply<I, O> reply)
- Empty <I, O> (Reply<I, O> reply)
- EmptyOK <I, O> (O value, PString<I> input, ParserError? error = null)
- EmptyError <I, O> (ParserError error, Func<I, Pos> tokenPos)
- ConsumedOK <I, O> (O value, PString<I> input)
- ConsumedOK <I, O> (O value, PString<I> input, ParserError error)
- ConsumedError <I, O> (ParserError error, Func<I, Pos> tokenPos)
- ParserResult <I, O>
- Tag
- Reply
- SetEndIndex (int endIndex)
- Project <S, U> (S s, Func<S, O, U> project)
- ToString ()
- IsFaulted
- Match <R> ( Func<ParserError, R> EmptyError, Func<ParserError, R> ConsumedError, Func<ParserResult<I, O>, R> Otherwise )
- Match <R> ( Func<ParserError, R> EmptyError, Func<ParserResult<I, O>, R> Otherwise )
- Match <R> ( Func<Reply<I, O>, R> Empty, Func<ParserResult<I, O>, R> Otherwise )
- Match <R> ( Func<Reply<I, O>, R> Empty, Func<Reply<I, O>, R> Consumed )
- Match <R> ( Func<O, PString<I>, ParserError, R> ConsumedOK, Func<ParserError, R> ConsumedError, Func<O, PString<I>, ParserError, R> EmptyOK, Func<ParserError, R> EmptyError )
- Select <U> (Func<O, U> map)
- ToEither ()
- ToEither <ERROR> (Func<string, ERROR> f)
- ToOption ()
- ParsecPipes
- toParserString
- toTokenString <A> (Func<A, Pos>? tokenPos)
- ToPipe <M, OUT> (this Parser<OUT> ma)
- ToPipe <OUT> (this Parser<OUT> ma)
- ToPipe <IN, OUT> (this Parser<IN, OUT> ma)
- ToPipe <M, IN, OUT> (this Parser<IN, OUT> ma)
- Pos
- Line
- Column
- Pos (int line, int column)
- Zero = new Pos(0, 0)
- Equals (Pos? other)
- Equals (object? obj)
- GetHashCode ()
- ToString ()
- CompareTo (Pos? other)
- == (Pos lhs, Pos rhs)
- != (Pos lhs, Pos rhs)
- < (Pos lhs, Pos rhs)
- > (Pos lhs, Pos rhs)
- <= (Pos lhs, Pos rhs)
- >= (Pos lhs, Pos rhs)
- Compare <R> ( Pos lhs, Pos rhs, Func<R> EQ, Func<R> GT, Func<R> LT )
- PString
- Value
- Index
- EndIndex
- Pos
- DefPos
- Side
- UserState
- PString (string value, int index, int endIndex, Pos pos, Pos defPos, Sidedness side, Option<object> userState)
- SetDefPos (Pos defpos)
- SetPos (Pos pos)
- SetSide (Sidedness side)
- SetValue (string value)
- SetIndex (int index)
- SetUserState (object? state)
- SetEndIndex (int endIndex)
- ToString ()
- Zero = new PString("", 0, 0, Pos.Zero, Pos.Zero, Sidedness.Onside, None)
- PString <T>
- Value
- Index
- EndIndex
- UserState
- TokenPos
- PString (T[] value, int index, int endIndex, Option<object> userState, Func<T, Pos> tokenPos)
- Pos
- SetValue (T[] value)
- SetIndex (int index)
- SetUserState (object? state)
- SetEndIndex (int endIndex)
- ToString ()
- Zero (Func<T, Pos> tokenPos)
- Cast <U> ()
- ReplyTag
- Reply
- OK <T> (T result, PString remaining, ParserError? error = null)
- Error <T> (ParserErrorTag tag, Pos pos, string message, Lst<string> expected)
- Error <T> (ParserError error)
- Reply <T>
- Reply
- OK <I, O> (O result, PString<I> remaining, ParserError? error = null)
- Error <I, O> (ParserErrorTag tag, Pos pos, string message, Lst<string> expected, Func<I, Pos> tokenPos)
- Error <I, O> (ParserError error, Func<I, Pos> tokenPos)
- Reply <I, O>
- Sidedness
- StringAndCollectionExtensions
Sub modules
ParserIOs |
Parsers |
field Parser<Pos> getDefPos = inp => ConsumedOK(inp.DefPos, inp) Source #
class ParserException Source #
constructor ParserException () Source #
constructor ParserException (string message) Source #
constructor ParserException (string message, Exception innerException) Source #
class GenLanguageDef Source #
The GenLanguageDef type is a record that contains all parameteridable features of the "Parsec.Text.Token" module. The module "Parsec.Text.Language" contains some default definitions.
field string CommentStart Source #
Describes the start of a block comment. Use the empty string if the language doesn't support block comments. For example "/*".
field string CommentEnd Source #
Describes the end of a block comment. Use the empty string if the language doesn't support block comments. For example "*".
field string CommentLine Source #
Describes the start of a line comment. Use the empty string if the language doesn't support line comments. For example "//".
field bool NestedComments Source #
Set to 'True' if the language supports nested block comments.
field Parser<char> IdentStart Source #
This parser should accept any start characters of identifiers. For example either(letter,char('_')).
field Parser<char> IdentLetter Source #
This parser should accept any legal tail characters of identifiers. For example either(alphaNum, char('_')).
field Parser<char> OpStart Source #
This parser should accept any start characters of operators. For example oneOf(":!#$%&*+./\〈=〉?@\\^|-~")
field Parser<char> OpLetter Source #
This parser should accept any legal tail characters of operators. Note that this parser should even be defined if the language doesn't support user-defined operators, or otherwise the 'reservedOp' parser won't work correctly.
field Lst<string> ReservedNames Source #
The list of reserved identifiers.
field Lst<string> ReservedOpNames Source #
The list of reserved operators.
field bool CaseSensitive Source #
Set to 'True' if the language is case sensitive.
field
GenLanguageDef
(), zero
Empty definition, use With to build
method GenLanguageDef With ( string? CommentStart = null, string? CommentEnd = null, string? CommentLine = null, bool? NestedComments = null, Parser<char>? IdentStart = null, Parser<char>? IdentLetter = null, Parser<char>? OpStart = null, Parser<char>? OpLetter = null, Lst<string>? ReservedNames = null, Lst<string>? ReservedOpNames = null, bool? CaseSensitive = null ) Source #
class GenTokenParser Source #
field Parser<string> Identifier Source #
This lexeme parser parses a legal identifier. Returns the identifier string. This parser will fail on identifiers that are reserved words. Legal identifier (start) characters and reserved words are defined in the 'LanguageDef' that is passed to 'makeTokenParser'. An identifier is treated as a single token using 'try'.
field Func<string, Parser<string>> Reserved Source #
The lexeme parser reserved(name) parses a symbol name, but it also checks that the name is not a prefix of a valid identifier. A reserved word is treated as a single token using 'try'.
field Parser<string> Operator Source #
This lexeme parser parses a legal operator. Returns the name of the operator. This parser will fail on any operators that are reserved operators. Legal operator (start) characters and reserved operators are defined in the 'LanguageDef' that is passed to 'makeTokenParser'. An operator is treated as a single token using 'try'.
field Func<string, Parser<Unit>> ReservedOp Source #
The lexeme parser reservedOp name parses symbol name, but it also checks that the name is not a prefix of a valid operator. A reservedOp is treated as a single token using 'try'.
field Parser<char> CharLiteral Source #
This lexeme parser parses a single literal character. Returns the literal character value. This parsers deals correctly with escape sequences. The literal character is parsed according to the grammar rules defined in the Haskell report (which matches most programming languages quite closely).
field Parser<string> StringLiteral Source #
This lexeme parser parses a literal string. Returns the literal string value. This parsers deals correctly with escape sequences and gaps. The literal string is parsed according to the grammar rules defined in the Haskell report (which matches most programming languages quite closely).
field Parser<int> Natural Source #
This lexeme parser parses a natural number (a positive whole number). Returns the value of the number. The number can be specified in 'decimal', 'hexadecimal' or 'octal'. The number is parsed according to the grammar rules in the Haskell report.
field Parser<int> Integer Source #
This lexeme parser parses an integer (a whole number). This parser is like 'natural' except that it can be prefixed with sign (i.e. '-' or '+'). Returns the value of the number. The number can be specified in 'decimal', 'hexadecimal' or 'octal'. The number is parsed according to the grammar rules in the Haskell report.
field Parser<double> Float Source #
This lexeme parser parses a floating point value. Returns the value of the number. The number is parsed according to the grammar rules defined in the Haskell report.
field Parser<Either<int,double>> NaturalOrFloat Source #
This lexeme parser parses either 'natural' or a 'float'. Returns the value of the number. This parsers deals with any overlap in the grammar rules for naturals and floats. The number is parsed according to the grammar rules defined in the Haskell report.
field Parser<int> Decimal Source #
Parses a positive whole number in the decimal system. Returns the value of the number.
field Parser<int> Hexadecimal Source #
Parses a positive whole number in the hexadecimal system. The number should be prefixed with "0x" or "0X". Returns the value of the number.
field Parser<int> Octal Source #
Parses a positive whole number in the octal system. The number should be prefixed with "0o" or "0O". Returns the value of the number.
field Func<string, Parser<string>> Symbol Source #
Lexeme parser symbol(s) parses 'string' s and skips trailing white space.
field Parser<Unit> WhiteSpace Source #
Parses any white space. White space consists of /zero/ or more occurrences of a 'space', a line comment or a block (multi line) comment. Block comments may be nested. How comments are started and ended is defined in the 'LanguageDef' that is passed to 'makeTokenParser'.
field Parser<string> Semi Source #
Lexeme parser semi parses the character ; and skips any trailing white space. Returns the string ";".
field Parser<string> Comma Source #
Lexeme parser comma parses the character , and skips any trailing white space. Returns the string ",".
method Parser<T> Lexeme <T> (Parser<T> p) Source #
lexeme(p) first applies parser p and than the 'whiteSpace' parser, returning the value of p. Every lexical token (lexeme) is defined using lexeme, this way every parse starts at a point without white space. Parsers that use lexeme are called lexeme parsers in this document.
The only point where the 'whiteSpace' parser should be called explicitly is the start of the main parser in order to skip any leading white space.
method Parser<T> Parens <T> (Parser<T> p) Source #
Lexeme parser parens(p) parses p enclosed in parenthesis, returning the value of p.
method Parser<T> Braces <T> (Parser<T> p) Source #
Lexeme parser braces(p) parses p enclosed in braces { and }, returning the value of p.
method Parser<T> Angles <T> (Parser<T> p) Source #
Lexeme parser angles(p) parses p enclosed in angle brackets 〈 and 〉, returning the value of p.
method Parser<T> Brackets <T> (Parser<T> p) Source #
Lexeme parser brackets(p) parses p enclosed in brackets [ and ], returning the value of p.
method Parser<Seq<T>> SemiSep <T> (Parser<T> p) Source #
Lexeme parser semiSep(p) parses /zero/ or more occurrences of p separated by semi. Returns a list of values returned by p.
method Parser<Seq<T>> SemiSep1 <T> (Parser<T> p) Source #
Lexeme parser semiSep1(p) parses /one/ or more occurrences of p separated by 'semi'. Returns a list of values returned by p.
method Parser<Seq<T>> CommaSep <T> (Parser<T> p) Source #
Lexeme parser commaSep(p) parses /zero/ or more occurrences of p separated by 'comma'. Returns a list of values returned by p.
method Parser<Seq<T>> CommaSep1 <T> (Parser<T> p) Source #
Lexeme parser commaSep1(p) parses /one/ or more occurrences of p separated by 'comma'. Returns a list of values returned by p.
method Parser<Seq<T>> BracketsCommaSep1 <T> (Parser<T> p) Source #
method Parser<Seq<T>> BracketsCommaSep <T> (Parser<T> p) Source #
method Parser<Seq<T>> ParensCommaSep1 <T> (Parser<T> p) Source #
method Parser<Seq<T>> ParensCommaSep <T> (Parser<T> p) Source #
method Parser<Seq<T>> AnglesCommaSep1 <T> (Parser<T> p) Source #
method Parser<Seq<T>> AnglesCommaSep <T> (Parser<T> p) Source #
method Parser<Seq<T>> BracesCommaSep1 <T> (Parser<T> p) Source #
method Parser<Seq<T>> BracesCommaSep <T> (Parser<T> p) Source #
method Parser<Seq<T>> BracketsSemiSep1 <T> (Parser<T> p) Source #
method Parser<Seq<T>> BracketsSemiSep <T> (Parser<T> p) Source #
method Parser<Seq<T>> ParensSemiSep1 <T> (Parser<T> p) Source #
method Parser<Seq<T>> ParensSemiSep <T> (Parser<T> p) Source #
method Parser<Seq<T>> AnglesSemiSep1 <T> (Parser<T> p) Source #
method Parser<Seq<T>> AnglesSemiSep <T> (Parser<T> p) Source #
method Parser<Seq<T>> BracesSemiSep1 <T> (Parser<T> p) Source #
method Parser<Seq<T>> BracesSemiSep <T> (Parser<T> p) Source #
class GenTokenParser2 Source #
field Parser<(string Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Identifier Source #
This lexeme parser parses a legal identifier. Returns the identifier string. This parser will fail on identifiers that are reserved words. Legal identifier (start) characters and reserved words are defined in the 'LanguageDef' that is passed to 'makeTokenParser'. An identifier is treated as a single token using 'try'.
field Func<string, Parser<(string Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)>> Reserved Source #
The lexeme parser reserved(name) parses a symbol name, but it also checks that the name is not a prefix of a valid identifier. A reserved word is treated as a single token using 'try'.
field Parser<(string Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Operator Source #
This lexeme parser parses a legal operator. Returns the name of the operator. This parser will fail on any operators that are reserved operators. Legal operator (start) characters and reserved operators are defined in the 'LanguageDef' that is passed to 'makeTokenParser'. An operator is treated as a single token using 'try'.
field Func<string, Parser<(Unit Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)>> ReservedOp Source #
The lexeme parser reservedOp name parses symbol name, but it also checks that the name is not a prefix of a valid operator. A reservedOp is treated as a single token using 'try'.
field Parser<(char Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> CharLiteral Source #
This lexeme parser parses a single literal character. Returns the literal character value. This parsers deals correctly with escape sequences. The literal character is parsed according to the grammar rules defined in the Haskell report (which matches most programming languages quite closely).
field Parser<(string Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> StringLiteral Source #
This lexeme parser parses a literal string. Returns the literal string value. This parsers deals correctly with escape sequences and gaps. The literal string is parsed according to the grammar rules defined in the Haskell report (which matches most programming languages quite closely).
field Parser<(int Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Natural Source #
This lexeme parser parses a natural number (a positive whole number). Returns the value of the number. The number can be specified in 'decimal', 'hexadecimal' or 'octal'. The number is parsed according to the grammar rules in the Haskell report.
field Parser<(int Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Integer Source #
This lexeme parser parses an integer (a whole number). This parser is like 'natural' except that it can be prefixed with sign (i.e. '-' or '+'). Returns the value of the number. The number can be specified in 'decimal', 'hexadecimal' or 'octal'. The number is parsed according to the grammar rules in the Haskell report.
field Parser<(double Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Float Source #
This lexeme parser parses a floating point value. Returns the value of the number. The number is parsed according to the grammar rules defined in the Haskell report.
field Parser<(Either<int, double> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> NaturalOrFloat Source #
This lexeme parser parses either 'natural' or a 'float'. Returns the value of the number. This parsers deals with any overlap in the grammar rules for naturals and floats. The number is parsed according to the grammar rules defined in the Haskell report.
field Parser<(int Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Decimal Source #
Parses a positive whole number in the decimal system. Returns the value of the number.
field Parser<(int Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Hexadecimal Source #
Parses a positive whole number in the hexadecimal system. The number should be prefixed with "0x" or "0X". Returns the value of the number.
field Parser<(int Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Octal Source #
Parses a positive whole number in the octal system. The number should be prefixed with "0o" or "0O". Returns the value of the number.
field Func<string, Parser<(string Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)>> Symbol Source #
Lexeme parser symbol(s) parses 'string' s and skips trailing white space.
field Parser<Unit> WhiteSpace Source #
Parses any white space. White space consists of /zero/ or more occurrences of a 'space', a line comment or a block (multi line) comment. Block comments may be nested. How comments are started and ended is defined in the 'LanguageDef' that is passed to 'makeTokenParser'.
field Parser<(string Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Semi Source #
Lexeme parser semi parses the character ; and skips any trailing white space. Returns the string ";".
field Parser<(string Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Comma Source #
Lexeme parser comma parses the character , and skips any trailing white space. Returns the string ",".
method Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Lexeme <A> (Parser<A> p) Source #
lexeme(p) first applies parser p and than the 'whiteSpace' parser, returning the value of p. Every lexical token (lexeme) is defined using lexeme, this way every parse starts at a point without white space. Parsers that use lexeme are called lexeme parsers in this document.
The only point where the 'whiteSpace' parser should be called explicitly is the start of the main parser in order to skip any leading white space.
method Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Parens <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
Lexeme parser parens(p) parses p enclosed in parenthesis, returning the value of p.
method Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Braces <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
Lexeme parser braces(p) parses p enclosed in braces { and }, returning the value of p.
method Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Angles <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
Lexeme parser angles(p) parses p enclosed in angle brackets〈 and 〉, returning the value of p.
method Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> Brackets <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
Lexeme parser brackets(p) parses p enclosed in brackets [ and ], returning the value of p.
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> SepBy <A, S> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p, Parser<S> sep) Source #
Lexeme parser semiSep(p) parses /zero/ or more occurrences of p separated by semi. Returns a list of values returned by p.
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> SepBy1 <A, S> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p, Parser<S> sep) Source #
Lexeme parser semiSep1(p) parses /one/ or more occurrences of p separated by 'semi'. Returns a list of values returned by p.
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> SemiSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
Lexeme parser semiSep(p) parses /zero/ or more occurrences of p separated by semi. Returns a list of values returned by p.
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> SemiSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
Lexeme parser semiSep1(p) parses /one/ or more occurrences of p separated by 'semi'. Returns a list of values returned by p.
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> CommaSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
Lexeme parser commaSep(p) parses /zero/ or more occurrences of p separated by 'comma'. Returns a list of values returned by p.
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> CommaSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
Lexeme parser commaSep1(p) parses /one/ or more occurrences of p separated by 'comma'. Returns a list of values returned by p.
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> BracketsCommaSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> BracketsCommaSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> ParensCommaSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> ParensCommaSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> AnglesCommaSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> AnglesCommaSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> BracesCommaSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> BracesCommaSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> BracketsSemiSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> BracketsSemiSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> ParensSemiSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> ParensSemiSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> AnglesSemiSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> AnglesSemiSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> BracesSemiSep1 <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
method Parser<(Seq<A> Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> BracesSemiSep <A> (Parser<(A Value, Pos BeginPos, Pos EndPos, int BeginIndex, int EndIndex)> p) Source #
field
GenLanguageDef
?@\\^|-~"),
OpLetter: oneOf(":!#$%&*+./<=>?@\\^|-~"),
ReservedOpNames: List
This is a minimal token definition for Haskell style languages. It defines the style of comments, valid identifiers and case sensitivity. It does not define any reserved words or operators.
field
GenLanguageDef
?@\^|-~"),
OpLetter: oneOf(@"!%&*+.<=>?@\^|-~"),
ReservedOpNames: List
This is a minimal token definition for Java style languages. It defines the style of comments, valid identifiers and case sensitivity. It does not define any reserved words.
field GenLanguageDef ", "@", "~", "=>"), ReservedNames: List.create( "let", "in", "case", "of", "if", "then", "else", "data", "type", "class", "default", "deriving", "do", "import", "infix", "infixl", "infixr", "instance", "module", "newtype", "where", "primitive"))_0" class="def">Haskell98Def = HaskellStyle.With( ReservedOpNames: List.create("::", "..", "=", "\\", "|", "<-", "->", "@", "~", "=>"), ReservedNames: List.create( "let", "in", "case", "of", "if", "then", "else", "data", "type", "class", "default", "deriving", "do", "import", "infix", "infixl", "infixr", "instance", "module", "newtype", "where", "primitive")) Source ", "@", "~", "=>"), ReservedNames: List.create( "let", "in", "case", "of", "if", "then", "else", "data", "type", "class", "default", "deriving", "do", "import", "infix", "infixl", "infixr", "instance", "module", "newtype", "where", "primitive"))_0" class="selflink">#
The language definition for the language Haskell98.
class Operator <I, O> Source #
method (Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O>>>, Seq<Parser<I, Func<O, O>>>) SplitOp ( (Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O>>>, Seq<Parser<I, Func<O, O>>>) state) Source #
method (Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O>>>, Seq<Parser<I, Func<O, O>>>) SplitOp ( (Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O>>>, Seq<Parser<I, Func<O, O>>>) state) Source #
class PrefixOp <I, O> Source #
method (Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O>>>, Seq<Parser<I, Func<O, O>>>) SplitOp ( (Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O>>>, Seq<Parser<I, Func<O, O>>>) state) Source #
class PostfixOp <I, O> Source #
method (Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O>>>, Seq<Parser<I, Func<O, O>>>) SplitOp ( (Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O, O>>>, Seq<Parser<I, Func<O, O>>>, Seq<Parser<I, Func<O, O>>>) state) Source #
enum OperatorTag Source #
method (Seq<Parser<Func<A,A,A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A>>>, Seq<Parser<Func<A, A>>>) SplitOp ( (Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A>>>, Seq<Parser<Func<A, A>>>) state) Source #
method (Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A>>>, Seq<Parser<Func<A, A>>>) SplitOp ( (Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A>>>, Seq<Parser<Func<A, A>>>) state) Source #
method (Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A>>>, Seq<Parser<Func<A, A>>>) SplitOp ( (Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A>>>, Seq<Parser<Func<A, A>>>) state) Source #
method (Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A>>>, Seq<Parser<Func<A, A>>>) SplitOp ( (Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A, A>>>, Seq<Parser<Func<A, A>>>, Seq<Parser<Func<A, A>>>) state) Source #
Parser delegate type - Parses an input PString and returns a ParserResult
type | T | Parsed value result type |
param | input | Input string |
returns | Parsed value or error report |
class ParserExtensions Source #
method Parser<T> label <T> (this Parser<T> p, string expected) Source #
A label for the parser
param | expected | What was expected |
method Parser<B> SelectMany <A, B> ( this Parser<A> self, Func<A, Parser<B>> f) Source #
method Parser<V> SelectMany <T, U, V> ( this Parser<T> self, Func<T, Parser<U>> bind, Func<T, U, V> project) Source #
enum ParserErrorTag Source #
class ParserError Source #
constructor ParserError (ParserErrorTag tag, Pos pos, string message, Lst<string> expected, ParserError? inner = null) Source #
method ParserError SysUnexpect (Pos pos, string message) Source #
method string ToStringNoPosition () Source #
method int GetHashCode () Source #
delegate Parser <I, O> Source #
Parser delegate type - Parses an input PString and returns a ParserResult
type | I | Input stream element type |
type | O | Parsed value result type |
param | input | Input string |
returns | Parsed value or error report |
class ParserIOExtensions Source #
method Parser<I, O> label <I, O> (this Parser<I, O> p, string expected) Source #
A label for the parser
param | expected | What was expected |
method ParserResult<I, O> Parse <I, O> (this Parser<I, O> self, Seq<I> input, Func<I, Pos> tokenPos) Source #
method ParserResult<I, O> Parse <I, O> (this Parser<I, O> self, IEnumerable<I> input, Func<I, Pos> tokenPos) Source #
method Parser<I, B> SelectMany <I, A, B> ( this Parser<I, A> self, Func<A, Parser<I, B>> f) Source #
method Parser<I, V> SelectMany <I, O, U, V> ( this Parser<I, O> self, Func<O, Parser<I, U>> bind, Func<O, U, V> project) Source #
class ParserResult Source #
method ParserResult<T> EmptyError <T> (ParserError error) Source #
method ParserResult<T> ConsumedOK <T> (T value, PString input) Source #
method ParserResult<T> ConsumedOK <T> (T value, PString input, ParserError error) Source #
method ParserResult<T> ConsumedError <T> (ParserError error) Source #
class ParserResult <T> Source #
method ParserResult<T> SetEndIndex (int endIndex) Source #
method R Match <R> ( Func<ParserError, R> EmptyError, Func<ParserError, R> ConsumedError, Func<ParserResult<T>, R> Otherwise ) Source #
class ParserResultIO Source #
method ParserResult<I, O> EmptyOK <I, O> (O value, PString<I> input, ParserError? error = null) Source #
method ParserResult<I, O> EmptyError <I, O> (ParserError error, Func<I, Pos> tokenPos) Source #
method ParserResult<I, O> ConsumedOK <I, O> (O value, PString<I> input) Source #
method ParserResult<I, O> ConsumedOK <I, O> (O value, PString<I> input, ParserError error) Source #
method ParserResult<I, O> ConsumedError <I, O> (ParserError error, Func<I, Pos> tokenPos) Source #
class ParserResult <I, O> Source #
method ParserResult<I, O> SetEndIndex (int endIndex) Source #
method R Match <R> ( Func<ParserError, R> EmptyError, Func<ParserError, R> ConsumedError, Func<ParserResult<I, O>, R> Otherwise ) Source #
method R Match <R> ( Func<ParserError, R> EmptyError, Func<ParserResult<I, O>, R> Otherwise ) Source #
class ParsecPipes Source #
property Pipe<string, PString, Unit> toParserString Source #
Pipe a string to a PString
method Pipe<A[], PString<A>, Unit> toTokenString <A> (Func<A, Pos>? tokenPos) Source #
Pipe tokens to a PString
method Pipe<PString, OUT, M, Unit> ToPipe <M, OUT> (this Parser<OUT> ma) Source #
Convert a parser to a pipe that awaits a PString and yields the result of the parse operation If the parser fails then the pipe fails
method Pipe<PString, OUT, Unit> ToPipe <OUT> (this Parser<OUT> ma) Source #
Convert a parser to a pipe that awaits a string and yields the result of the parse operation The value is only forwarded if the parsing succeeds
Represents a parser source position
method int GetHashCode () Source #
Represents the parser source text and the parser's positional state.
method PString SetUserState (object? state) Source #
method PString SetEndIndex (int endIndex) Source #
Represents the parser source string and the parser's positional state.
method PString<T> SetUserState (object? state) Source #
method PString<T> SetEndIndex (int endIndex) Source #