class Twig_TokenStream
Represents a token stream.
Methods
|
__construct(array $tokens, string $filename = null)
Constructor. |
||
| string |
__toString()
Returns a string representation of the token stream. |
|
| injectTokens(array $tokens) | ||
| Twig_Token |
next()
Sets the pointer to the next token and returns the old one. |
|
| Twig_Token |
expect($type, $value = null, $message = null)
Tests a token and returns it or throws a syntax error. |
|
| Twig_Token |
look(integer $number = 1)
Looks at the next token. |
|
| bool |
test($primary, $secondary = null)
Tests the current token |
|
| bool |
isEOF()
Checks if end of stream was reached |
|
| Twig_Token |
getCurrent()
Gets the current token |
|
| string |
getFilename()
Gets the filename associated with this stream |
Details
at line 30
public
__construct(array $tokens, string $filename = null)
Constructor.
at line 42
public string
__toString()
Returns a string representation of the token stream.
at line 47
public
injectTokens(array $tokens)
at line 57
public Twig_Token
next()
Sets the pointer to the next token and returns the old one.
at line 71
public Twig_Token
expect($type, $value = null, $message = null)
Tests a token and returns it or throws a syntax error.
at line 96
public Twig_Token
look(integer $number = 1)
Looks at the next token.
at line 110
public bool
test($primary, $secondary = null)
Tests the current token
at line 120
public bool
isEOF()
Checks if end of stream was reached
at line 130
public Twig_Token
getCurrent()
Gets the current token
at line 140
public string
getFilename()
Gets the filename associated with this stream