Example #1
0
        protected override ExpressionSyntaxElement ReturnModProperty(ExpressionSyntaxElement property, Selection <ArgumentsSyntaxElement, ExpressionSyntaxElement, DotInvocationSyntaxElement>[] repeatOfArgumentsOrIndexingOrDotInvocation)
        {
            ExpressionSyntaxElement left = property;

            foreach (var selection in repeatOfArgumentsOrIndexingOrDotInvocation)
            {
                if (selection.Element1.HasValue)
                {
                    ArgumentsSyntaxElement args = selection.Element1.Value;
                    left = new InvokeSyntaxElement(left.LexAtStart, left, args);
                }
                else if (selection.Element2.HasValue)
                {
                    ExpressionSyntaxElement index = selection.Element2.Value;
                    left = new IndexerSyntaxElement(left.LexAtStart, left, index);
                }
                else if (selection.Element3.HasValue)
                {
                    DotInvocationSyntaxElement     right       = selection.Element3.Value;
                    List <ExpressionSyntaxElement> expressions = new List <ExpressionSyntaxElement>();
                    expressions.Add(left);
                    expressions.AddRange(right.Arguments);
                    left = new InvokeSyntaxElement(left.LexAtStart, new IdentifierSyntaxElement(right.Identifier), expressions);
                }
                else
                {
                    throw new NotSupportedException();
                }
            }
            return(left);
        }
Example #2
0
 protected override DotInvocationSyntaxElement ReturnDotInvocation(LexicalElement dot, IdentifierSyntaxElement identifier, ArgumentsSyntaxElement arguments)
 {
     return(new DotInvocationSyntaxElement(identifier.LexAtStart, arguments));
 }
 public DotInvocationSyntaxElement(LexicalElement identifier, ArgumentsSyntaxElement arguments)
 {
     this.Identifier = identifier;
     this.Arguments  = arguments;
 }