GetReplacedNodes() public static méthode

public static GetReplacedNodes ( AstNode expression ) : IList
expression AstNode
Résultat IList
        public AssignmentExpression ConvertToInitializer(AssignmentExpression assignmentExpression, ref IList <AstNode> statements)
        {
            if (assignmentExpression == null)
            {
                throw new ArgumentNullException("assignmentExpression");
            }
            if (statements == null)
            {
                throw new ArgumentNullException("statements");
            }
            if (!(assignmentExpression.Right is ObjectCreateExpression))
            {
                throw new ArgumentException("assignmentExpression.Right must be an ObjectCreateExpression", "assignmentExpression");
            }

            if (!Initialize(assignmentExpression.Left))
            {
                return(null);
            }
            accessPaths [mainAccessPath] = assignmentExpression.Right.Clone();

            Convert(statements);
            statements = ReplacementNodeHelper.GetReplacedNodes(accessPaths [mainAccessPath]);
            return(new AssignmentExpression(new IdentifierExpression(mainAccessPath.RootName), accessPaths [mainAccessPath]));
        }
Exemple #2
0
        public VariableInitializer ConvertToInitializer(VariableInitializer variableInitializer, ref IList <AstNode> statements)
        {
            if (variableInitializer == null)
            {
                throw new ArgumentNullException("variableInitializer");
            }
            if (statements == null)
            {
                throw new ArgumentNullException("statements");
            }

            Initialize(variableInitializer);
            accessPaths [mainAccessPath] = variableInitializer.Initializer.Clone();

            Convert(statements);
            statements = ReplacementNodeHelper.GetReplacedNodes(accessPaths [mainAccessPath]);
            return(new VariableInitializer(mainAccessPath.RootName, accessPaths [mainAccessPath]));
        }