registerSyntax($compiler); $this->registerControlStructure($compiler); $this->registerExtension($compiler); } public function registerSyntax(Compiler $compiler) : void { $compiler->registerSyntax(new \Picea\Syntax\PhpTagToken()); $compiler->registerSyntax(new \Picea\Syntax\CommentToken()); $compiler->registerSyntax(new \Picea\Syntax\EchoRawToken()); $compiler->registerSyntax(new \Picea\Syntax\EchoSafeToken()); } public function registerControlStructure(Compiler $compiler) : void { # @TODO -- a rewrite on the compiler has to be done to accept this kind of functionnality # $compiler->registerControlStructure(new \Picea\ControlStructure\RawToken()); # $compiler->registerControlStructure(new \Picea\ControlStructure\EndRawToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\NamespaceToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\UseToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\IfToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\ElseToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\ElseIfToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\EndIfToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\ForeachToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\ForToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\OrToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\EndforeachToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\EndforToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\SwitchToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\CaseToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\DefaultToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\BreakToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\EndCaseToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\EndSwitchToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\ExtendsToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\SectionToken()); $compiler->registerControlStructure(new \Picea\ControlStructure\EndSectionToken()); } public function registerExtension(Compiler $compiler) : void { $compiler->registerExtension(new \Picea\Extension\JsonExtension()); } }