TokenParserInterface.php 910B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2010 Fabien Potencier
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. /**
  11. * Interface implemented by token parsers.
  12. *
  13. * @package twig
  14. * @author Fabien Potencier <fabien@symfony.com>
  15. */
  16. interface Twig_TokenParserInterface
  17. {
  18. /**
  19. * Sets the parser associated with this token parser
  20. *
  21. * @param $parser A Twig_Parser instance
  22. */
  23. function setParser(Twig_Parser $parser);
  24. /**
  25. * Parses a token and returns a node.
  26. *
  27. * @param Twig_Token $token A Twig_Token instance
  28. *
  29. * @return Twig_NodeInterface A Twig_NodeInterface instance
  30. */
  31. function parse(Twig_Token $token);
  32. /**
  33. * Gets the tag name associated with this token parser.
  34. *
  35. * @return string The tag name
  36. */
  37. function getTag();
  38. }