Esempio n. 1
0
 private static ParseResult Match_QuotedChar(InputStream input)
 {
     return(ParseBuilder.WithAction(
                ParseBuilder.Sequence(Match_Backslash, ParseBuilder.Any),
                result =>
     {
         string ch = new SequenceResult(result)[1].MatchedString;
         return new ParseResult(ch);
     })(input));
 }
Esempio n. 2
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));
 }
Esempio n. 3
0
 private static ParseResult Match_Int(InputStream input)
 {
     return(ParseBuilder.WithAction(ParseBuilder.Sequence(Match_Digit, ParseBuilder.ZeroOrMore(Match_Digit)),
                                    r => new ParseResult(r.MatchedString, int.Parse(r.MatchedString, CultureInfo.InvariantCulture)))(input));
 }