sq/libsq/ast/internal/slq/SLQ.interp
Neil O'Toole d3e6f89829
SLQ support for column aliases (#150)
* alias: more early work

* alias: test cases working for sqlite

* alias: SQL builder tests

* alias: func (col expr) aliases now working for SQLite

* linting

* CHANGELOG update

* Docs update

* Docs update

* Rename buildAst() -> buildAST()

* CHANGELOG typo
2023-03-18 22:58:00 -06:00

130 lines
7.1 KiB
Plaintext

token literal names:
null
';'
'*'
'join'
'JOIN'
'j'
'group'
'GROUP'
'g'
'.['
'sum'
'SUM'
'avg'
'AVG'
'count'
'COUNT'
'where'
'WHERE'
'||'
'/'
'%'
'+'
'-'
'<<'
'>>'
'&'
'&&'
'~'
'!'
null
null
'('
')'
'['
']'
','
'|'
':'
null
null
null
'<='
'<'
'>='
'>'
'!='
'=='
null
null
null
null
token symbolic names:
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
null
ID
WS
LPAR
RPAR
LBRA
RBRA
COMMA
PIPE
COLON
NULL
NN
NUMBER
LT_EQ
LT
GT_EQ
GT
NEQ
EQ
SEL
DATASOURCE
STRING
LINECOMMENT
rule names:
stmtList
query
segment
element
cmpr
fn
fnElement
join
joinConstraint
group
alias
selElement
dsTblElement
dsElement
rowRange
fnName
expr
literal
unaryOperator
atn:
[4, 1, 50, 204, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 1, 0, 5, 0, 40, 8, 0, 10, 0, 12, 0, 43, 9, 0, 1, 0, 1, 0, 4, 0, 47, 8, 0, 11, 0, 12, 0, 48, 1, 0, 5, 0, 52, 8, 0, 10, 0, 12, 0, 55, 9, 0, 1, 0, 5, 0, 58, 8, 0, 10, 0, 12, 0, 61, 9, 0, 1, 1, 1, 1, 1, 1, 5, 1, 66, 8, 1, 10, 1, 12, 1, 69, 9, 1, 1, 2, 1, 2, 1, 2, 5, 2, 74, 8, 2, 10, 2, 12, 2, 77, 9, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 87, 8, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 96, 8, 5, 10, 5, 12, 5, 99, 9, 5, 1, 5, 3, 5, 102, 8, 5, 1, 5, 1, 5, 1, 6, 1, 6, 3, 6, 108, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 120, 8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 5, 9, 127, 8, 9, 10, 9, 12, 9, 130, 9, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 3, 11, 139, 8, 11, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 155, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 168, 8, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 189, 8, 16, 1, 16, 1, 16, 1, 16, 1, 16, 5, 16, 195, 8, 16, 10, 16, 12, 16, 198, 9, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 0, 1, 32, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 10, 1, 0, 41, 46, 1, 0, 3, 5, 1, 0, 6, 8, 1, 0, 10, 17, 2, 0, 2, 2, 19, 20, 1, 0, 21, 22, 1, 0, 23, 25, 1, 0, 41, 44, 2, 0, 38, 40, 49, 49, 2, 0, 21, 22, 27, 28, 220, 0, 41, 1, 0, 0, 0, 2, 62, 1, 0, 0, 0, 4, 70, 1, 0, 0, 0, 6, 86, 1, 0, 0, 0, 8, 88, 1, 0, 0, 0, 10, 90, 1, 0, 0, 0, 12, 105, 1, 0, 0, 0, 14, 109, 1, 0, 0, 0, 16, 119, 1, 0, 0, 0, 18, 121, 1, 0, 0, 0, 20, 133, 1, 0, 0, 0, 22, 136, 1, 0, 0, 0, 24, 140, 1, 0, 0, 0, 26, 143, 1, 0, 0, 0, 28, 145, 1, 0, 0, 0, 30, 158, 1, 0, 0, 0, 32, 167, 1, 0, 0, 0, 34, 199, 1, 0, 0, 0, 36, 201, 1, 0, 0, 0, 38, 40, 5, 1, 0, 0, 39, 38, 1, 0, 0, 0, 40, 43, 1, 0, 0, 0, 41, 39, 1, 0, 0, 0, 41, 42, 1, 0, 0, 0, 42, 44, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 44, 53, 3, 2, 1, 0, 45, 47, 5, 1, 0, 0, 46, 45, 1, 0, 0, 0, 47, 48, 1, 0, 0, 0, 48, 46, 1, 0, 0, 0, 48, 49, 1, 0, 0, 0, 49, 50, 1, 0, 0, 0, 50, 52, 3, 2, 1, 0, 51, 46, 1, 0, 0, 0, 52, 55, 1, 0, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 59, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 56, 58, 5, 1, 0, 0, 57, 56, 1, 0, 0, 0, 58, 61, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 60, 1, 0, 0, 0, 60, 1, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 62, 67, 3, 4, 2, 0, 63, 64, 5, 36, 0, 0, 64, 66, 3, 4, 2, 0, 65, 63, 1, 0, 0, 0, 66, 69, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 3, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 70, 75, 3, 6, 3, 0, 71, 72, 5, 35, 0, 0, 72, 74, 3, 6, 3, 0, 73, 71, 1, 0, 0, 0, 74, 77, 1, 0, 0, 0, 75, 73, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 5, 1, 0, 0, 0, 77, 75, 1, 0, 0, 0, 78, 87, 3, 24, 12, 0, 79, 87, 3, 26, 13, 0, 80, 87, 3, 22, 11, 0, 81, 87, 3, 14, 7, 0, 82, 87, 3, 18, 9, 0, 83, 87, 3, 28, 14, 0, 84, 87, 3, 12, 6, 0, 85, 87, 3, 32, 16, 0, 86, 78, 1, 0, 0, 0, 86, 79, 1, 0, 0, 0, 86, 80, 1, 0, 0, 0, 86, 81, 1, 0, 0, 0, 86, 82, 1, 0, 0, 0, 86, 83, 1, 0, 0, 0, 86, 84, 1, 0, 0, 0, 86, 85, 1, 0, 0, 0, 87, 7, 1, 0, 0, 0, 88, 89, 7, 0, 0, 0, 89, 9, 1, 0, 0, 0, 90, 91, 3, 30, 15, 0, 91, 101, 5, 31, 0, 0, 92, 97, 3, 32, 16, 0, 93, 94, 5, 35, 0, 0, 94, 96, 3, 32, 16, 0, 95, 93, 1, 0, 0, 0, 96, 99, 1, 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 102, 1, 0, 0, 0, 99, 97, 1, 0, 0, 0, 100, 102, 5, 2, 0, 0, 101, 92, 1, 0, 0, 0, 101, 100, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 104, 5, 32, 0, 0, 104, 11, 1, 0, 0, 0, 105, 107, 3, 10, 5, 0, 106, 108, 3, 20, 10, 0, 107, 106, 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 108, 13, 1, 0, 0, 0, 109, 110, 7, 1, 0, 0, 110, 111, 5, 31, 0, 0, 111, 112, 3, 16, 8, 0, 112, 113, 5, 32, 0, 0, 113, 15, 1, 0, 0, 0, 114, 115, 5, 47, 0, 0, 115, 116, 3, 8, 4, 0, 116, 117, 5, 47, 0, 0, 117, 120, 1, 0, 0, 0, 118, 120, 5, 47, 0, 0, 119, 114, 1, 0, 0, 0, 119, 118, 1, 0, 0, 0, 120, 17, 1, 0, 0, 0, 121, 122, 7, 2, 0, 0, 122, 123, 5, 31, 0, 0, 123, 128, 5, 47, 0, 0, 124, 125, 5, 35, 0, 0, 125, 127, 5, 47, 0, 0, 126, 124, 1, 0, 0, 0, 127, 130, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 131, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 131, 132, 5, 32, 0, 0, 132, 19, 1, 0, 0, 0, 133, 134, 5, 37, 0, 0, 134, 135, 5, 29, 0, 0, 135, 21, 1, 0, 0, 0, 136, 138, 5, 47, 0, 0, 137, 139, 3, 20, 10, 0, 138, 137, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 139, 23, 1, 0, 0, 0, 140, 141, 5, 48, 0, 0, 141, 142, 5, 47, 0, 0, 142, 25, 1, 0, 0, 0, 143, 144, 5, 48, 0, 0, 144, 27, 1, 0, 0, 0, 145, 154, 5, 9, 0, 0, 146, 147, 5, 39, 0, 0, 147, 148, 5, 37, 0, 0, 148, 155, 5, 39, 0, 0, 149, 150, 5, 39, 0, 0, 150, 155, 5, 37, 0, 0, 151, 152, 5, 37, 0, 0, 152, 155, 5, 39, 0, 0, 153, 155, 5, 39, 0, 0, 154, 146, 1, 0, 0, 0, 154, 149, 1, 0, 0, 0, 154, 151, 1, 0, 0, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 5, 34, 0, 0, 157, 29, 1, 0, 0, 0, 158, 159, 7, 3, 0, 0, 159, 31, 1, 0, 0, 0, 160, 161, 6, 16, -1, 0, 161, 168, 5, 47, 0, 0, 162, 168, 3, 34, 17, 0, 163, 164, 3, 36, 18, 0, 164, 165, 3, 32, 16, 9, 165, 168, 1, 0, 0, 0, 166, 168, 3, 10, 5, 0, 167, 160, 1, 0, 0, 0, 167, 162, 1, 0, 0, 0, 167, 163, 1, 0, 0, 0, 167, 166, 1, 0, 0, 0, 168, 196, 1, 0, 0, 0, 169, 170, 10, 8, 0, 0, 170, 171, 5, 18, 0, 0, 171, 195, 3, 32, 16, 9, 172, 173, 10, 7, 0, 0, 173, 174, 7, 4, 0, 0, 174, 195, 3, 32, 16, 8, 175, 176, 10, 6, 0, 0, 176, 177, 7, 5, 0, 0, 177, 195, 3, 32, 16, 7, 178, 179, 10, 5, 0, 0, 179, 180, 7, 6, 0, 0, 180, 195, 3, 32, 16, 6, 181, 182, 10, 4, 0, 0, 182, 183, 7, 7, 0, 0, 183, 195, 3, 32, 16, 5, 184, 188, 10, 3, 0, 0, 185, 189, 5, 46, 0, 0, 186, 189, 5, 45, 0, 0, 187, 189, 1, 0, 0, 0, 188, 185, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 188, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 195, 3, 32, 16, 4, 191, 192, 10, 2, 0, 0, 192, 193, 5, 26, 0, 0, 193, 195, 3, 32, 16, 3, 194, 169, 1, 0, 0, 0, 194, 172, 1, 0, 0, 0, 194, 175, 1, 0, 0, 0, 194, 178, 1, 0, 0, 0, 194, 181, 1, 0, 0, 0, 194, 184, 1, 0, 0, 0, 194, 191, 1, 0, 0, 0, 195, 198, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 33, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 199, 200, 7, 8, 0, 0, 200, 35, 1, 0, 0, 0, 201, 202, 7, 9, 0, 0, 202, 37, 1, 0, 0, 0, 18, 41, 48, 53, 59, 67, 75, 86, 97, 101, 107, 119, 128, 138, 154, 167, 188, 194, 196]