[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/wact/src/compiler/expression/node/ -> WactConstantExpressionNode.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  
  10  /**
  11   * A property representing a constant value.
  12   * @package wact
  13   * @version $Id$
  14   */
  15  class WactConstantExpressionNode extends WactTemplateExpressionNode
  16  {
  17    protected $value;
  18  
  19    function __construct($value)
  20    {
  21      $this->value = $value;
  22    }
  23  
  24    /**
  25    * Does this property refer to a constant value at compile time?
  26    * @return Boolean
  27    */
  28    function isConstant()
  29    {
  30      return TRUE;
  31    }
  32  
  33    /**
  34    * Return this value as a PHP value
  35    * @return String
  36    */
  37    function getValue()
  38    {
  39      return $this->value;
  40    }
  41  
  42    /**
  43    * Generate the code to read the data value at run time
  44    * Must generate only a valid PHP Expression.
  45    * @param WactCodeWriter
  46    * @return void
  47    */
  48    function generateExpression($code)
  49    {
  50      $code->writePHP(var_export($this->value, TRUE));
  51    }
  52  }
  53  
  54  ?>


Generated: Sat Aug 30 04:38:32 2008 Cross-referenced by PHPXref 0.7