public static Parser <Expression> MemberAccess(this Parser <Expression> parser)
 {
     return(parser.ChainLeft(
                Or(from c in Token(Char('.'))
                   from identifier in Identifier()
                   from accessOperator in Or(InvocationExpression(identifier),
                                             MemberAccessExpression(identifier))
                   select accessOperator,
                   ElementAccessExpression())));
 }
示例#2
0
 public static Parser <TValue> ChainLeft <TValue>(this Parser <TValue> parser, Parser <Func <TValue, TValue> > func, TValue defaultValue)
 {
     return(parser.ChainLeft(func).Or(Return(defaultValue)));
 }