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