Parse while control structure.
@return WhileNode
772919
private function _while() {
    $node = new WhileNode();
    $this->mustMatch(T_WHILE, $node);
    $this->condition($node, 'condition');
    if ($this->tryMatch(':', $node, 'openColon', FALSE, TRUE)) {
      $node->addChild($this->innerStatementListNode(T_ENDWHILE), 'body');
      $this->mustMatch(T_ENDWHILE, $node, 'endKeyword');
      $this->endStatement($node);
      return $node;
    }
    else {
      $this->matchHidden($node);
      $node->addChild($this->statement(), 'body');
      return $node;
    }
  }
458076
public function parse()
    {
        $newTokens = array();
        $len = count($this->tokens);
        $this->stack = array();
        $propValue = 'PROPERTY';
        $pushes = array(
            'L_BRACKET' => 'bracket',
            'L_BRACE' => 'brace',
            'AT_IDENTIFIER' => 'at',
            'L_SQ_BRACKET' => 'square'
        );
        $pops = array(
            'R_BRACKET' => 'bracket',
            'R_BRACE' => 'brace',
            'R_SQ_BRACKET' => 'square'
        );
        $this->index = 0;
        while ($this->index < $len) {
            $token = &$this->tokens[$this->index];
            $stackSize = count($this->stack);
            $state = !$stackSize? null : $this->stack[$stackSize - 1];
            $tokName = &$token[0];
            $inBrace = in_array('brace', $this->stack);
            $inBracket = in_array('bracket', $this->stack);
            $inSq = in_array('square', $this->stack);
            $inAt = in_array('at', $this->stack);
            if ($tokName === self::$deleteToken) {
                continue;
            }

            if ($tokName === 'L_BRACE') {
                if ($state === 'at') {
                    array_pop($this->stack);
                }
                $this->stack[] = $pushes[$tokName];
                $propValue = 'PROPERTY';
            } elseif (isset($pushes[$tokName])) {
                $this->stack[] = $pushes[$tokName];
            } elseif (isset($pops[$tokName]) && $state === $pops[$tokName]) {
                array_pop($this->stack);
            } elseif (!$inBracket && $tokName === 'COLON') {
                $propValue = 'VALUE';
            } elseif ($tokName === 'SEMICOLON') {
                $propValue = 'PROPERTY';
                if ($state === 'at') {
                    array_pop($this->stack);
                }
            } elseif ($tokName === 'GENERIC_IDENTIFIER') {
                // this is where the fun starts.
                // we have to figure out exactly what this is
                // if we can look ahead and find a '{' before we find a
                // ';', then this is part of a selector.
                // Otherwise it's part of a property/value pair.
                // the exception is when we have something like:
                // font : { family : sans-serif; }
                // then we need to check for ':{'
                if ($inSq) {
                    $token[0] = 'ATTR_SELECTOR';
                } elseif ($inBracket) {
                    $this->parseIdentifier($token);
                } elseif (!$inAt) {
                    $semi = $this->nextOfType('SEMICOLON');
                    $colonBrace = $this->nextSequence(array('COLON', 'L_BRACE'), array('WHITESPACE'));
                    $brace = $this->nextOfType('L_BRACE');

                    $ruleTerminator = min($semi, $colonBrace);
                    if ($brace < $ruleTerminator) {
                        $this->parseRule();
                        $propValue = 'PROPERTY';
                    } else {
                        $this->tokens[$this->index][0] = $propValue;
                        if ($propValue === 'VALUE') {
                            $this->parseIdentifier($token);
                        }
                    }
                }
            }
            $this->index++;
        }
        $this->cleanup();
    }
660833
public function parse()
    {
        if ($this->buffer === '') {
            return false;
        }
        $this->frame = null;
        $this->offset = 0;
        $this->bufferSize = strlen($this->buffer);
        while ($this->offset < $this->bufferSize) {
            if ($this->mode === self::MODE_HEADER) {
                $this->skipEmptyLines();
                if ($this->detectFrameHead()) {
                    $this->mode = self::MODE_BODY;
                } else {
                    break;
                }
            }
            if ($this->detectFrameEnd()) {
                $this->mode = self::MODE_HEADER;
            }
            break;
        }

        if ($this->offset > 0) {
            // remove parsed buffer
            $this->buffer = substr($this->buffer, $this->offset);
        }
        return $this->frame !== null;
    }
1090920
public function parse() : array
    {
        $buffer = $this->routing_rule;
        
        $section_list_set = [];
        $current_list = [];
        do
        {
            $pos = strpos(substr($buffer,1),'/');
            $section = $pos !== false ? substr($buffer, 1, $pos) : substr($buffer, 1);
            $buffer = $pos !== false ? substr($buffer, $pos + 1) : '';
            
            $length = strlen($section);
            if ($length === 0){
                $current_list[] = new class implements EmptyRoutingPathInterface {};
                if (!empty($buffer)){
                    throw new RoutingRuleParseException($this->routing_rule, "Empty routing section is allowed only for last element");
                }
                break;
            }
            $first = $section[0];
            $last = $section[$length - 1];
            if ($first === '[' && $last === ']'){
                // push current list
                $section_list_set[] = $current_list + ['()'];
                // add optional part to current list
                $inside = substr($section, 1, $length - 2);
                if ($inside[0] === ':') {
                    $current_list[] = self::parseVariablePattern($inside);
                }
                else {
                    $current_list[] = $inside;
                }
            }
            else if ($first === ':') {
                $current_list[] = self::parseVariablePattern($section);
            }
            else {
                $current_list[] = $section;
            }
        }
        while(!empty($buffer));
        
        $section_list_set[] = $current_list;
        return $section_list_set;
    }
