Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

  • Compiler
  • Engine
  • Helpers
  • HtmlNode
  • MacroNode
  • MacroTokens
  • Parser
  • PhpHelpers
  • PhpWriter
  • Token
  • TokenIterator
  • Tokenizer

Interfaces

  • ILoader
  • IMacro

Traits

  • Strict

Exceptions

  • CompileException
  • RegexpException
  • RuntimeException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases

Class TokenIterator

Traversing helper.

Latte\TokenIterator uses Latte\Strict

Direct known subclasses

Latte\MacroTokens
Namespace: Latte
Internal
Located at Latte/Compiler/TokenIterator.php
Methods summary
public
# __construct( array $tokens )

Parameters

$tokens
public array|null
# currentToken( )

Returns current token.

Returns current token.

Returns

array|null
array|null
public string|null
# currentValue( )

Returns current token value.

Returns current token value.

Returns

string|null
string|null
public array|null
# nextToken( )

Returns next token.

Returns next token.

Returns

array|null
array|null
public string|null
# nextValue( )

Returns next token value.

Returns next token value.

Returns

string|null
string|null
public array[]
# nextAll( )

Returns all next tokens.

Returns all next tokens.

Returns

array[]
array[]
public array[]
# nextUntil( integer|string $arg )

Returns all next tokens until it sees a given token type or value.

Returns all next tokens until it sees a given token type or value.

Parameters

$arg
type or value to stop before

Returns

array[]
array[]
public string
# joinAll( )

Returns concatenation of all next token values.

Returns concatenation of all next token values.

Returns

string
string
public string
# joinUntil( integer|string $arg )

Returns concatenation of all next tokens until it sees a given token type or value.

Returns concatenation of all next tokens until it sees a given token type or value.

Parameters

$arg
type or value to stop before

Returns

string
string
public boolean
# isCurrent( integer|string $arg )

Checks the current token.

Checks the current token.

Parameters

$arg
type or value

Returns

boolean
bool
public boolean
# isNext( )

Checks the next token existence.

Checks the next token existence.

Returns

boolean
bool
public boolean
# isPrev( )

Checks the previous token existence.

Checks the previous token existence.

Returns

boolean
bool
public string
# expectNextValue( )

Returns next expected token or throws exception.

Returns next expected token or throws exception.

Returns

string
string

Throws

Latte\CompileException
CompileException
public Latte\TokenIterator
# reset( )

Returns

Latte\TokenIterator
static
protected
# next( )

Moves cursor to next token.

Moves cursor to next token.

protected mixed
# scan( array $wanted, boolean $onlyFirst, boolean $advance, boolean $strings = false, boolean $until = false, boolean $prev = false )

Looks for (first) (not) wanted tokens.

Looks for (first) (not) wanted tokens.

Parameters

$wanted
desired token types or values
$onlyFirst
$advance
$strings
$until
$prev

Returns

mixed
mixed
Methods used from Latte\Strict
__call(), __callStatic(), __get(), __isset(), __set(), __unset()
Properties summary
public array $tokens
#
public integer $position
#-1
public array $ignored
#[]
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0