ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Represents a token stream. More...
Public Member Functions | |
__construct (array $tokens, $name=null, $source=null) | |
__toString () | |
injectTokens (array $tokens) | |
next () | |
Sets the pointer to the next token and returns the old one. More... | |
nextIf ($primary, $secondary=null) | |
Tests a token, sets the pointer to the next one and returns it or throws a syntax error. More... | |
expect ($type, $value=null, $message=null) | |
Tests a token and returns it or throws a syntax error. More... | |
look ($number=1) | |
Looks at the next token. More... | |
test ($primary, $secondary=null) | |
Tests the current token. More... | |
isEOF () | |
Checks if end of stream was reached. More... | |
getCurrent () | |
getFilename () | |
Gets the name associated with this stream (null if not defined). More... | |
getSource () | |
Gets the source code associated with this stream. More... | |
getSourceContext () | |
Gets the source associated with this stream. More... | |
Protected Attributes | |
$tokens | |
$current = 0 | |
$filename | |
Private Attributes | |
$source | |
Represents a token stream.
Definition at line 20 of file TokenStream.php.
Twig_TokenStream::__construct | ( | array | $tokens, |
$name = null , |
|||
$source = null |
|||
) |
array | $tokens | An array of tokens |
string | null | $name | The name of the template which tokens are associated with |
string | null | $source | The source code associated with the tokens |
Definition at line 33 of file TokenStream.php.
Twig_TokenStream::__toString | ( | ) |
Definition at line 50 of file TokenStream.php.
Twig_TokenStream::expect | ( | $type, | |
$value = null , |
|||
$message = null |
|||
) |
Tests a token and returns it or throws a syntax error.
Definition at line 91 of file TokenStream.php.
References $current, $message, $type, next(), and Twig_Token\typeToEnglish().
Twig_TokenStream::getCurrent | ( | ) |
Twig_TokenStream::getFilename | ( | ) |
Gets the name associated with this stream (null if not defined).
Definition at line 160 of file TokenStream.php.
Twig_TokenStream::getSource | ( | ) |
Gets the source code associated with this stream.
Definition at line 176 of file TokenStream.php.
Twig_TokenStream::getSourceContext | ( | ) |
Gets the source associated with this stream.
Definition at line 190 of file TokenStream.php.
References $source.
Referenced by Twig_TokenParser_For\checkLoopUsageBody(), Twig_TokenParser_For\checkLoopUsageCondition(), and Twig_Parser\parse().
Twig_TokenStream::injectTokens | ( | array | $tokens | ) |
Definition at line 55 of file TokenStream.php.
Twig_TokenStream::isEOF | ( | ) |
Checks if end of stream was reached.
Definition at line 140 of file TokenStream.php.
References $current, and Twig_Token\EOF_TYPE.
Twig_TokenStream::look | ( | $number = 1 | ) |
Looks at the next token.
int | $number |
Definition at line 116 of file TokenStream.php.
Twig_TokenStream::next | ( | ) |
Sets the pointer to the next token and returns the old one.
Definition at line 65 of file TokenStream.php.
Referenced by expect(), and nextIf().
Twig_TokenStream::nextIf | ( | $primary, | |
$secondary = null |
|||
) |
Tests a token, sets the pointer to the next one and returns it or throws a syntax error.
Definition at line 79 of file TokenStream.php.
References next(), and test().
Twig_TokenStream::test | ( | $primary, | |
$secondary = null |
|||
) |
Tests the current token.
Definition at line 130 of file TokenStream.php.
References $current.
Referenced by nextIf().
|
protected |
Definition at line 23 of file TokenStream.php.
Referenced by expect(), getCurrent(), isEOF(), and test().
|
protected |
Definition at line 24 of file TokenStream.php.
|
private |
Definition at line 26 of file TokenStream.php.
Referenced by __construct(), and getSourceContext().
|
protected |
Definition at line 22 of file TokenStream.php.
Referenced by __construct().