Class CommentParser
Contains functions to build parsers which skip over comments.
Inheritance
- object
- CommentParser
Inherited Members
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()
Declaration
public static class CommentParser
Methods
SkipBlockComment<T, U>(Parser<char, T>, Parser<char, U>)
Creates a parser which runs blockCommentStart
,
then skips everything until blockCommentEnd
.
Declaration
public static Parser<char, Unit> SkipBlockComment<T, U>(Parser<char, T> blockCommentStart, Parser<char, U> blockCommentEnd)
Parameters
Type | Name | Description |
---|---|---|
blockCommentStart |
A parser to recognise a lexeme which starts a multi-line block comment. |
|
blockCommentEnd |
A parser to recognise a lexeme which ends a multi-line block comment. |
Returns
Type | Description |
---|---|
A parser which runs |
Type Parameters
Name | Description |
---|---|
T |
The return type of the |
U |
The return type of the |
SkipLineComment<T>(Parser<char, T>)
Creates a parser which runs lineCommentStart
, then skips the rest of the line.
Declaration
public static Parser<char, Unit> SkipLineComment<T>(Parser<char, T> lineCommentStart)
Parameters
Type | Name | Description |
---|---|---|
lineCommentStart |
A parser to recognise a lexeme which starts a line comment. |
Returns
Type | Description |
---|---|
A parser which runs |
Type Parameters
Name | Description |
---|---|
T |
The return type of the |
SkipNestedBlockComment<T, U>(Parser<char, T>, Parser<char, U>)
Creates a parser which runs blockCommentStart
,
then skips everything until blockCommentEnd
, accounting for nested comments.
Declaration
public static Parser<char, Unit> SkipNestedBlockComment<T, U>(Parser<char, T> blockCommentStart, Parser<char, U> blockCommentEnd)
Parameters
Type | Name | Description |
---|---|---|
blockCommentStart |
A parser to recognise a lexeme which starts a multi-line block comment. |
|
blockCommentEnd |
A parser to recognise a lexeme which ends a multi-line block comment. |
Returns
Type | Description |
---|---|
A parser which runs |
Type Parameters
Name | Description |
---|---|
T |
The return type of the |
U |
The return type of the |