Skip to content

refactor(JS: explicitly using TerminalNode): move the implementation to TerminalNode/ErrorNode and actually use them.#4933

Open
jerry4718 wants to merge 1 commit into
antlr:devfrom
jerry4718:dev-use-direct-TerminalNode
Open

refactor(JS: explicitly using TerminalNode): move the implementation to TerminalNode/ErrorNode and actually use them.#4933
jerry4718 wants to merge 1 commit into
antlr:devfrom
jerry4718:dev-use-direct-TerminalNode

Conversation

@jerry4718

Copy link
Copy Markdown
  • add an abstract accept() method to the ParseTree base class.
  • remove ErrorNodeImpl and TerminalNodeImpl, use direct class implementations.
  • update Parser, ParserRuleContext, and ParseTreeWalker to use instanceof checks.

…n to `TerminalNode`/`ErrorNode` and actually use them.

- add an abstract `accept()` method to the `ParseTree` base class.
- remove `ErrorNodeImpl` and `TerminalNodeImpl`, use direct class implementations.
- update `Parser`, `ParserRuleContext`, and `ParseTreeWalker` to use instanceof checks.

Signed-off-by: jerry4718 <jerry4718@qq.com>
@jerry4718 jerry4718 force-pushed the dev-use-direct-TerminalNode branch from 9ec4cbe to 959c891 Compare April 10, 2026 10:12
@jerry4718

Copy link
Copy Markdown
Author

The type export and declaration are based on TerminalNode, yet the actual implementation used is TerminalNodeImpl; furthermore, the type definition for TerminalNodeImpl is not exported, making it impossible to perform instanceof checks during usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant