1 | <?php |
||
13 | abstract class AbstractCompilationTarget implements CompilationTarget |
||
14 | { |
||
15 | /** |
||
16 | * @var OperatorsDefinitions |
||
17 | */ |
||
18 | private $customOperators; |
||
19 | |||
20 | /** |
||
21 | * Create a rule visitor for a given compilation context. |
||
22 | * |
||
23 | * @param Context $context The compilation context. |
||
24 | * |
||
25 | * @return \RulerZ\Compiler\RuleVisitor |
||
26 | */ |
||
27 | abstract protected function createVisitor(Context $context); |
||
28 | |||
29 | abstract protected function getExecutorTraits(); |
||
30 | |||
31 | /** |
||
32 | * @param array<callable> $operators A list of additional operators to register. |
||
33 | * @param array<callable> $inlineOperators A list of additional inline operators to register. |
||
34 | */ |
||
35 | public function __construct(array $operators = [], array $inlineOperators = []) |
||
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | public function compile(Model\Rule $rule, Context $compilationContext) |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function createCompilationContext($target) |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | public function defineOperator($name, callable $transformer) |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function defineInlineOperator($name, callable $transformer) |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | public function getOperators() |
||
86 | |||
87 | /** |
||
88 | * {@inheritdoc} |
||
89 | */ |
||
90 | public function getRuleIdentifierHint($rule, Context $context) |
||
94 | } |
||
95 |