public function nodeProcess(ioptNode $node) { switch ($node->getType()) { case OPT_ROOT: $this->defaultTreeProcess($node->getFirstBlock()); break; case OPT_TEXT: $this->compiler->out($node->__toString(), true); break; case OPT_EXPRESSION: $result = $this->compiler->compileExpression($node->getFirstBlock()->getAttributes(), 1); if ($result[1] == 1) { // we have an assignment, so we must build different code $this->compiler->out($result[0] . ';'); } else { $this->compiler->out('echo ' . $result[0] . ';'); } break; case OPT_INSTRUCTION: $this->instructionProcess($node); break; case OPT_COMPONENT: $this->compiler->processors['component']->instructionNodeProcess($node); break; case OPT_ATTRIBUTE: $this->compiler->mapper[$node->getName()]->processAttribute($node->getFirstBlock()); break; } }
public function nodeProcess(ioptNode $node) { switch ($node->getType()) { case OPT_ROOT: $this->defaultTreeProcess($node->getFirstBlock()); break; case OPT_TEXT: $this->output .= $node->__toString(); break; case OPT_EXPRESSION: $result = $this->compiler->compileExpression($node->getFirstBlock()->getAttributes(), 1); if ($result[1] == 1) { // we have an assignment, so we must build different code $this->output .= '\'; ' . $result[0] . '; ' . $this->compiler->tpl->captureTo . ' \''; } else { $this->output .= '\'.(string)(' . $result[0] . ').\''; } break; case OPT_INSTRUCTION: $this->instructionProcess($node); break; case OPT_COMPONENT: $this->compiler->processors['component']->instructionNodeProcess($node); break; } }