MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
Referência à classe Lexer
Diagrama de heranças da classe Lexer
Lexer

Membros públicos

 setInput ($input)
 
 reset ()
 
 resetPeek ()
 
 resetPosition ($position=0)
 
 isNextToken ($token)
 
 moveNext ()
 
 skipUntil ($type)
 
 isA ($value, $token)
 
 peek ()
 
 glimpse ()
 
 getLiteral ($token)
 

Campos de Dados

 $lookahead
 
 $token
 

Membros protegidos

 scan ($input)
 
 getCatchablePatterns ()
 
 getNonCatchablePatterns ()
 
 getType (&$value)
 

Descrição detalhada

Base class for writing simple lexers, i.e. for creating small DSLs.

Desde
2.0
Autor
Guilherme Blanco guilh.nosp@m.erme.nosp@m.blanc.nosp@m.o@ho.nosp@m.tmail.nosp@m..com
Jonathan Wage jonwa.nosp@m.ge@g.nosp@m.mail..nosp@m.com
Roman Borschel roman.nosp@m.@cod.nosp@m.e-fac.nosp@m.tory.nosp@m..org

Definido na linha 31 do ficheiro Lexer.php.

Documentação das funções

◆ getCatchablePatterns()

getCatchablePatterns ( )
abstractprotected

Lexical catchable patterns.

Retorna
array

Reimplementado em Lexer.

◆ getLiteral()

getLiteral ( $token)

Gets the literal for a given token.

Parâmetros
integer$token
Retorna
string

Definido na linha 219 do ficheiro Lexer.php.

◆ getNonCatchablePatterns()

getNonCatchablePatterns ( )
abstractprotected

Lexical non-catchable patterns.

Retorna
array

Reimplementado em Lexer.

◆ getType()

getType ( & $value)
abstractprotected

Retrieve token type. Also processes the token value if necessary.

Parâmetros
string$value
Retorna
integer

Reimplementado em Lexer.

◆ glimpse()

glimpse ( )

Peeks at the next token, returns it and immediately resets the peek.

Retorna
array|null The next token or NULL if there are no more tokens ahead.

Definido na linha 177 do ficheiro Lexer.php.

◆ isA()

isA ( $value,
$token )

Checks if given value is identical to the given token

Parâmetros
mixed$value
integer$token
Retorna
boolean

Definido na linha 153 do ficheiro Lexer.php.

◆ isNextToken()

isNextToken ( $token)

Checks whether a given token matches the current lookahead.

Parâmetros
integer | string$token
Retorna
boolean

Definido na linha 108 do ficheiro Lexer.php.

◆ moveNext()

moveNext ( )

Moves to the next token in the input string.

A token is an associative array containing three items:

  • 'value' : the string value of the token in the input string
  • 'type' : the type of the token (identifier, numeric, string, input parameter, none)
  • 'position' : the position of the token in the input string
Retorna
array|null the next token; null if there is no more tokens left

Definido na linha 124 do ficheiro Lexer.php.

◆ peek()

peek ( )

Moves the lookahead token forward.

Retorna
array | null The next token or NULL if there are no more tokens ahead.

Definido na linha 163 do ficheiro Lexer.php.

◆ reset()

reset ( )

Resets the lexer.

Definido na linha 76 do ficheiro Lexer.php.

◆ resetPeek()

resetPeek ( )

Resets the peek pointer to 0.

Definido na linha 87 do ficheiro Lexer.php.

◆ resetPosition()

resetPosition ( $position = 0)

Resets the lexer position on the input to the given position.

Parâmetros
integer$positionPosition to place the lexical scanner

Definido na linha 97 do ficheiro Lexer.php.

◆ scan()

scan ( $input)
protected

Scans the input string for tokens.

Parâmetros
string$inputa query string

Definido na linha 189 do ficheiro Lexer.php.

◆ setInput()

setInput ( $input)

Sets the input data to be tokenized.

The Lexer is immediately reset and the new input tokenized. Any unprocessed tokens from any previous input are lost.

Parâmetros
string$inputThe input to be tokenized.

Definido na linha 66 do ficheiro Lexer.php.

◆ skipUntil()

skipUntil ( $type)

Tells the lexer to skip input tokens until it sees a token with the given value.

Parâmetros
$typeThe token type to skip until.

Definido na linha 139 do ficheiro Lexer.php.

Documentação dos campos e atributos

◆ $lookahead

$lookahead

Definido na linha 51 do ficheiro Lexer.php.

◆ $token

$token

Definido na linha 56 do ficheiro Lexer.php.


A documentação para esta classe foi gerada a partir do seguinte ficheiro: