public function parse(string $input)
    {
        $pos = 0;
        while (null !== ($match = $this->parseOne($input, $pos))) {
            $pos = $match->nextOffset;
            yield $match->token;
        }
    }
public function parse(string $input)
    {
        $pos = 0;
        while (null !== ($match = $this->parseOne($input, $pos))) {
            $pos = $match->nextOffset;
            yield $match->token;
        }
    }
public function parse ( string $ input ) { $ pos = 0 ; while ( null !== ( $ match = $ this -> parseOne ( $ input , $ pos ) ) ) { $ pos = $ match -> nextOffset ; yield $ match -> token ; } }
Parse input text into Tokens

Lexer will be compiled if didn't yet.

Note: Parsing in this way will be context independent. To utilize context dependent
parsing use `parseOne()` in you own loop.

@param string $input Input text to parse
@return \Generator|Token[] Returns generator of `Token`s. Generator has no its own return value.
@throws UnknownCharacterException Nothing matched in a current position
Parse input text into Tokens