Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[post] ANTLR parser generator and visitor pattern #49

Open
at15 opened this issue Jun 22, 2020 · 0 comments
Open

[post] ANTLR parser generator and visitor pattern #49

at15 opened this issue Jun 22, 2020 · 0 comments
Assignees
Labels
area/pl Programming Language

Comments

@at15
Copy link
Member

at15 commented Jun 22, 2020

Type

  • request post from @at15

Related

Description

While working on gegecece and writing SQL parser (ANTLR rule). The main problem is converting parser tree to AST.
AST in SQL is (unresolved) logical plan. There are many ways to define the rule and to traverse the parser tree.
A common pattern is called visitor pattern. However, when looking at code in some dbs e.g. tidb, es. they didn't build the plan in a very visitor way. This post tries to address the following questions

  • what is visitor pattern, how to implement one (in different languages)
  • use visitor pattern in ANTLR
  • not using visitor pattern in ANTLR (when it comes to SQL)
  • alternative label in ANTLR & visitor

Update

@at15 at15 added the area/pl Programming Language label Jun 22, 2020
@at15 at15 self-assigned this Jun 22, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area/pl Programming Language
Projects
None yet
Development

No branches or pull requests

1 participant