ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
TestTokenParser Class Reference
+ Inheritance diagram for TestTokenParser:
+ Collaboration diagram for TestTokenParser:

Public Member Functions

 parse (Twig_Token $token)
 Parses a token and returns a node. More...
 
 getTag ()
 Gets the tag name associated with this token parser. More...
 
- Public Member Functions inherited from Twig_TokenParser
 setParser (Twig_Parser $parser)
 Sets the parser associated with this token parser. More...
 

Additional Inherited Members

- Protected Attributes inherited from Twig_TokenParser
 $parser
 

Detailed Description

Definition at line 170 of file ParserTest.php.

Member Function Documentation

◆ getTag()

TestTokenParser::getTag ( )

Gets the tag name associated with this token parser.

Returns
string The tag name

Implements Twig_TokenParserInterface.

Definition at line 188 of file ParserTest.php.

195  {

◆ parse()

TestTokenParser::parse ( Twig_Token  $token)

Parses a token and returns a node.

Returns
Twig_NodeInterface
Exceptions
Twig_Error_Syntax

Implements Twig_TokenParserInterface.

Definition at line 172 of file ParserTest.php.

177 {
178  public function parse(Twig_Token $token)
179  {
180  // simulate the parsing of another template right in the middle of the parsing of the current template
181  $this->parser->parse(new Twig_TokenStream(array(
183  new Twig_Token(Twig_Token::NAME_TYPE, 'extends', 1),
184  new Twig_Token(Twig_Token::STRING_TYPE, 'base', 1),
186  new Twig_Token(Twig_Token::EOF_TYPE, '', 1),
Represents a token stream.
Definition: TokenStream.php:20
const STRING_TYPE
Definition: Token.php:34
parse(Twig_Token $token)
Parses a token and returns a node.
Definition: ParserTest.php:172
const BLOCK_START_TYPE
Definition: Token.php:28
Create styles array
The data for the language used.
const EOF_TYPE
Definition: Token.php:26
const NAME_TYPE
Definition: Token.php:32
const BLOCK_END_TYPE
Definition: Token.php:30

The documentation for this class was generated from the following file: