mirror of
https://github.com/neilotoole/sq.git
synced 2024-11-28 12:33:44 +03:00
a1cfd5d525
* can now import XLSX with empty sheets * renamed XLSX test article |
||
---|---|---|
.. | ||
grun | ||
README.md | ||
SLQ.g4 |
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
.