Language/GreedyLanguage.php
public function parse($tokens = null, $additional = [], $embedded = false)
    {
        if (is_string($tokens)) {
            $tokens = $this->tokenize($tokens, $additional, $embedded);
        } elseif (!$tokens instanceof TokenIterator) {
            // Todo: Own Exceptions
            throw new \InvalidArgumentException('$tokens must be string or TokenIterator');
        }

        return $this->_process($tokens);
    }
public function parse($tokens = null, $additional = [], $embedded = false)
    {
        if (is_string($tokens)) {
            $tokens = $this->tokenize($tokens, $additional, $embedded);
        } elseif (!$tokens instanceof TokenIterator) {
            // Todo: Own Exceptions
            throw new \InvalidArgumentException('$tokens must be string or TokenIterator');
        }

        return $this->_process($tokens);
    }
public function parse ( $ tokens = null , $ additional = [ ] , $ embedded = false ) { if ( is_string ( $ tokens ) ) { $ tokens = $ this -> tokenize ( $ tokens , $ additional , $ embedded ) ; } elseif ( ! $ tokens instanceof TokenIterator ) { // Todo: Own Exceptions throw new \ InvalidArgumentException ( '$tokens must be string or TokenIterator' ) ; } return $ this -> _process ( $ tokens ) ; }
Parses source and removes wrong tokens.

@param TokenIterator|string $tokens

@param array                $additional
@param bool                 $embedded

@return Tokens
@throws \InvalidArgumentException
Parses source and removes wrong tokens .