Exemple #1
0
 public CodeParser()
 {
     ArgsPattern = TokensBlockWithExcludePatternBuilder
                   .Reset()
                   .StartWith(TokenType.ARGS_OPEN)
                   .ExceptRange(
         Enum.GetValues(typeof(TokenType))
         .Cast <TokenType>()
         .Where(t => t.IsOperatorToken())
         .ToList())
                   .Except(TokenType.ACCESS_MODIFICATOR)
                   .EndWith(TokenType.ARGS_CLOSE)
                   .Build();
     MethodDefPattern = StrictPatternBuilder
                        .Reset()
                        .NextPattern(new SingleTokenPattern(TokenType.IDENTIFIER))
                        .NextPattern(ArgsPattern)
                        .NextPattern(TokensBlockPattern.BracketBlock)
                        .Build();
 }