Packages

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • none

Classes

Exceptions

  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class Tokenizer

Simple lexical analyser.

Object
Extended by Tokenizer

Direct known subclasses

MacroTokenizer
Package: Nette\Utils
Author: David Grudl
Located at Utils/Tokenizer.php
Methods summary
public
# __construct( array $patterns, string $flags = '' )

Parameters

$patterns
array
of [(int) symbol type => pattern]
$flags
string
regular expression flag
public array
# tokenize( string $input )

Tokenize string.

Tokenize string.

Parameters

$input
string

Returns

array
public static
# createToken( $value, $type = NULL, $line = NULL )
public array
# getOffset( integer $i )

Returns position of token in input string.

Returns position of token in input string.

Parameters

$i
integer
token number

Returns

array
[offset, line, column]
public string
# fetch( )

Returns next token as string.

Returns next token as string.

Returns

string
public array|string
# fetchToken( )

Returns next token.

Returns next token.

Returns

array|string
public string
# fetchAll( )

Returns concatenation of all next tokens.

Returns concatenation of all next tokens.

Returns

string
public string
# fetchUntil( Tokenizer::$tokens $arg )

Returns concatenation of all next tokens until it sees a token with the given value.

Returns concatenation of all next tokens until it sees a token with the given value.

Parameters

$arg
Tokenizer::$tokens

Returns

string
public string
# isNext( token $arg )

Checks the next token.

Checks the next token.

Parameters

$arg
token

Returns

string
public string
# isPrev( token $arg )

Checks the previous token.

Checks the previous token.

Parameters

$arg
token

Returns

string
public boolean
# hasNext( )

Checks existence of next token.

Checks existence of next token.

Returns

boolean
public boolean
# hasPrev( )

Checks existence of previous token.

Checks existence of previous token.

Returns

boolean
public string
# isCurrent( token $arg )

Checks the current token.

Checks the current token.

Parameters

$arg
token

Returns

string
public
# reset( )
Methods inherited from Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Properties summary
public array $tokens
#
public integer $position 0
#
public array $ignored array()
#
public array|string $current
#
Magic properties inherited from Object
$reflection
Nette Framework 2.0.18 (for PHP 5.2, un-prefixed) API documentation generated by ApiGen 2.8.0