1 | <?php |
||
35 | class PP2 implements GrammarInterface |
||
36 | { |
||
37 | public const ENV_MAP = 'map'; |
||
38 | public const ENV_FILE = 'file'; |
||
39 | public const ENV_RULES = 'rules'; |
||
40 | public const ENV_TOKENS = 'tokens'; |
||
41 | public const ENV_PRAGMAS = 'pragmas'; |
||
42 | |||
43 | /** |
||
44 | * @var array|string[] |
||
45 | */ |
||
46 | private $loaded = []; |
||
47 | |||
48 | /** |
||
49 | * @var PP2 |
||
50 | */ |
||
51 | private $parser; |
||
52 | |||
53 | /** |
||
54 | * @var Environment |
||
55 | */ |
||
56 | private $env; |
||
57 | |||
58 | /** |
||
59 | * @var ProvidePragmas|PragmasResolver |
||
60 | */ |
||
61 | private $pragmas; |
||
62 | |||
63 | /** |
||
64 | * @var ProvideRules|RulesResolver |
||
65 | */ |
||
66 | private $rules; |
||
67 | |||
68 | /** |
||
69 | * @var ProvideTokens|TokensResolver |
||
70 | */ |
||
71 | private $tokens; |
||
72 | |||
73 | /** |
||
74 | * @var Mapping |
||
75 | */ |
||
76 | private $map; |
||
77 | |||
78 | /** |
||
79 | * PP2 constructor. |
||
80 | * @throws \InvalidArgumentException |
||
81 | */ |
||
82 | public function __construct() |
||
90 | |||
91 | /** |
||
92 | * @return void |
||
93 | */ |
||
94 | private function bootResolvers(): void |
||
100 | |||
101 | /** |
||
102 | * @return void |
||
103 | */ |
||
104 | private function bootEnvironment(): void |
||
108 | |||
109 | /** |
||
110 | * @return Environment |
||
111 | */ |
||
112 | private function createEnvironment(): Environment |
||
122 | |||
123 | /** |
||
124 | * @return Result |
||
125 | */ |
||
126 | public function make(): Result |
||
130 | |||
131 | /** |
||
132 | * @param Readable $grammar |
||
133 | * @throws UnrecognizedRuleException |
||
134 | * @throws \LogicException |
||
135 | * @throws \Railt\Io\Exception\ExternalFileException |
||
136 | */ |
||
137 | private function load(Readable $grammar): void |
||
168 | |||
169 | /** |
||
170 | * @param Readable $grammar |
||
171 | * @return RuleInterface |
||
172 | * @throws \LogicException |
||
173 | * @throws \Railt\Io\Exception\ExternalFileException |
||
174 | * @throws \Railt\Parser\Exception\UnrecognizedRuleException |
||
175 | */ |
||
176 | private function parse(Readable $grammar): RuleInterface |
||
180 | |||
181 | /** |
||
182 | * @param Readable $grammar |
||
183 | * @return GrammarInterface |
||
184 | * @throws \LogicException |
||
185 | * @throws \Railt\Io\Exception\ExternalFileException |
||
186 | * @throws \Railt\Parser\Exception\UnrecognizedRuleException |
||
187 | */ |
||
188 | public function add(Readable $grammar): GrammarInterface |
||
197 | |||
198 | /** |
||
199 | * @param Readable $grammar |
||
200 | * @return bool |
||
201 | */ |
||
202 | private function isLoaded(Readable $grammar): bool |
||
212 | } |
||
213 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..