コード例 #1
0
        public static PrimarSqlSetColumnExpressionNode VisitUpdatedElement(UpdatedElementContext context)
        {
            var column = IdentifierVisitor.VisitFullColumnName(context.fullColumnName());

            var assignNode = new PrimarSqlSetColumnExpressionNode
            {
                Target = column.Name,
            };

            assignNode.Accessors.AddRange(column.Accessors);

            QsiExpressionNode expression;

            if (context.expression() != null)
            {
                expression = VisitExpression(context.expression());
            }
            else if (context.arrayExpression() != null)
            {
                expression = VisitArrayExpression(context.arrayExpression());
            }
            else if (context.arrayAddExpression() != null)
            {
                expression = VisitArrayAddExpression(context.arrayAddExpression());
            }
            else
            {
                expression = TreeHelper.CreateNullLiteral();
            }

            assignNode.Value.SetValue(expression);

            PrimarSqlTree.PutContextSpan(assignNode, context);
            return(assignNode);
        }
コード例 #2
0
        public static PrimarSqlSetColumnExpressionNode VisitRemovedElement(RemovedElementContext context)
        {
            var column = IdentifierVisitor.VisitFullColumnName(context.fullColumnName());

            var assignNode = new PrimarSqlSetColumnExpressionNode
            {
                Target = column.Name,
            };

            assignNode.Accessors.AddRange(column.Accessors);

            PrimarSqlTree.PutContextSpan(assignNode, context);
            return(assignNode);
        }