private VariableDeclarationNode GetVariableDeclaration()
        {
            VariableDeclarationList initializer = this.Initializer as VariableDeclarationList;

            if (initializer != null && initializer.Declarations.Count > 0)
            {
                return(initializer.Declarations[0] as VariableDeclarationNode);
            }
            return(null);
        }
Exemple #2
0
        private static Node GetVariableStatementType(List <Node> statements, string name)
        {
            foreach (var statement in statements)
            {
                if (statement.Kind != NodeKind.VariableStatement)
                {
                    continue;
                }

                VariableDeclarationList declarationList = (statement as VariableStatement).DeclarationList as VariableDeclarationList;
                VariableDeclarationNode declarationNode = declarationList.Declarations[0] as VariableDeclarationNode;
                if (declarationNode.Name.Text == name)
                {
                    return(declarationNode.Type);
                }
            }
            return(null);
        }