예제 #1
0
 private static ParseResult Match_Eol(InputStream input)
 {
     return(ParseBuilder.FirstOf(
                ParseBuilder.Match("\r\n"),
                ParseBuilder.Match('\r'),
                ParseBuilder.Match('\n'))(input));
 }
예제 #2
0
 private static ParseResult Match_Space(InputStream input)
 {
     return(ParseBuilder.FirstOf(
                ParseBuilder.Match(' '),
                ParseBuilder.Match('\t'),
                Match_Eol)(input));
 }
예제 #3
0
 private static ParseResult Match_GenericTypeParameter(InputStream input)
 {
     return(ParseBuilder.FirstOf(
                ParseBuilder.WithAction(Match_UnqualifiedName, r =>
     {
         var result = new TypeNameInfo();
         InitializeTypeNameInfo((ParsedUnqualifiedName)r.ResultData, result);
         return new ParseResult(r.MatchedString, result);
     }),
                ParseBuilder.WithAction(
                    ParseBuilder.Sequence(Match_LeftBracket, Match_TypeName, Match_RightBracket),
                    r => new SequenceResult(r)[1]))(
                input));
 }
예제 #4
0
 private static ParseResult Match_IdAlphanumeric(InputStream input)
 {
     return(ParseBuilder.FirstOf(Match_QuotedChar, ParseBuilder.Match(ch => char.IsLetterOrDigit(ch)))(input));
 }
예제 #5
0
 private static ParseResult Match_IdContinuation(InputStream input)
 {
     return(ParseBuilder.FirstOf(Match_IdNonAlpha, Match_IdAlphanumeric)(input));
 }
예제 #6
0
 private static ParseResult Match_IdStart(InputStream input)
 {
     return(ParseBuilder.FirstOf(Match_IdNonAlpha, Match_IdAlpha)(input));
 }
예제 #7
0
 private static ParseResult Match_AssemblyNameChar(InputStream input)
 {
     return(ParseBuilder.FirstOf(Match_QuotedChar, ParseBuilder.Match(ch => !"^/\\:?\"<>|,[]".Contains(ch)))(input));
 }
예제 #8
0
 private static ParseResult Match_AssemblyNamePart(InputStream input)
 {
     return(ParseBuilder.FirstOf(Match_Culture, Match_Version, Match_PublicKey, Match_PublicKeyToken)(input));
 }
예제 #9
0
 private static ParseResult Match_OpenGeneric(InputStream input)
 {
     return(ParseBuilder.FirstOf(Match_CLRSyntax, Match_EmptyBrackets)(input));
 }
예제 #10
0
 private static ParseResult Match_GenericParameters(InputStream input)
 {
     return(ParseBuilder.FirstOf(Match_ClosedGeneric, Match_OpenGeneric)(input));
 }