Lines Matching refs:listener

86      * later call to {@see Parser::setTrace(false)}. The listener itself is
87 * implemented as a parser listener so this field is not directly used by
276 * Registers `listener` to receive events during the parsing process.
280 * optimized code generation), calls to listener methods during the parse
287 * With the following specific exceptions, calls to listener events are
288 * <em>deterministic</em>, i.e. for identical input the calls to listener
292 * behavior of the listener calls.
294 * generating the parser may change the behavior of the listener calls.
296 * may change the behavior of the listener calls.
298 * @param ParseTreeListener $listener The listener to add.
300 public function addParseListener(ParseTreeListener $listener) : void
302 if (!\in_array($listener, $this->parseListeners, true)) {
303 $this->parseListeners[] = $listener;
308 * Remove `listener` from the list of parse listeners.
310 * If `listener` is `null` or has not been added as a parse
311 * listener, this method does nothing.
313 * @param ParseTreeListener $listener The listener to remove
317 public function removeParseListener(ParseTreeListener $listener) : void
319 $index = \array_search($listener, $this->parseListeners, true);
343 foreach ($this->parseListeners as $listener) {
344 $listener->enterEveryRule($this->context());
345 $this->context()->enterRule($listener);
357 /** @var ParseTreeListener $listener */
358 $listener = $this->parseListeners[$i];
359 $this->context()->exitRule($listener);
360 $listener->exitEveryRule($this->context());
491 $listener = $this->getErrorListenerDispatch();
492 $listener->syntaxError($this, $offendingToken, $line, $charPositionInLine, $msg, $e);
528 foreach ($this->parseListeners as $listener) {
530 $listener->visitErrorNode($node);
536 foreach ($this->parseListeners as $listener) {
538 $listener->visitTerminal($node);
940 * Gets whether a {@see TraceListener} is registered as a parse listener