home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / Text / Highlighter / Renderer.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  3.4 KB  |  165 lines

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  3. /**
  4.  * Abstract base class for Highlighter renderers
  5.  *
  6.  * PHP versions 4 and 5
  7.  *
  8.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  9.  * that is available through the world-wide-web at the following URI:
  10.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  11.  * the PHP License and are unable to obtain it through the web, please
  12.  * send a note to license@php.net so we can mail you a copy immediately.
  13.  *
  14.  * @category   Text
  15.  * @package    Text_Highlighter
  16.  * @author     Andrey Demenev <demenev@gmail.com>
  17.  * @copyright  2004-2006 Andrey Demenev
  18.  * @license    http://www.php.net/license/3_0.txt  PHP License
  19.  * @version    CVS: $Id: Renderer.php,v 1.1 2007/06/03 02:36:35 ssttoo Exp $
  20.  * @link       http://pear.php.net/package/Text_Highlighter
  21.  */
  22.  
  23. /**
  24.  * Abstract base class for Highlighter renderers
  25.  *
  26.  * @author Andrey Demenev <demenev@gmail.com>
  27.  * @category   Text
  28.  * @package    Text_Highlighter
  29.  * @copyright  2004-2006 Andrey Demenev
  30.  * @license    http://www.php.net/license/3_0.txt  PHP License
  31.  * @version    Release: 0.7.1
  32.  * @link       http://pear.php.net/package/Text_Highlighter
  33.  * @abstract
  34.  */
  35.  
  36. class Text_Highlighter_Renderer
  37. {
  38.     /**
  39.      * Renderer options
  40.      *
  41.      * @var array
  42.      * @access protected
  43.      */
  44.     var $_options = array();
  45.  
  46.     /**
  47.      * Current language
  48.      *
  49.      * @var string
  50.      * @access protected
  51.      */
  52.     var $_language = '';
  53.  
  54.     /**
  55.      * Constructor
  56.      *
  57.      * @access public
  58.      *
  59.      * @param  array $options  Rendering options. Renderer-specific.
  60.      */
  61.     function __construct($options = array())
  62.     {
  63.         $this->_options = $options;
  64.     }
  65.  
  66.     /**
  67.      * PHP4 compatable constructor
  68.      *
  69.      * @access public
  70.      *
  71.      * @param  array $options  Rendering options. Renderer-specific.
  72.      */
  73.     function Text_Highlighter_Renderer($options = array())
  74.     {
  75.         $this->__construct($options);
  76.     }
  77.  
  78.     /**
  79.      * Resets renderer state
  80.      *
  81.      * @access public
  82.      *
  83.      * @param  array $options  Rendering options. Renderer-specific.
  84.      */
  85.     function reset()
  86.     {
  87.         return;
  88.     }
  89.  
  90.     /**
  91.      * Preprocesses code
  92.      *
  93.      * @access public
  94.      *
  95.      * @param  string $str Code to preprocess
  96.      * @return string Preprocessed code
  97.      */
  98.     function preprocess($str)
  99.     {
  100.         return $str;
  101.     }
  102.  
  103.     /**
  104.      * Accepts next token
  105.      *
  106.      * @abstract
  107.      * @access public
  108.      *
  109.      * @param  string $class   Token class
  110.      * @param  string $content Token content
  111.      */
  112.     function acceptToken($class, $content)
  113.     {
  114.         return;
  115.     }
  116.  
  117.     /**
  118.      * Signals that no more tokens are available
  119.      *
  120.      * @access public
  121.      *
  122.      */
  123.     function finalize()
  124.     {
  125.         return;
  126.     }
  127.  
  128.     /**
  129.      * Get generated output
  130.      *
  131.      * @abstract
  132.      * @return mixed Renderer-specific
  133.      * @access public
  134.      *
  135.      */
  136.     function getOutput()
  137.     {
  138.         return;
  139.     }
  140.  
  141.     /**
  142.      * Set current language
  143.      *
  144.      * @abstract
  145.      * @return void
  146.      * @access public
  147.      *
  148.      */
  149.     function setCurrentLanguage($lang)
  150.     {
  151.         $this->_language = $lang;
  152.     }
  153.  
  154. }
  155.  
  156. /*
  157.  * Local variables:
  158.  * tab-width: 4
  159.  * c-basic-offset: 4
  160.  * c-hanging-comment-ender-p: nil
  161.  * End:
  162.  */
  163.  
  164. ?>
  165.