Exemple #1
0
        public static UstList <InvocationExpression> AllInvocationExpressions(this UstNode node)
        {
            // Combine method invocations and object creations
            var objCreations = GetNodes <ObjectCreationExpression>(node)
                               .ConvertAll(x => (InvocationExpression)x);

            var result = GetNodes <InvocationExpression>(node);

            result.AddRange(objCreations);

            return(result);
        }
Exemple #2
0
        private static UstList <T> GetNodes <T>(UstNode node) where T : UstNode
        {
            UstList <T> nodes = new UstList <T>();

            foreach (UstNode child in node.Children)
            {
                if (child != null)
                {
                    if (child is T)
                    {
                        nodes.Add((T)child);
                    }
                    nodes.AddRange(GetNodes <T>(child));
                }
            }

            return(nodes);
        }
Exemple #3
0
 public static UstList <DeclarationNode> AllDeclarationNodes(this UstNode node)
 {
     return(GetNodes <DeclarationNode>(node));
 }
Exemple #4
0
 public static UstList <UsingDirective> AllUsingDirectives(this UstNode node)
 {
     return(GetNodes <UsingDirective>(node));
 }
Exemple #5
0
 public static UstList <NamespaceDeclaration> AllNamespaces(this UstNode node)
 {
     return(GetNodes <NamespaceDeclaration>(node));
 }
Exemple #6
0
 public static UstList <ConstructorDeclaration> AllConstructors(this UstNode node)
 {
     return(GetNodes <ConstructorDeclaration>(node));
 }
Exemple #7
0
 public static UstList <Annotation> AllAnnotations(this UstNode node)
 {
     return(GetNodes <Annotation>(node));
 }
Exemple #8
0
 public static UstList <BlockStatement> AllBlockStatements(this UstNode node)
 {
     return(GetNodes <BlockStatement>(node));
 }
Exemple #9
0
 public static UstList <ArrowExpressionClause> AllArrowExpressionClauses(this UstNode node)
 {
     return(GetNodes <ArrowExpressionClause>(node));
 }
Exemple #10
0
 public static UstList <LiteralExpression> AllLiterals(this UstNode node)
 {
     return(GetNodes <LiteralExpression>(node));
 }
Exemple #11
0
 public static UstList <ObjectCreationExpression> AllObjectCreationExpressions(this UstNode node)
 {
     return(GetNodes <ObjectCreationExpression>(node));
 }
Exemple #12
0
 public static UstList <ExpressionStatement> AllExpressions(this UstNode node)
 {
     return(GetNodes <ExpressionStatement>(node));
 }
Exemple #13
0
 public static UstList <InterfaceDeclaration> AllInterfaces(this UstNode node)
 {
     return(GetNodes <InterfaceDeclaration>(node));
 }
Exemple #14
0
 public static UstList <ClassDeclaration> AllClasses(this UstNode node)
 {
     return(GetNodes <ClassDeclaration>(node));
 }
Exemple #15
0
 public static UstList <EnumDeclaration> AllEnumDeclarations(this UstNode node)
 {
     return(GetNodes <EnumDeclaration>(node));
 }
Exemple #16
0
 public static UstList <StructDeclaration> AllStructDeclarations(this UstNode node)
 {
     return(GetNodes <StructDeclaration>(node));
 }
Exemple #17
0
 public static UstList <MethodDeclaration> AllMethods(this UstNode node)
 {
     return(GetNodes <MethodDeclaration>(node));
 }
Exemple #18
0
 public static UstList <Argument> AllArguments(this UstNode node)
 {
     return(GetNodes <Argument>(node));
 }
Exemple #19
0
 public static UstList <ReturnStatement> AllReturnStatements(this UstNode node)
 {
     return(GetNodes <ReturnStatement>(node));
 }