lexer

lexer

new lexer()

This is the php lexer. It will tokenize the string for helping the parser to build the AST from its grammar.

Properties:
Name Type Description
EOF Integer
all_tokens Boolean

defines if all tokens must be retrieved (used by token_get_all only)

comment_tokens Boolean

extracts comments tokens

mode_eval Boolean

enables the evald mode (ignore opening tags)

asp_tags Boolean

disables by default asp tags mode

short_tags Boolean

enables by default short tags mode

keywords Object

List of php keyword

castKeywords Object

List of php keywords for type casting

Source:

Methods

getState()

Gets the current state

Source:

input()

consumes and returns one char from the input

Source:

setInput()

Initialize the lexer with the specified input

Source:

setState()

Sets the current lexer state

Source:

unput()

revert eating specified size

Source: