示例#1
0
文件: UI.php 项目: JeCat/framework
 public function compile(IInputStream $aSourceInput, IOutputStream $aCompiledOutput, ObjectContainer $aObjectContainer = null, $bIntact = true)
 {
     if (!$aObjectContainer) {
         $aObjectContainer = new ObjectContainer();
     }
     // 解析
     $this->interpreters()->parse($aSourceInput, $aObjectContainer, $this);
     // 编译
     $aTargetCodeStream = new TargetCodeOutputStream();
     if ($bIntact) {
         $aTargetCodeStream->start();
     }
     $this->compilers()->compile($aObjectContainer, $aTargetCodeStream);
     if ($bIntact) {
         $aTargetCodeStream->finish();
     }
     $aCompiledOutput->write($aTargetCodeStream->bufferBytes(true));
 }