C# Class Sprache.Parse

Afficher le fichier Open project: sprache/Sprache

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

Regex() public static méthode

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.
Résultat Parser

Regex() public static méthode

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.
Résultat Parser

RegexMatch() public static méthode

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.
Résultat Parser

RegexMatch() public static méthode

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.
Résultat Parser