1 | <?php |
||
26 | abstract class Builder implements BuilderInterface |
||
27 | { |
||
28 | /** |
||
29 | * @var Readable |
||
30 | */ |
||
31 | protected $file; |
||
32 | |||
33 | /** |
||
34 | * @var Definition |
||
35 | */ |
||
36 | protected $definition; |
||
37 | |||
38 | /** |
||
39 | * @var Document |
||
40 | */ |
||
41 | protected $document; |
||
42 | |||
43 | /** |
||
44 | * @var RuleInterface |
||
45 | */ |
||
46 | protected $ast; |
||
47 | |||
48 | /** |
||
49 | * @var Backend |
||
50 | */ |
||
51 | private $backend; |
||
52 | |||
53 | /** |
||
54 | * Builder constructor. |
||
55 | * @param Context $ctx |
||
56 | * @param RuleInterface $ast |
||
57 | * @param Backend $backend |
||
58 | */ |
||
59 | public function __construct(Context $ctx, RuleInterface $ast, Backend $backend) |
||
67 | |||
68 | /** |
||
69 | * @param string $type |
||
70 | * @param Definition $from |
||
71 | * @param int $offset |
||
72 | * @return TypeDefinition |
||
73 | * @throws SDLTypeNotFoundException |
||
74 | */ |
||
75 | protected function load(string $type, Definition $from, int $offset): TypeDefinition |
||
86 | |||
87 | /** |
||
88 | * @param \Closure $then |
||
89 | */ |
||
90 | protected function async(\Closure $then): void |
||
94 | |||
95 | /** |
||
96 | * @param Definition $context |
||
97 | * @param RuleInterface $ast |
||
98 | * @return Definition |
||
99 | * @throws \Railt\SDL\Exception\TypeException |
||
100 | */ |
||
101 | protected function make(Definition $context, RuleInterface $ast): Definition |
||
105 | |||
106 | /** |
||
107 | * @param Definition|AbstractDefinition $definition |
||
108 | * @return Definition |
||
109 | */ |
||
110 | protected function bind(Definition $definition): Definition |
||
116 | |||
117 | /** |
||
118 | * @return string |
||
119 | * @throws \Railt\SDL\Exception\SyntaxException |
||
120 | */ |
||
121 | protected function getName(): string |
||
125 | |||
126 | /** |
||
127 | * @return string|null |
||
128 | */ |
||
129 | protected function findName(): ?string |
||
133 | } |
||
134 |