src/Behat/Gherkin/Lexer.php
public function analyse($input, $language = 'en')
    {
        // try to detect unsupported encoding
        if ('UTF-8' !== mb_detect_encoding($input, 'UTF-8', true)) {
            throw new LexerException('Feature file is not in UTF8 encoding');
        }

        $input = strtr($input, array("\r\n" => "\n", "\r" => "\n"));

        $this->lines = explode("\n", $input);
        $this->linesCount = count($this->lines);
        $this->line = $this->lines[0];
        $this->lineNumber = 1;
        $this->trimmedLine = null;
        $this->eos = false;

        $this->deferredObjects = array();
        $this->deferredObjectsCount = 0;
        $this->stashedToken = null;
        $this->inPyString = false;
        $this->pyStringSwallow = 0;

        $this->featureStarted = false;
        $this->allowMultilineArguments = false;
        $this->allowSteps = false;

        $this->keywords->setLanguage($this->language = $language);
        $this->keywordsCache = array();
        $this->stepKeywordTypesCache = array();
    }
public function analyse($input, $language = 'en')
    {
        // try to detect unsupported encoding
        if ('UTF-8' !== mb_detect_encoding($input, 'UTF-8', true)) {
            throw new LexerException('Feature file is not in UTF8 encoding');
        }

        $input = strtr($input, array("\r\n" => "\n", "\r" => "\n"));

        $this->lines = explode("\n", $input);
        $this->linesCount = count($this->lines);
        $this->line = $this->lines[0];
        $this->lineNumber = 1;
        $this->trimmedLine = null;
        $this->eos = false;

        $this->deferredObjects = array();
        $this->deferredObjectsCount = 0;
        $this->stashedToken = null;
        $this->inPyString = false;
        $this->pyStringSwallow = 0;

        $this->featureStarted = false;
        $this->allowMultilineArguments = false;
        $this->allowSteps = false;

        $this->keywords->setLanguage($this->language = $language);
        $this->keywordsCache = array();
        $this->stepKeywordTypesCache = array();
    }
public function analyse ( $ input , $ language = 'en' ) { // try to detect unsupported encoding if ( 'UTF-8' !== mb_detect_encoding ( $ input , 'UTF-8' , true ) ) { throw new LexerException ( 'Feature file is not in UTF8 encoding' ) ; } $ input = strtr ( $ input , array ( "\r\n" => "\n" , "\r" => "\n" ) ) ; $ this -> lines = explode ( "\n" , $ input ) ; $ this -> linesCount = count ( $ this -> lines ) ; $ this -> line = $ this -> lines [ 0 ] ; $ this -> lineNumber = 1 ; $ this -> trimmedLine = null ; $ this -> eos = false ; $ this -> deferredObjects = array ( ) ; $ this -> deferredObjectsCount = 0 ; $ this -> stashedToken = null ; $ this -> inPyString = false ; $ this -> pyStringSwallow = 0 ; $ this -> featureStarted = false ; $ this -> allowMultilineArguments = false ; $ this -> allowSteps = false ; $ this -> keywords -> setLanguage ( $ this -> language = $ language ) ; $ this -> keywordsCache = array ( ) ; $ this -> stepKeywordTypesCache = array ( ) ; }
Sets lexer input.

@param string $input    Input string
@param string $language Language name

@throws Exception\LexerException
Sets lexer input .