Пример #1
0
 private static ParseResult Match_Space(InputStream input)
 {
     return(ParseBuilder.FirstOf(
                ParseBuilder.Match(' '),
                ParseBuilder.Match('\t'),
                Match_Eol)(input));
 }
Пример #2
0
 private static ParseResult Match_Eol(InputStream input)
 {
     return(ParseBuilder.FirstOf(
                ParseBuilder.Match("\r\n"),
                ParseBuilder.Match('\r'),
                ParseBuilder.Match('\n'))(input));
 }
Пример #3
0
        private static ParseResult Match_LangTagPart(InputStream input)
        {
            var isAlpha  = ParseBuilder.Match(ch => "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".Contains(ch));
            var optAlpha = ParseBuilder.ZeroOrOne(isAlpha);

            return(ParseBuilder.Sequence(isAlpha, optAlpha, optAlpha, optAlpha, optAlpha, optAlpha, optAlpha, optAlpha,
                                         optAlpha, optAlpha, optAlpha, optAlpha, optAlpha, optAlpha, optAlpha, optAlpha)(input));
        }
Пример #4
0
 private static ParseResult Match_Equals(InputStream input)
 {
     return(ParseBuilder.Sequence(ParseBuilder.Match('='), Match_Spacing)(input));
 }
Пример #5
0
 private static ParseResult Match_Backslash(InputStream input)
 {
     return(ParseBuilder.Match('\\')(input));
 }
Пример #6
0
 private static ParseResult Match_Plus(InputStream input)
 {
     return(ParseBuilder.Match('+')(input));
 }
Пример #7
0
 private static ParseResult Match_Backquote(InputStream input)
 {
     return(ParseBuilder.Match('`')(input));
 }
Пример #8
0
 private static ParseResult Match_RightBracket(InputStream input)
 {
     return(ParseBuilder.Sequence(ParseBuilder.Match(']'), Match_Spacing)(input));
 }
Пример #9
0
 private static ParseResult Match_HexDigit(InputStream input)
 {
     return(ParseBuilder.Match(ch => "0123456789ABCDEFabcdef".Contains(ch))(input));
 }
Пример #10
0
 private static ParseResult Match_LanguageTag(InputStream input)
 {
     return(ParseBuilder.Sequence(Match_LangTagPart, ParseBuilder.ZeroOrOne(ParseBuilder.Sequence(ParseBuilder.Match('-'), Match_LangTagPart)), Match_Spacing)(input));
 }
Пример #11
0
 private static ParseResult Match_IdNonAlpha(InputStream input)
 {
     return(ParseBuilder.Match(ch => "_$@?".Contains(ch))(input));
 }
Пример #12
0
 private static ParseResult Match_IdAlphanumeric(InputStream input)
 {
     return(ParseBuilder.FirstOf(Match_QuotedChar, ParseBuilder.Match(ch => char.IsLetterOrDigit(ch)))(input));
 }
Пример #13
0
 private static ParseResult Match_AssemblyNameChar(InputStream input)
 {
     return(ParseBuilder.FirstOf(Match_QuotedChar, ParseBuilder.Match(ch => !"^/\\:?\"<>|,[]".Contains(ch)))(input));
 }
Пример #14
0
 private static ParseResult Match_PublicKeyToken(InputStream input)
 {
     return(ParseBuilder.Sequence(ParseBuilder.Match("PublicKeyToken"), Match_Spacing, Match_Equals, Match_PublicKeyValue)(input));
 }
Пример #15
0
 private static ParseResult Match_PublicKey(InputStream input)
 {
     return
         (ParseBuilder.Sequence(ParseBuilder.Match("PublicKey"), Match_Spacing, Match_Equals, ParseBuilder.OneOrMore(Match_HexDigit), Match_Spacing)(
              input));
 }
Пример #16
0
 private static ParseResult Match_Version(InputStream input)
 {
     return(ParseBuilder.Sequence(ParseBuilder.Match("Version"), Match_Spacing, Match_Equals, Match_VersionNumber, Match_Spacing)(input));
 }
Пример #17
0
 private static ParseResult Match_Digit(InputStream input)
 {
     return(ParseBuilder.Match(ch => char.IsDigit(ch))(input));
 }
Пример #18
0
 private static ParseResult Match_Culture(InputStream input)
 {
     return(ParseBuilder.Sequence(ParseBuilder.Match("Culture"), Match_Spacing, Match_Equals, Match_LanguageTag)(input));
 }