1195336
protected function parse()
    {
        $lines = explode("\n", $this->comment);

        $current_annotation = null;
        $value = null;
        foreach ($lines as $line)
        {
            $line = trim(ltrim($line, "/* \t"));

            if (preg_match("/^@(\w+)( (.*))?$/", $line, $matches) === 1)
            {
                if (!empty($value))
                    $this->annotations[$current_annotation][] = $value;

                $current_annotation = $matches[1];
                $value = $matches[3] ?? '';
            }
            elseif ($current_annotation !== null)
            {
                $value .= "\n" . $line;
            }
            else
            {
                $this->preamble[] = $line;
            }
        }

        if (!empty($value))
            $this->annotations[$current_annotation][] = rtrim($value);
    }
402953
public function parseText() : void
    {
        if (!count($this->stream->getTokens())) {
            return;
        }

        if ($this->accept(Token::T_TEXT)) {
            $this->insert(new TextNode($this->getCurrentToken()->getValue()));
            $this->advance();
        }
    }
633760
private function parseItem()
    {
        $subparser = new StringValue($this->parser, ($this->level + 1));
        $subparser->parse();

        $key = $subparser->getValue();

        $this->debug('key: ' . var_export($key, true));

        if ($this->tokenIs(T_DOUBLE_ARROW)) {
            // We MUST have an key when double arrow is encountered.
            if ($key === null) {
                $this->bailUnexpectedToken();
            }

            $this->pushStack($key);
            $this->parseValue();
            $this->popStack();
        } elseif ($this->tokenIs(',') || $this->tokenIs(')') || $this->tokenIs(']')) {
            // String item without key.
            $this->debug('String item without key.');
            $this->pushStack($this->counter++);
            $this->parser->setValue($this->parser->getStack(), $key);
            $this->popStack();
        }

        if ($this->tokenIs(',')) {
            $this->getNextToken();
            return true;
        }
        if ($this->tokenIs(')') || $this->tokenIs(']')) {
            $this->debug('closing bracket.');
            $this->getNextToken();

            return false;
        }

        return true;
    }
873954
private function parse()
    {
        $this->parameters   = [];
        $this->pathSegments = [];
        $parsedUrl          = parse_url($this->returnValue);
        foreach ($parsedUrl as $key => $value) {
            if ($key == 'query') {
                parse_str($value, $this->parameters);
            } elseif ($key == 'path') {
                $this->pathSegments = ($value) ? explode('/', ltrim($value, '/')) : [];
            } else {
                $this->{$key} = $value;
            }
        }
        return $this;
    }
140426
public function parse() {

		$lines = str_getcsv($this->source, $this->newline, $this->enclosure, $this->escape);

		// add keys from headline if available
		if ($this->getSourceHasHeadline()) {
			$keys = explode($this->delimiter, $lines[0]);
			$this->addKeys($keys);
			unset($lines[0]);
		}

		foreach ($lines as $line) { // iterate over all lines
			
			$values = str_getcsv($line, $this->delimiter, $this->enclosure, $this->escape); // save values in an array
			
			
			foreach ($values as $key => $value) {
				/* remove the escape character, because PHP doesn't do it
				 * https://bugs.php.net/bug.php?id=55413
				 */
				$values[$key] = str_replace($this->escape.$this->enclosure, $this->enclosure, $value);
				// trim all values if trimming is enabled
				if ($this->trim) {
					$values[$key] = trim($values[$key]);
				}
			}
			
			$dataset = array(); // create dataset
			foreach ($values as $position => $rawValue) { // iterate over all values
				$key = isset($this->keys[$position]) ? $this->keys[$position] : $position; // use the property number or a given key as index
				
				$processedValue = $rawValue;

				if (isset($this->modifiers[$key])) { // if there are registered modifiers for that key, let them do their work
					foreach ((array)$this->modifiers[$key] as $modifier) {
						$processedValue = call_user_func($modifier, $processedValue);
					}
				}
				
				$dataset[$key] = $processedValue;
			}

			$this->result[] = $dataset; // add dataset to the final result

		}
		return $this->result;
	}
