PHP Класс Behat\Gherkin\Lexer

Автор: Konstantin Kudryashov ([email protected])
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( Behat\Gherkin\Keywords\KeywordsInterface $keywords ) Initializes lexer.
analyse ( string $input, string $language = 'en' ) Sets lexer input.
deferToken ( array $token ) Defers token.
getAdvancedToken ( ) : array Returns next token or previously stashed one.
getLanguage ( ) : string Returns current lexer language.
predictToken ( ) : array Predicts for number of tokens.
takeToken ( string $type, string $value = null ) : array Constructs token with specified parameters.

Защищенные методы

Метод Описание
consumeLine ( ) Consumes line from input & increments line counter.
getDeferredToken ( ) : array | null Returns deferred token or null if hasn't.
getKeywords ( string $type ) : string Returns keywords for provided type.
getNextToken ( ) : array Returns next token from input.
getStashedToken ( ) : array | null Returns stashed token or null if hasn't.
getTrimmedLine ( ) : string Returns trimmed version of line.
scanBackground ( ) : null | array Scans Background from input & returns it if found.
scanComment ( ) : null | array Scans Comment from input & returns it if found.
scanEOS ( ) : null | array Scans EOS from input & returns it if found.
scanExamples ( ) : null | array Scans Scenario Outline Examples from input & returns it if found.
scanFeature ( ) : null | array Scans Feature from input & returns it if found.
scanInput ( string $regex, string $type ) : null | array Scans for token with specified regex.
scanInputForKeywords ( string $keywords, string $type ) : null | array Scans for token with specified keywords.
scanLanguage ( ) : null | array Scans Language specifier from input & returns it if found.
scanNewline ( ) : null | array Scans Newline from input & returns it if found.
scanOutline ( ) : null | array Scans Scenario Outline from input & returns it if found.
scanPyStringContent ( ) : null | array Scans PyString content.
scanPyStringOp ( ) : null | array Scans PyString from input & returns it if found.
scanScenario ( ) : null | array Scans Scenario from input & returns it if found.
scanStep ( ) : null | array Scans Step from input & returns it if found.
scanTableRow ( ) : null | array Scans Table Row from input & returns it if found.
scanTags ( ) : null | array Scans Tags from input & returns it if found.
scanText ( ) : null | array Scans text from input & returns it if found.

Приватные методы

Метод Описание
getStepKeywordType ( string $native ) : string Returns step type keyword (Given, When, Then, etc.).

Описание методов

__construct() публичный Метод

Initializes lexer.
public __construct ( Behat\Gherkin\Keywords\KeywordsInterface $keywords )
$keywords Behat\Gherkin\Keywords\KeywordsInterface Keywords holder

analyse() публичный Метод

Sets lexer input.
public analyse ( string $input, string $language = 'en' )
$input string Input string
$language string Language name

consumeLine() защищенный Метод

Consumes line from input & increments line counter.
protected consumeLine ( )

deferToken() публичный Метод

Defers token.
public deferToken ( array $token )
$token array Token to defer

getAdvancedToken() публичный Метод

Returns next token or previously stashed one.
public getAdvancedToken ( ) : array
Результат array

getDeferredToken() защищенный Метод

Returns deferred token or null if hasn't.
protected getDeferredToken ( ) : array | null
Результат array | null

getKeywords() защищенный Метод

Returns keywords for provided type.
protected getKeywords ( string $type ) : string
$type string Keyword type
Результат string

getLanguage() публичный Метод

Returns current lexer language.
public getLanguage ( ) : string
Результат string

getNextToken() защищенный Метод

Returns next token from input.
protected getNextToken ( ) : array
Результат array

getStashedToken() защищенный Метод

Returns stashed token or null if hasn't.
protected getStashedToken ( ) : array | null
Результат array | null

getTrimmedLine() защищенный Метод

Returns trimmed version of line.
protected getTrimmedLine ( ) : string
Результат string

predictToken() публичный Метод

Predicts for number of tokens.
public predictToken ( ) : array
Результат array

scanBackground() защищенный Метод

Scans Background from input & returns it if found.
protected scanBackground ( ) : null | array
Результат null | array

scanComment() защищенный Метод

Scans Comment from input & returns it if found.
protected scanComment ( ) : null | array
Результат null | array

scanEOS() защищенный Метод

Scans EOS from input & returns it if found.
protected scanEOS ( ) : null | array
Результат null | array

scanExamples() защищенный Метод

Scans Scenario Outline Examples from input & returns it if found.
protected scanExamples ( ) : null | array
Результат null | array

scanFeature() защищенный Метод

Scans Feature from input & returns it if found.
protected scanFeature ( ) : null | array
Результат null | array

scanInput() защищенный Метод

Scans for token with specified regex.
protected scanInput ( string $regex, string $type ) : null | array
$regex string Regular expression
$type string Expected token type
Результат null | array

scanInputForKeywords() защищенный Метод

Scans for token with specified keywords.
protected scanInputForKeywords ( string $keywords, string $type ) : null | array
$keywords string Keywords (splitted with |)
$type string Expected token type
Результат null | array

scanLanguage() защищенный Метод

Scans Language specifier from input & returns it if found.
protected scanLanguage ( ) : null | array
Результат null | array

scanNewline() защищенный Метод

Scans Newline from input & returns it if found.
protected scanNewline ( ) : null | array
Результат null | array

scanOutline() защищенный Метод

Scans Scenario Outline from input & returns it if found.
protected scanOutline ( ) : null | array
Результат null | array

scanPyStringContent() защищенный Метод

Scans PyString content.
protected scanPyStringContent ( ) : null | array
Результат null | array

scanPyStringOp() защищенный Метод

Scans PyString from input & returns it if found.
protected scanPyStringOp ( ) : null | array
Результат null | array

scanScenario() защищенный Метод

Scans Scenario from input & returns it if found.
protected scanScenario ( ) : null | array
Результат null | array

scanStep() защищенный Метод

Scans Step from input & returns it if found.
protected scanStep ( ) : null | array
Результат null | array

scanTableRow() защищенный Метод

Scans Table Row from input & returns it if found.
protected scanTableRow ( ) : null | array
Результат null | array

scanTags() защищенный Метод

Scans Tags from input & returns it if found.
protected scanTags ( ) : null | array
Результат null | array

scanText() защищенный Метод

Scans text from input & returns it if found.
protected scanText ( ) : null | array
Результат null | array

takeToken() публичный Метод

Constructs token with specified parameters.
public takeToken ( string $type, string $value = null ) : array
$type string Token type
$value string Token value
Результат array