LexerInterface.php 654B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2009 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 lexer classes.
  12. *
  13. * @package twig
  14. * @author Fabien Potencier <fabien@symfony.com>
  15. */
  16. interface Twig_LexerInterface
  17. {
  18. /**
  19. * Tokenizes a source code.
  20. *
  21. * @param string $code The source code
  22. * @param string $filename A unique identifier for the source code
  23. *
  24. * @return Twig_TokenStream A token stream instance
  25. */
  26. function tokenize($code, $filename = null);
  27. }