protected override IPhpStatement[] VisitForStatement(ForStatement src) { var condition = TransValue(src.Condition); var statement = TranslateStatementOne(src.Statement); var incrementors = TranslateStatements(src.Incrementors); var declarations = TranslateStatement(src.Declaration).ToArray(); var phpDeclarations = new List <PhpAssignExpression>(); foreach (object declaration in declarations) { var d = declaration; if (declaration is PhpExpressionStatement) { d = (declaration as PhpExpressionStatement).Expression; } if (d is PhpAssignExpression) { phpDeclarations.Add(d as PhpAssignExpression); } else { throw new NotSupportedException(); } } var result = new PhpForStatement(phpDeclarations.ToArray(), condition, statement, incrementors); return(MkArray(result)); }
protected virtual T VisitPhpForStatement(PhpForStatement node) { if (ThrowNotImplementedException) { throw new NotImplementedException(string.Format("Method {0} is not supported in class {1}", "VisitPhpForStatement", this.GetType().FullName)); } return(default(T)); }
protected override IPhpStatement VisitPhpForStatement(PhpForStatement node) { return(node.Simplify(this)); }