Exemple #1
0
 /**
  * Get compiler.
  *
  * @return  \Hoa\Compiler\Llk\Parser
  */
 public static function getCompiler()
 {
     if (null === static::$_compiler) {
         static::$_compiler = Compiler\Llk::load(new File\Read('hoa://Library/Ruler/Grammar.pp'));
     }
     return static::$_compiler;
 }
Exemple #2
0
 /**
  * Transform the object as a string.
  *
  * @return  string
  */
 public function __toString()
 {
     if (null === static::$_compiler) {
         static::$_compiler = new Ruler\Visitor\Compiler();
     }
     return static::$_compiler->visit($this);
 }