示例#1
0
 /**
  * This function is executed by the compiler before the second compilation stage,
  * processing. It migrates syntax from OPT 2.0 to OPT 2.1
  */
 public function preMigrate(Opt_Compiler_Class $compiler)
 {
     if ($compiler->isNamespace($this->getNamespace())) {
         $name = $this->getXmlName();
         //$this->_processXml($compiler, false);
         // Look for the processor
         if (!is_null($processor = $compiler->isInstruction($name))) {
             $processor->migrateNode($this);
         } elseif ($compiler->isComponent($name)) {
             $processor = $compiler->processor('component');
             $processor->migrateComponent($this);
         } elseif ($compiler->isBlock($name)) {
             $processor = $compiler->processor('block');
             $processor->migrateBlock($this);
         }
         if (is_object($processor)) {
             $this->set('hidden', false);
             $compiler->setChildren($processor->getQueue());
         } elseif ($this->get('processAll')) {
             $this->set('hidden', false);
             $compiler->setChildren($this);
         } else {
             // Remember to set the hidden state IF AND ONLY IF
             // it is not set.
             $this->get('hidden') === null and $this->set('hidden', true);
         }
     } else {
         $this->_processMigration($compiler);
         $this->set('hidden', false);
         if ($this->hasChildren()) {
             $compiler->setChildren($this);
         }
     }
 }