static public IXor7ExpressionSyntax GetRightHandSideExpression(LocalDeclarationStatementSyntax variableDeclarationSyntax) { var equalsSyntax = variableDeclarationSyntax.Declaration.Variables.Single().ChildNodes().OfType <EqualsValueClauseSyntax>().Single(); var valueSyntax = equalsSyntax.Value; return(Xor7ExpressionSyntax.FromExpression(valueSyntax)); }
public static IXor2BodyOfMethod GetBodyOfMethod(MethodDeclarationSyntax methodOfClass) { if (methodOfClass.Body != null) { return(new Xor2BodyOfMethod(methodOfClass.Body)); } else { var expression = methodOfClass.ExpressionBody.Expression; var xor5RhsExpression = Xor7ExpressionSyntax.FromExpression(expression); return(new Xor2BodyOfMethod(xor5RhsExpression)); } }
static public IXor7ExpressionSyntax GetRightHandSideExpression(ReturnStatementSyntax returnSyntax) => Xor7ExpressionSyntax.FromExpression(returnSyntax.Expression);
static public IXor7ExpressionSyntax GetInvocationTarget(InvocationExpressionSyntax syntax) => Xor7ExpressionSyntax.FromExpression(syntax.Expression);
static public IXor7ExpressionSyntax GetOwner(MemberAccessExpressionSyntax syntax) => Xor7ExpressionSyntax.FromExpression(syntax.Expression);