public void Analyze(AstNode node) { if (node is ForStatement) { node = ((ForStatement)node).EmbeddedStatement; } VariableNames.Clear(); if (node is ForeachStatement && !ExcludeReadOnly) { var foreachStatement = (ForeachStatement)node; if (foreachStatement.VariableNameToken != null && !foreachStatement.VariableNameToken.IsNull) { VariableNames.Add(foreachStatement.VariableName); var rr = (ForEachResolveResult)Emitter.Resolver.ResolveNode(foreachStatement); Variables.Add(rr.ElementVariable); } } node.AcceptVisitor(this); }