TypeScript note: the return type is cast to the base class because TypeScript
cannot express anonymous mixin classes with private fields in exported positions.
The observer methods (withObserver, notifyEnter, notifyExit) are present
at runtime and accessible to subclasses via the prototype chain.
Apply observer support to any concrete RDParser subclass.
For the common scannerless case, use the pre-built ObservableRDParser.
TypeScript note: the return type is cast to the base class because TypeScript cannot express anonymous mixin classes with private fields in exported positions. The observer methods (
withObserver,notifyEnter,notifyExit) are present at runtime and accessible to subclasses via the prototype chain.