C# Класс Sprache.Parse

Показать файл Открыть проект

Открытые методы

Метод Описание
Regex ( Regex regex, string description = null ) : Parser

Construct a parser from the given regular expression.

Regex ( string pattern, string description = null ) : Parser

Construct a parser from the given regular expression.

RegexMatch ( Regex regex, string description = null ) : Parser

Construct a parser from the given regular expression, returning a parser of type Match.

RegexMatch ( string pattern, string description = null ) : Parser

Construct a parser from the given regular expression, returning a parser of type Match.

Приватные методы

Метод Описание
OptimizeRegex ( Regex regex ) : Regex

Optimize the regex by only matching successfully at the start of the input. Do this by wrapping the whole regex in non-capturing parentheses preceded by a `^'.

This method is invoked via reflection in unit tests. If renamed, the tests will need to be modified or they will fail.

Описание методов

Regex() публичный статический Метод

Construct a parser from the given regular expression.
public static Regex ( Regex regex, string description = null ) : Parser
regex System.Text.RegularExpressions.Regex The regex expression.
description string Description of characters that don't match.
Результат Parser

Regex() публичный статический Метод

Construct a parser from the given regular expression.
public static Regex ( string pattern, string description = null ) : Parser
pattern string The regex expression.
description string Description of characters that don't match.
Результат Parser

RegexMatch() публичный статический Метод

Construct a parser from the given regular expression, returning a parser of type Match.
public static RegexMatch ( Regex regex, string description = null ) : Parser
regex System.Text.RegularExpressions.Regex The regex expression.
description string Description of characters that don't match.
Результат Parser

RegexMatch() публичный статический Метод

Construct a parser from the given regular expression, returning a parser of type Match.
public static RegexMatch ( string pattern, string description = null ) : Parser
pattern string The regex expression.
description string Description of characters that don't match.
Результат Parser