sq/grammar
Neil O'Toole a1cfd5d525
Xlsx import handle empty sheets (#79)
* can now import XLSX with empty sheets

* renamed XLSX test article
2021-02-19 23:22:35 -07:00
..
grun codebase refactor 2020-08-06 11:58:47 -06:00
README.md Xlsx import handle empty sheets (#79) 2021-02-19 23:22:35 -07:00
SLQ.g4 codebase refactor 2020-08-06 11:58:47 -06:00

SLQ Grammar

The query language used by sq is formally known as SLQ. The grammar is defined in SLQ.g4, which is an ANTLR4 grammar.

The antlr4 tool generates the parser / lexer files from the grammar. Being that antlr4 is Java-based, Java must be installed to regenerate from the grammar. This process is encapsulated in a mage target:

# from SQ_PROJ_ROOT
mage generateparser

The generated .go files ultimately end up in package libsq/slq. Files in this directory should not be directly edited.

The libsq/ast.Parse function takes a SLQ input string and returns an *ast.AST. It is the libsq.ExecuteSLQ function that invokes ast.Parse.