Hacker News new | ask | show | jobs
by steinroe 929 days ago
that's a huge task to take upon, looking forward to go through it! compared to you, we have gone the "easy" way and use the actual parser from the Postgres server. so no grammar definition and the like. our work was mainly around adapting libpg_query (which is build to parse executable SQL) for our use case.
1 comments

> use the actual parser from the Postgres server. so no grammar definition and the like.

Doesn't Postgres use Lex/Yacc to describe the grammar?

It actually uses Flex/Bison, and does take advantage of the extended features they provide.
Thanks for the correction. But either way, doesn't this mean that a formal lexicon/grammar are available for the language server to draw upon?