41665
function parse() {
    $this->output = '';
    # drop tags
    $this->parser->html = preg_replace('#<('.implode('|', $this->drop).')[^>]*>.*</\\1>#sU', '', $this->parser->html);
    while ($this->parser->nextNode()) {
      switch ($this->parser->nodeType) {
        case 'doctype':
          break;
        case 'pi':
        case 'comment':
          if ($this->keepHTML) {
            $this->flushLinebreaks();
            $this->out($this->parser->node);
            $this->setLineBreaks(2);
          }
          # else drop
          break;
        case 'text':
          $this->handleText();
          break;
        case 'tag':
          if (in_array($this->parser->tagName, $this->ignore)) {
            break;
          }
          if ($this->parser->isStartTag) {
            $this->flushLinebreaks();
          }
          if ($this->skipConversion) {
            $this->isMarkdownable(); # update notConverted
            $this->handleTagToText();
            continue;
          }
          if (!$this->parser->keepWhitespace && $this->parser->isBlockElement && $this->parser->isStartTag) {
            $this->parser->html = ltrim($this->parser->html);
          }
          if ($this->isMarkdownable()) {
            if ($this->parser->isBlockElement && $this->parser->isStartTag && !$this->lastWasBlockTag && !empty($this->output)) {
              if (!empty($this->buffer)) {
                $str =& $this->buffer[count($this->buffer) -1];
              } else {
                $str =& $this->output;
              }
              if (substr($str, -strlen($this->indent)-1) != "\n".$this->indent) {
                $str .= "\n".$this->indent;
              }
            }
            $func = 'handleTag_'.$this->parser->tagName;
            $this->$func();
            if ($this->linksAfterEachParagraph && $this->parser->isBlockElement && !$this->parser->isStartTag && empty($this->parser->openTags)) {
              $this->flushStacked();
            }
            if (!$this->parser->isStartTag) {
              $this->lastClosedTag = $this->parser->tagName;
            }
          } else {
            $this->handleTagToText();
            $this->lastClosedTag = '';
          }
          break;
        default:
          trigger_error('invalid node type', E_USER_ERROR);
          break;
      }
      $this->lastWasBlockTag = $this->parser->nodeType == 'tag' && $this->parser->isStartTag && $this->parser->isBlockElement;
    }
    if (!empty($this->buffer)) {
      trigger_error('buffer was not flushed, this is a bug. please report!', E_USER_WARNING);
      while (!empty($this->buffer)) {
        $this->out($this->unbuffer());
      }
    }
    ### cleanup
    $this->output = rtrim(str_replace('&amp;', '&', str_replace('&lt;', '<', str_replace('&gt;', '>', $this->output))));
    # end parsing, flush stacked tags
    $this->flushStacked();
    $this->stack = array();
  }
205955
public function parse()
    {
        $nodes = [];
        foreach (array_slice($this->body, self::POS_NODES_START) as $node) {
            $nodes[] = [
                self::NODE_ID => $node[self::POS_NODE_ID],
                self::NODE_HOST => $node[self::POS_NODE_HOST],
                self::NODE_PORT => $node[self::POS_NODE_PORT],
                self::NODE_PRIORITY => $node[self::POS_NODE_PRIORITY]
            ];
        }

        return [
            self::NODE_VERSION => $this->body[self::POS_VERSION],
            self::NODE_ID => $this->body[self::POS_ID],
            self::NODES => $nodes
        ];
    }
1358580
public function getNext()
    {
        if ($this->currentToken !== null || strlen($this->currentInput) > 0) {
            $this->parseNextToken();

            return $this->currentToken;
        }

        return null;
    }
977807
public function parse() {
		/** @noinspection PhpParamsInspection */
		return $this -> execute(Util::cache(
			$this -> file,
			$this -> raw,
			'viper',
			function($data): NodeCollection {
				$tokens = $this -> tokenize($data);
				return $this -> formLogicalTree($tokens);
			}
		), $this -> data);
	}
189807
def visit_while(self, node):
        """"""
        whiles = "while %s:\n%s" % (node.test.accept(self), self._stmt_list(node.body))
        if node.orelse:
            whiles = "%s\nelse:\n%s" % (whiles, self._stmt_list(node.orelse))
        return whiles
749028
protected function lineByLine():self
	{
		while( ($line= $this->getLine())->hasMore() ){
			$this->lineNumber+= 1;

			if( $this->embedment ){
				$this->embeddingParse($line);
			}else{
				$this->parseLine($line);
			}
		}

		$this->embedment and $this->breakEmbedding();

		$this->closeNodes($this->level);

		$this->isExecuted= true;

		return $this;
	}
1267998
private ParseTree parseWhileStatement() {
    SourcePosition start = getTreeStartLocation();
    eat(TokenType.WHILE);
    eat(TokenType.OPEN_PAREN);
    ParseTree condition = parseExpression();
    eat(TokenType.CLOSE_PAREN);
    ParseTree body = parseStatement();
    return new WhileStatementTree(getTreeLocation(start), condition, body);
  }
31621
public function parse()
    {
        if (isset($this->raw->data)) {
            $this->setData($this->raw->data);
        }

        if (isset($this->raw->included)) {
            $this->setIncluded($this->raw->included);
        }

        if (isset($this->raw->links)) {
            $this->setLinks($this->raw->links);
        }

        if (isset($this->raw->meta)) {
            $this->setMeta($this->raw->meta);
        }

        if (isset($this->raw->errors)) {
            $this->setErrors($this->raw->errors);
        }

        return $this;
    }