Esempio n. 1
0
 public ElementbindingStatementInterpreter(StatementInterpreterHandler statementInterpreterHandler,
                                           ElementBindingExpressionSyntax elementBindingExpression,
                                           SemanticModel semanticModel)
 {
     this.statementInterpreterHandler = statementInterpreterHandler;
     this.elementBindingExpression    = elementBindingExpression;
     this.semanticModel = semanticModel;
 }
 internal static bool IsArgumentListToken(
     ElementBindingExpressionSyntax expression,
     SyntaxToken token
     )
 {
     return(expression.ArgumentList.Span.Contains(token.SpanStart) &&
            token != expression.ArgumentList.CloseBracketToken);
 }
        public override LuaSyntaxNode VisitElementBindingExpression(ElementBindingExpressionSyntax node)
        {
            var argumentList = (LuaArgumentListSyntax)node.ArgumentList.Accept(this);
            var memberAccess = new LuaMemberAccessExpressionSyntax(conditionalTemps_.Peek(), new LuaIdentifierNameSyntax(LuaSyntaxNode.Tokens.Get), true);
            LuaInvocationExpressionSyntax invocation = new LuaInvocationExpressionSyntax(memberAccess);

            invocation.ArgumentList.Arguments.AddRange(argumentList.Arguments);
            return(invocation);
        }
Esempio n. 4
0
        public override void VisitElementBindingExpression(ElementBindingExpressionSyntax node)
        {
            if (!PreVisit(node))
            {
                return;
            }

            node.ArgumentList?.Accept(this);

            base.VisitElementBindingExpression(node);

            PostVisit(node);
        }
Esempio n. 5
0
        private IEnumerable <Instruction> ProcessElementAccess(ElementBindingExpressionSyntax elementAccessSyntax)
        {
            if (elementAccessSyntax.GetSelfOrTopParenthesizedExpression().Parent is AssignmentExpressionSyntax assignmentSyntax &&
                assignmentSyntax.IsKind(SyntaxKind.SimpleAssignmentExpression) &&
                assignmentSyntax.Left.RemoveParentheses() == elementAccessSyntax)
            {
                return(NoInstructions);
            }

            var conditionalAccess = elementAccessSyntax.FirstAncestorOrSelf <ConditionalAccessExpressionSyntax>();

            var elementAccessType = this.semanticModel.GetTypeInfo(conditionalAccess.Expression).ConvertedType;

            if (elementAccessType == null)
            {
                return(NoInstructions);
            }

            if (elementAccessType.TypeKind == TypeKind.Array)
            {
                return(BuildArrayGetCall(elementAccessSyntax, elementAccessType, GetTargetExpression(elementAccessSyntax,
                                                                                                     elementAccessType)));
            }

            var indexerPropertySymbol = GetNodeSymbol(elementAccessSyntax) as IPropertySymbol;

            if (indexerPropertySymbol == null)
            {
                return(NoInstructions);
            }


            var instructions = new List <Instruction>();
            var expressions  = GetInvocationExpressions(indexerPropertySymbol.Parameters, elementAccessSyntax.ArgumentList,
                                                        instructions);

            instructions.AddRange(BuildFunctionCall(elementAccessSyntax, indexerPropertySymbol.GetMethod,
                                                    GetTargetExpression(elementAccessSyntax, indexerPropertySymbol), expressions));

            return(instructions);
        }
 internal static bool IsArgumentListToken(ElementBindingExpressionSyntax expression, SyntaxToken token)
 {
     return expression.ArgumentList.Span.Contains(token.SpanStart) &&
         token != expression.ArgumentList.CloseBracketToken;
 }
Esempio n. 7
0
 public static Doc Print(ElementBindingExpressionSyntax node)
 {
     return(Node.Print(node.ArgumentList));
 }
Esempio n. 8
0
 public override void VisitElementBindingExpression(ElementBindingExpressionSyntax node)
 {
     throw new NotImplementedException();
 }
Esempio n. 9
0
        public override Evaluation VisitElementBindingExpression(ElementBindingExpressionSyntax node)
        {
            node.ArgumentList?.Accept <Evaluation>(this);

            return(base.VisitElementBindingExpression(node));
        }
Esempio n. 10
0
 private Doc PrintElementBindingExpressionSyntax(
     ElementBindingExpressionSyntax node)
 {
     return(this.Print(node.ArgumentList));
 }
Esempio n. 11
0
        public override Ust VisitElementBindingExpression(ElementBindingExpressionSyntax node)
        {
            ArgsUst args = node.ArgumentList == null ? null : (ArgsUst)VisitBracketedArgumentList(node.ArgumentList);

            return(args);
        }
 public TameElementBindingExpressionSyntax(ElementBindingExpressionSyntax node)
 {
     Node = node;
     AddChildren();
 }
Esempio n. 13
0
 public override void VisitElementBindingExpression(ElementBindingExpressionSyntax node)
 {
     VisitBracketedArgumentList(node.ArgumentList);
 }
Esempio n. 14
0
 public override void VisitElementBindingExpression(ElementBindingExpressionSyntax node)
 {
     base.VisitElementBindingExpression(node);
 }
Esempio n. 15
0
 public override SyntaxNode VisitElementBindingExpression(ElementBindingExpressionSyntax node)
 {
     node = (ElementBindingExpressionSyntax)base.VisitElementBindingExpression(node);
     Classes.Add(node);
     return(node);
 }
Esempio n. 16
0
 public override void VisitElementBindingExpression(ElementBindingExpressionSyntax node) => base.VisitElementBindingExpression(node);
Esempio n. 17
0
 public override void VisitElementBindingExpression(ElementBindingExpressionSyntax node)
 {
     this.VisitExpression(node);
 }
Esempio n. 18
0
        public override void VisitElementBindingExpression(ElementBindingExpressionSyntax node)
        {
            node.ArgumentList?.Accept(this);

            base.VisitElementBindingExpression(node);
        }
Esempio n. 19
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="node"></param>
 public override sealed void VisitElementBindingExpression(ElementBindingExpressionSyntax node)
 {
     this.OnNodeVisited(node);
     if (!this.traverseRootOnly) base.VisitElementBindingExpression(node);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="node"></param>
 public override sealed void VisitElementBindingExpression(ElementBindingExpressionSyntax node)
 {
     this.OnNodeVisited(node, this.type.IsInstanceOfType(node));
     base.VisitElementBindingExpression(node);
 }
 public override Expr VisitElementBindingExpression(ElementBindingExpressionSyntax node)
 {
     return(base.VisitElementBindingExpression(node));
 }
 //
 // Summary:
 //     Called when the visitor visits a ElementBindingExpressionSyntax node.
 public virtual void VisitElementBindingExpression(ElementBindingExpressionSyntax node);