Var = ParseFactory::GetParseElement($options->V, $this); if(isset($options->C) && $options->C != null) $this->Cond = ParseFactory::GetParseElement($options->C, $this); if(isset($options->I) && $options->I != null) $this->Inc = ParseFactory::GetParseElement($options->I, $this); $this->Statement = ParseFactory::GetParseElement($options->S, $this); } public function Parse($type = null) { $this->ShouldBreak = false; $this->Var->Parse(); $result = null; while($this->Cond == null || $this->Cond->Parse()) { $result = $this->Statement->Parse(); if($this->ShouldBreak) return $result; if($this->Inc != null) $this->Inc->Parse(); } return $result; } public function ReturnWasExecuted() { $this->ShouldBreak = true; ParseUtilities::NotifyReturnToParent($this); } public function BreakWasExecuted() { $this->ShouldBreak = true; } }