Пример #1
0
        private IdentifierNameExpressionNode ParseIdentifierNameExpression(IdentifierNameSyntax identifierNameSyntax)
        {
            var name = identifierNameSyntax.Identifier.Text;
            var kIdentifierExpression = KSyntaxFactory.IdentifierNameExpression(KSyntaxFactory.Identifier(name));

            return(kIdentifierExpression);
        }
Пример #2
0
        private VariableDeclaratorNode ParseDeclarator(VariableDeclaratorSyntax variableDeclaratorSyntax)
        {
            var identifier  = KSyntaxFactory.Identifier(variableDeclaratorSyntax.Identifier.Text);
            var initializer = ParseInitializer(variableDeclaratorSyntax.Initializer);
            var kDeclarator = KSyntaxFactory.VariableDeclarator()
                              .WithIdentifier(identifier)
                              .WithInitializer(initializer);

            return(kDeclarator);
        }