sq/libsq/slq/slq_lexer.go

217 lines
11 KiB
Go
Raw Normal View History

2016-10-17 07:14:01 +03:00
// Generated from ../grammar/SLQ.g4 by ANTLR 4.5.1.
package slq
import (
"fmt"
"github.com/pboyer/antlr4/runtime/Go/antlr"
)
// suppress unused import error, many tests
// require fmt.
var _ = fmt.Printf
var serializedLexerAtn = []uint16{
3, 1072, 54993, 33286, 44333, 17431, 44785, 36224, 43741, 2, 30, 242, 8,
1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9,
7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4,
13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18,
9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9,
23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28,
4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4,
34, 9, 34, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 7, 6, 87, 10, 6, 12, 6, 14, 6,
90, 11, 6, 3, 7, 6, 7, 93, 10, 7, 13, 7, 14, 7, 94, 3, 7, 3, 7, 3, 8, 3,
8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13,
3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 5,
15, 121, 10, 15, 3, 16, 3, 16, 3, 16, 7, 16, 126, 10, 16, 12, 16, 14, 16,
129, 11, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 5, 17, 136, 10, 17, 3,
18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 7, 20,
148, 10, 20, 12, 20, 14, 20, 151, 11, 20, 3, 21, 5, 21, 154, 10, 21, 3,
21, 3, 21, 3, 21, 6, 21, 159, 10, 21, 13, 21, 14, 21, 160, 3, 21, 5, 21,
164, 10, 21, 3, 21, 5, 21, 167, 10, 21, 3, 21, 3, 21, 3, 21, 3, 21, 5,
21, 173, 10, 21, 3, 21, 5, 21, 176, 10, 21, 3, 22, 3, 22, 3, 22, 7, 22,
181, 10, 22, 12, 22, 14, 22, 184, 11, 22, 5, 22, 186, 10, 22, 3, 23, 3,
23, 5, 23, 190, 10, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25,
3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3,
29, 3, 30, 3, 30, 3, 30, 3, 30, 7, 30, 214, 10, 30, 12, 30, 14, 30, 217,
11, 30, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33,
5, 33, 228, 10, 33, 3, 34, 3, 34, 3, 34, 3, 34, 7, 34, 234, 10, 34, 12,
34, 14, 34, 237, 11, 34, 3, 34, 3, 34, 3, 34, 3, 34, 3, 235, 2, 35, 3,
3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13,
25, 14, 27, 15, 29, 16, 31, 17, 33, 2, 35, 2, 37, 2, 39, 18, 41, 19, 43,
2, 45, 2, 47, 20, 49, 21, 51, 22, 53, 23, 55, 24, 57, 25, 59, 26, 61, 27,
63, 28, 65, 29, 67, 30, 3, 2, 12, 5, 2, 67, 92, 97, 97, 99, 124, 6, 2,
50, 59, 67, 92, 97, 97, 99, 124, 5, 2, 11, 12, 15, 15, 34, 34, 4, 2, 36,
36, 94, 94, 10, 2, 36, 36, 49, 49, 94, 94, 100, 100, 104, 104, 112, 112,
116, 116, 118, 118, 5, 2, 50, 59, 67, 72, 99, 104, 3, 2, 50, 59, 3, 2,
51, 59, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 258, 2, 3, 3, 2,
2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2,
2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3,
2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27,
3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2,
41, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2,
2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2,
2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2,
2, 2, 3, 69, 3, 2, 2, 2, 5, 74, 3, 2, 2, 2, 7, 79, 3, 2, 2, 2, 9, 81, 3,
2, 2, 2, 11, 84, 3, 2, 2, 2, 13, 92, 3, 2, 2, 2, 15, 98, 3, 2, 2, 2, 17,
100, 3, 2, 2, 2, 19, 102, 3, 2, 2, 2, 21, 104, 3, 2, 2, 2, 23, 106, 3,
2, 2, 2, 25, 108, 3, 2, 2, 2, 27, 110, 3, 2, 2, 2, 29, 120, 3, 2, 2, 2,
31, 122, 3, 2, 2, 2, 33, 132, 3, 2, 2, 2, 35, 137, 3, 2, 2, 2, 37, 143,
3, 2, 2, 2, 39, 145, 3, 2, 2, 2, 41, 175, 3, 2, 2, 2, 43, 185, 3, 2, 2,
2, 45, 187, 3, 2, 2, 2, 47, 193, 3, 2, 2, 2, 49, 196, 3, 2, 2, 2, 51, 198,
3, 2, 2, 2, 53, 201, 3, 2, 2, 2, 55, 203, 3, 2, 2, 2, 57, 206, 3, 2, 2,
2, 59, 209, 3, 2, 2, 2, 61, 218, 3, 2, 2, 2, 63, 221, 3, 2, 2, 2, 65, 227,
3, 2, 2, 2, 67, 229, 3, 2, 2, 2, 69, 70, 7, 108, 2, 2, 70, 71, 7, 113,
2, 2, 71, 72, 7, 107, 2, 2, 72, 73, 7, 112, 2, 2, 73, 4, 3, 2, 2, 2, 74,
75, 7, 76, 2, 2, 75, 76, 7, 81, 2, 2, 76, 77, 7, 75, 2, 2, 77, 78, 7, 80,
2, 2, 78, 6, 3, 2, 2, 2, 79, 80, 7, 108, 2, 2, 80, 8, 3, 2, 2, 2, 81, 82,
7, 48, 2, 2, 82, 83, 7, 93, 2, 2, 83, 10, 3, 2, 2, 2, 84, 88, 9, 2, 2,
2, 85, 87, 9, 3, 2, 2, 86, 85, 3, 2, 2, 2, 87, 90, 3, 2, 2, 2, 88, 86,
3, 2, 2, 2, 88, 89, 3, 2, 2, 2, 89, 12, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2,
91, 93, 9, 4, 2, 2, 92, 91, 3, 2, 2, 2, 93, 94, 3, 2, 2, 2, 94, 92, 3,
2, 2, 2, 94, 95, 3, 2, 2, 2, 95, 96, 3, 2, 2, 2, 96, 97, 8, 7, 2, 2, 97,
14, 3, 2, 2, 2, 98, 99, 7, 42, 2, 2, 99, 16, 3, 2, 2, 2, 100, 101, 7, 43,
2, 2, 101, 18, 3, 2, 2, 2, 102, 103, 7, 93, 2, 2, 103, 20, 3, 2, 2, 2,
104, 105, 7, 95, 2, 2, 105, 22, 3, 2, 2, 2, 106, 107, 7, 46, 2, 2, 107,
24, 3, 2, 2, 2, 108, 109, 7, 126, 2, 2, 109, 26, 3, 2, 2, 2, 110, 111,
7, 60, 2, 2, 111, 28, 3, 2, 2, 2, 112, 113, 7, 112, 2, 2, 113, 114, 7,
119, 2, 2, 114, 115, 7, 110, 2, 2, 115, 121, 7, 110, 2, 2, 116, 117, 7,
80, 2, 2, 117, 118, 7, 87, 2, 2, 118, 119, 7, 78, 2, 2, 119, 121, 7, 78,
2, 2, 120, 112, 3, 2, 2, 2, 120, 116, 3, 2, 2, 2, 121, 30, 3, 2, 2, 2,
122, 127, 7, 36, 2, 2, 123, 126, 5, 33, 17, 2, 124, 126, 10, 5, 2, 2, 125,
123, 3, 2, 2, 2, 125, 124, 3, 2, 2, 2, 126, 129, 3, 2, 2, 2, 127, 125,
3, 2, 2, 2, 127, 128, 3, 2, 2, 2, 128, 130, 3, 2, 2, 2, 129, 127, 3, 2,
2, 2, 130, 131, 7, 36, 2, 2, 131, 32, 3, 2, 2, 2, 132, 135, 7, 94, 2, 2,
133, 136, 9, 6, 2, 2, 134, 136, 5, 35, 18, 2, 135, 133, 3, 2, 2, 2, 135,
134, 3, 2, 2, 2, 136, 34, 3, 2, 2, 2, 137, 138, 7, 119, 2, 2, 138, 139,
5, 37, 19, 2, 139, 140, 5, 37, 19, 2, 140, 141, 5, 37, 19, 2, 141, 142,
5, 37, 19, 2, 142, 36, 3, 2, 2, 2, 143, 144, 9, 7, 2, 2, 144, 38, 3, 2,
2, 2, 145, 149, 9, 8, 2, 2, 146, 148, 9, 8, 2, 2, 147, 146, 3, 2, 2, 2,
148, 151, 3, 2, 2, 2, 149, 147, 3, 2, 2, 2, 149, 150, 3, 2, 2, 2, 150,
40, 3, 2, 2, 2, 151, 149, 3, 2, 2, 2, 152, 154, 7, 47, 2, 2, 153, 152,
3, 2, 2, 2, 153, 154, 3, 2, 2, 2, 154, 155, 3, 2, 2, 2, 155, 156, 5, 43,
22, 2, 156, 158, 7, 48, 2, 2, 157, 159, 9, 8, 2, 2, 158, 157, 3, 2, 2,
2, 159, 160, 3, 2, 2, 2, 160, 158, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161,
163, 3, 2, 2, 2, 162, 164, 5, 45, 23, 2, 163, 162, 3, 2, 2, 2, 163, 164,
3, 2, 2, 2, 164, 176, 3, 2, 2, 2, 165, 167, 7, 47, 2, 2, 166, 165, 3, 2,
2, 2, 166, 167, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 5, 43, 22,
2, 169, 170, 5, 45, 23, 2, 170, 176, 3, 2, 2, 2, 171, 173, 7, 47, 2, 2,
172, 171, 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174,
176, 5, 43, 22, 2, 175, 153, 3, 2, 2, 2, 175, 166, 3, 2, 2, 2, 175, 172,
3, 2, 2, 2, 176, 42, 3, 2, 2, 2, 177, 186, 7, 50, 2, 2, 178, 182, 9, 9,
2, 2, 179, 181, 9, 8, 2, 2, 180, 179, 3, 2, 2, 2, 181, 184, 3, 2, 2, 2,
182, 180, 3, 2, 2, 2, 182, 183, 3, 2, 2, 2, 183, 186, 3, 2, 2, 2, 184,
182, 3, 2, 2, 2, 185, 177, 3, 2, 2, 2, 185, 178, 3, 2, 2, 2, 186, 44, 3,
2, 2, 2, 187, 189, 9, 10, 2, 2, 188, 190, 9, 11, 2, 2, 189, 188, 3, 2,
2, 2, 189, 190, 3, 2, 2, 2, 190, 191, 3, 2, 2, 2, 191, 192, 5, 43, 22,
2, 192, 46, 3, 2, 2, 2, 193, 194, 7, 62, 2, 2, 194, 195, 7, 63, 2, 2, 195,
48, 3, 2, 2, 2, 196, 197, 7, 62, 2, 2, 197, 50, 3, 2, 2, 2, 198, 199, 7,
64, 2, 2, 199, 200, 7, 63, 2, 2, 200, 52, 3, 2, 2, 2, 201, 202, 7, 64,
2, 2, 202, 54, 3, 2, 2, 2, 203, 204, 7, 35, 2, 2, 204, 205, 7, 63, 2, 2,
205, 56, 3, 2, 2, 2, 206, 207, 7, 63, 2, 2, 207, 208, 7, 63, 2, 2, 208,
58, 3, 2, 2, 2, 209, 210, 7, 48, 2, 2, 210, 215, 5, 11, 6, 2, 211, 212,
7, 48, 2, 2, 212, 214, 5, 11, 6, 2, 213, 211, 3, 2, 2, 2, 214, 217, 3,
2, 2, 2, 215, 213, 3, 2, 2, 2, 215, 216, 3, 2, 2, 2, 216, 60, 3, 2, 2,
2, 217, 215, 3, 2, 2, 2, 218, 219, 7, 66, 2, 2, 219, 220, 5, 11, 6, 2,
220, 62, 3, 2, 2, 2, 221, 222, 7, 48, 2, 2, 222, 64, 3, 2, 2, 2, 223, 228,
5, 31, 16, 2, 224, 228, 5, 41, 21, 2, 225, 228, 5, 29, 15, 2, 226, 228,
5, 59, 30, 2, 227, 223, 3, 2, 2, 2, 227, 224, 3, 2, 2, 2, 227, 225, 3,
2, 2, 2, 227, 226, 3, 2, 2, 2, 228, 66, 3, 2, 2, 2, 229, 230, 7, 49, 2,
2, 230, 231, 7, 49, 2, 2, 231, 235, 3, 2, 2, 2, 232, 234, 11, 2, 2, 2,
233, 232, 3, 2, 2, 2, 234, 237, 3, 2, 2, 2, 235, 236, 3, 2, 2, 2, 235,
233, 3, 2, 2, 2, 236, 238, 3, 2, 2, 2, 237, 235, 3, 2, 2, 2, 238, 239,
7, 12, 2, 2, 239, 240, 3, 2, 2, 2, 240, 241, 8, 34, 2, 2, 241, 68, 3, 2,
2, 2, 22, 2, 88, 94, 120, 125, 127, 135, 149, 153, 160, 163, 166, 172,
175, 182, 185, 189, 215, 227, 235, 3, 8, 2, 2,
}
var lexerDeserializer = antlr.NewATNDeserializer(nil)
var lexerAtn = lexerDeserializer.DeserializeFromUInt16(serializedLexerAtn)
var lexerModeNames = []string{
"DEFAULT_MODE",
}
var lexerLiteralNames = []string{
"", "'join'", "'JOIN'", "'j'", "'.['", "", "", "'('", "')'", "'['", "']'",
"','", "'|'", "':'", "", "", "", "", "'<='", "'<'", "'>='", "'>'", "'!='",
"'=='", "", "", "'.'",
}
var lexerSymbolicNames = []string{
"", "", "", "", "", "ID", "WS", "LPAR", "RPAR", "LBRA", "RBRA", "COMMA",
"PIPE", "COLON", "NULL", "STRING", "INT", "NUMBER", "LT_EQ", "LT", "GT_EQ",
"GT", "NEQ", "EQ", "SEL", "DATASOURCE", "DOT", "VAL", "LINECOMMENT",
}
var lexerRuleNames = []string{
"T__0", "T__1", "T__2", "T__3", "ID", "WS", "LPAR", "RPAR", "LBRA", "RBRA",
"COMMA", "PIPE", "COLON", "NULL", "STRING", "ESC", "UNICODE", "HEX", "INT",
"NUMBER", "INTF", "EXP", "LT_EQ", "LT", "GT_EQ", "GT", "NEQ", "EQ", "SEL",
"DATASOURCE", "DOT", "VAL", "LINECOMMENT",
}
type SLQLexer struct {
*antlr.BaseLexer
modeNames []string
// TODO: EOF string
}
func NewSLQLexer(input antlr.CharStream) *SLQLexer {
var lexerDecisionToDFA = make([]*antlr.DFA, len(lexerAtn.DecisionToState))
for index, ds := range lexerAtn.DecisionToState {
lexerDecisionToDFA[index] = antlr.NewDFA(ds, index)
}
this := new(SLQLexer)
this.BaseLexer = antlr.NewBaseLexer(input)
this.Interpreter = antlr.NewLexerATNSimulator(this, lexerAtn, lexerDecisionToDFA, antlr.NewPredictionContextCache())
this.modeNames = lexerModeNames
this.RuleNames = lexerRuleNames
this.LiteralNames = lexerLiteralNames
this.SymbolicNames = lexerSymbolicNames
this.GrammarFileName = "SLQ.g4"
// TODO: lex.EOF = antlr.TokenEOF
return this
}
// SLQLexer tokens.
const (
SLQLexerT__0 = 1
SLQLexerT__1 = 2
SLQLexerT__2 = 3
SLQLexerT__3 = 4
SLQLexerID = 5
SLQLexerWS = 6
SLQLexerLPAR = 7
SLQLexerRPAR = 8
SLQLexerLBRA = 9
SLQLexerRBRA = 10
SLQLexerCOMMA = 11
SLQLexerPIPE = 12
SLQLexerCOLON = 13
SLQLexerNULL = 14
SLQLexerSTRING = 15
SLQLexerINT = 16
SLQLexerNUMBER = 17
SLQLexerLT_EQ = 18
SLQLexerLT = 19
SLQLexerGT_EQ = 20
SLQLexerGT = 21
SLQLexerNEQ = 22
SLQLexerEQ = 23
SLQLexerSEL = 24
SLQLexerDATASOURCE = 25
SLQLexerDOT = 26
SLQLexerVAL = 27
SLQLexerLINECOMMENT = 28
)