C# 클래스 Sprache.Parse

파일 보기 프로젝트 열기: sprache/Sprache

공개 메소드들

메소드 설명
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