GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

datemath_lexer.go   A
last analyzed

Size/Duplication

Total Lines 170
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 135
dl 0
loc 170
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A datemath.NewDatemathLexer 0 16 1
1
// Code generated from Datemath.g4 by ANTLR 4.7.2. DO NOT EDIT.
2
3
package datemath
4
5
import (
6
	"fmt"
7
	"unicode"
8
9
	"github.com/antlr/antlr4/runtime/Go/antlr"
10
)
11
12
// Suppress unused import error
13
var _ = fmt.Printf
14
var _ = unicode.IsLetter
15
16
var serializedLexerAtn = []uint16{
17
	3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 14, 169,
18
	8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7,
19
	9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12,
20
	4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4,
21
	18, 9, 18, 4, 19, 9, 19, 3, 2, 5, 2, 41, 10, 2, 3, 2, 3, 2, 3, 3, 3, 3,
22
	5, 3, 47, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
23
	5, 3, 58, 10, 3, 6, 3, 60, 10, 3, 13, 3, 14, 3, 61, 3, 4, 3, 4, 7, 4, 66,
24
	10, 4, 12, 4, 14, 4, 69, 11, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3,
25
	7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 7, 9, 86, 10, 9, 12,
26
	9, 14, 9, 89, 11, 9, 5, 9, 91, 10, 9, 3, 10, 3, 10, 3, 10, 6, 10, 96, 10,
27
	10, 13, 10, 14, 10, 97, 3, 10, 3, 10, 6, 10, 102, 10, 10, 13, 10, 14, 10,
28
	103, 5, 10, 106, 10, 10, 3, 11, 3, 11, 7, 11, 110, 10, 11, 12, 11, 14,
29
	11, 113, 11, 11, 3, 12, 6, 12, 116, 10, 12, 13, 12, 14, 12, 117, 3, 12,
30
	3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 128, 10, 13, 3,
31
	13, 3, 13, 3, 13, 5, 13, 133, 10, 13, 3, 13, 3, 13, 7, 13, 137, 10, 13,
32
	12, 13, 14, 13, 140, 11, 13, 3, 13, 3, 13, 3, 13, 5, 13, 145, 10, 13, 3,
33
	14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 5, 16, 154, 10, 16, 3, 17,
34
	3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 7, 19, 163, 10, 19, 12, 19, 14,
35
	19, 166, 11, 19, 5, 19, 168, 10, 19, 3, 138, 2, 20, 3, 3, 5, 4, 7, 5, 9,
36
	6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 2,
37
	29, 2, 31, 2, 33, 2, 35, 2, 37, 2, 3, 2, 11, 10, 2, 74, 74, 79, 79, 102,
38
	102, 106, 106, 111, 111, 117, 117, 121, 121, 123, 123, 5, 2, 106, 106,
39
	111, 111, 117, 117, 3, 2, 41, 41, 3, 2, 51, 59, 4, 2, 50, 59, 97, 97, 6,
40
	2, 11, 11, 13, 14, 34, 34, 162, 162, 4, 2, 47, 47, 49, 49, 3, 2, 97, 97,
41
	4, 2, 67, 92, 99, 124, 2, 185, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7,
42
	3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2,
43
	15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2,
44
	2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 3, 40, 3, 2, 2, 2, 5, 59, 3, 2, 2,
45
	2, 7, 63, 3, 2, 2, 2, 9, 72, 3, 2, 2, 2, 11, 74, 3, 2, 2, 2, 13, 76, 3,
46
	2, 2, 2, 15, 78, 3, 2, 2, 2, 17, 90, 3, 2, 2, 2, 19, 105, 3, 2, 2, 2, 21,
47
	107, 3, 2, 2, 2, 23, 115, 3, 2, 2, 2, 25, 121, 3, 2, 2, 2, 27, 146, 3,
48
	2, 2, 2, 29, 148, 3, 2, 2, 2, 31, 153, 3, 2, 2, 2, 33, 155, 3, 2, 2, 2,
49
	35, 157, 3, 2, 2, 2, 37, 167, 3, 2, 2, 2, 39, 41, 5, 17, 9, 2, 40, 39,
50
	3, 2, 2, 2, 40, 41, 3, 2, 2, 2, 41, 42, 3, 2, 2, 2, 42, 43, 9, 2, 2, 2,
51
	43, 4, 3, 2, 2, 2, 44, 47, 5, 17, 9, 2, 45, 47, 5, 19, 10, 2, 46, 44, 3,
52
	2, 2, 2, 46, 45, 3, 2, 2, 2, 47, 57, 3, 2, 2, 2, 48, 58, 9, 3, 2, 2, 49,
53
	50, 7, 111, 2, 2, 50, 58, 7, 117, 2, 2, 51, 52, 7, 119, 2, 2, 52, 58, 7,
54
	117, 2, 2, 53, 54, 7, 183, 2, 2, 54, 58, 7, 117, 2, 2, 55, 56, 7, 112,
55
	2, 2, 56, 58, 7, 117, 2, 2, 57, 48, 3, 2, 2, 2, 57, 49, 3, 2, 2, 2, 57,
56
	51, 3, 2, 2, 2, 57, 53, 3, 2, 2, 2, 57, 55, 3, 2, 2, 2, 58, 60, 3, 2, 2,
57
	2, 59, 46, 3, 2, 2, 2, 60, 61, 3, 2, 2, 2, 61, 59, 3, 2, 2, 2, 61, 62,
58
	3, 2, 2, 2, 62, 6, 3, 2, 2, 2, 63, 67, 7, 41, 2, 2, 64, 66, 10, 4, 2, 2,
59
	65, 64, 3, 2, 2, 2, 66, 69, 3, 2, 2, 2, 67, 65, 3, 2, 2, 2, 67, 68, 3,
60
	2, 2, 2, 68, 70, 3, 2, 2, 2, 69, 67, 3, 2, 2, 2, 70, 71, 7, 41, 2, 2, 71,
61
	8, 3, 2, 2, 2, 72, 73, 7, 45, 2, 2, 73, 10, 3, 2, 2, 2, 74, 75, 7, 47,
62
	2, 2, 75, 12, 3, 2, 2, 2, 76, 77, 7, 49, 2, 2, 77, 14, 3, 2, 2, 2, 78,
63
	79, 7, 112, 2, 2, 79, 80, 7, 113, 2, 2, 80, 81, 7, 121, 2, 2, 81, 16, 3,
64
	2, 2, 2, 82, 91, 7, 50, 2, 2, 83, 87, 9, 5, 2, 2, 84, 86, 9, 6, 2, 2, 85,
65
	84, 3, 2, 2, 2, 86, 89, 3, 2, 2, 2, 87, 85, 3, 2, 2, 2, 87, 88, 3, 2, 2,
66
	2, 88, 91, 3, 2, 2, 2, 89, 87, 3, 2, 2, 2, 90, 82, 3, 2, 2, 2, 90, 83,
67
	3, 2, 2, 2, 91, 18, 3, 2, 2, 2, 92, 93, 5, 37, 19, 2, 93, 95, 7, 48, 2,
68
	2, 94, 96, 5, 35, 18, 2, 95, 94, 3, 2, 2, 2, 96, 97, 3, 2, 2, 2, 97, 95,
69
	3, 2, 2, 2, 97, 98, 3, 2, 2, 2, 98, 106, 3, 2, 2, 2, 99, 101, 7, 48, 2,
70
	2, 100, 102, 5, 35, 18, 2, 101, 100, 3, 2, 2, 2, 102, 103, 3, 2, 2, 2,
71
	103, 101, 3, 2, 2, 2, 103, 104, 3, 2, 2, 2, 104, 106, 3, 2, 2, 2, 105,
72
	92, 3, 2, 2, 2, 105, 99, 3, 2, 2, 2, 106, 20, 3, 2, 2, 2, 107, 111, 5,
73
	29, 15, 2, 108, 110, 5, 31, 16, 2, 109, 108, 3, 2, 2, 2, 110, 113, 3, 2,
74
	2, 2, 111, 109, 3, 2, 2, 2, 111, 112, 3, 2, 2, 2, 112, 22, 3, 2, 2, 2,
75
	113, 111, 3, 2, 2, 2, 114, 116, 9, 7, 2, 2, 115, 114, 3, 2, 2, 2, 116,
76
	117, 3, 2, 2, 2, 117, 115, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 119,
77
	3, 2, 2, 2, 119, 120, 8, 12, 2, 2, 120, 24, 3, 2, 2, 2, 121, 122, 5, 35,
78
	18, 2, 122, 123, 5, 35, 18, 2, 123, 124, 5, 35, 18, 2, 124, 125, 5, 35,
79
	18, 2, 125, 127, 5, 27, 14, 2, 126, 128, 5, 35, 18, 2, 127, 126, 3, 2,
80
	2, 2, 127, 128, 3, 2, 2, 2, 128, 129, 3, 2, 2, 2, 129, 130, 5, 35, 18,
81
	2, 130, 132, 5, 27, 14, 2, 131, 133, 5, 35, 18, 2, 132, 131, 3, 2, 2, 2,
82
	132, 133, 3, 2, 2, 2, 133, 134, 3, 2, 2, 2, 134, 138, 5, 35, 18, 2, 135,
83
	137, 11, 2, 2, 2, 136, 135, 3, 2, 2, 2, 137, 140, 3, 2, 2, 2, 138, 139,
84
	3, 2, 2, 2, 138, 136, 3, 2, 2, 2, 139, 144, 3, 2, 2, 2, 140, 138, 3, 2,
85
	2, 2, 141, 142, 7, 126, 2, 2, 142, 145, 7, 126, 2, 2, 143, 145, 7, 2, 2,
86
	3, 144, 141, 3, 2, 2, 2, 144, 143, 3, 2, 2, 2, 145, 26, 3, 2, 2, 2, 146,
87
	147, 9, 8, 2, 2, 147, 28, 3, 2, 2, 2, 148, 149, 5, 33, 17, 2, 149, 30,
88
	3, 2, 2, 2, 150, 154, 5, 33, 17, 2, 151, 154, 5, 35, 18, 2, 152, 154, 9,
89
	9, 2, 2, 153, 150, 3, 2, 2, 2, 153, 151, 3, 2, 2, 2, 153, 152, 3, 2, 2,
90
	2, 154, 32, 3, 2, 2, 2, 155, 156, 9, 10, 2, 2, 156, 34, 3, 2, 2, 2, 157,
91
	158, 4, 50, 59, 2, 158, 36, 3, 2, 2, 2, 159, 168, 7, 50, 2, 2, 160, 164,
92
	9, 5, 2, 2, 161, 163, 5, 35, 18, 2, 162, 161, 3, 2, 2, 2, 163, 166, 3,
93
	2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 165, 3, 2, 2, 2, 165, 168, 3, 2, 2,
94
	2, 166, 164, 3, 2, 2, 2, 167, 159, 3, 2, 2, 2, 167, 160, 3, 2, 2, 2, 168,
95
	38, 3, 2, 2, 2, 22, 2, 40, 46, 57, 61, 67, 87, 90, 97, 103, 105, 111, 117,
96
	127, 132, 138, 144, 153, 164, 167, 3, 2, 3, 2,
97
}
98
99
var lexerDeserializer = antlr.NewATNDeserializer(nil)
100
var lexerAtn = lexerDeserializer.DeserializeFromUInt16(serializedLexerAtn)
101
102
var lexerChannelNames = []string{
103
	"DEFAULT_TOKEN_CHANNEL", "HIDDEN",
104
}
105
106
var lexerModeNames = []string{
107
	"DEFAULT_MODE",
108
}
109
110
var lexerLiteralNames = []string{
111
	"", "", "", "", "'+'", "'-'", "'/'",
112
}
113
114
var lexerSymbolicNames = []string{
115
	"", "EsDuration", "GoDuration", "Literal", "Plus", "Minus", "Round", "Builtins",
116
	"IntegerLiteral", "FloatLiteral", "Identifier", "WhiteSpaces", "DateLiteral",
117
}
118
119
var lexerRuleNames = []string{
120
	"EsDuration", "GoDuration", "Literal", "Plus", "Minus", "Round", "Builtins",
121
	"IntegerLiteral", "FloatLiteral", "Identifier", "WhiteSpaces", "DateLiteral",
122
	"DateSeparator", "IdentifierStart", "IdentifierPart", "Letter", "Digit",
123
	"DecimalLiteral",
124
}
125
126
type DatemathLexer struct {
127
	*antlr.BaseLexer
128
	channelNames []string
129
	modeNames    []string
130
	// TODO: EOF string
131
}
132
133
var lexerDecisionToDFA = make([]*antlr.DFA, len(lexerAtn.DecisionToState))
134
135
func init() {
136
	for index, ds := range lexerAtn.DecisionToState {
137
		lexerDecisionToDFA[index] = antlr.NewDFA(ds, index)
138
	}
139
}
140
141
func NewDatemathLexer(input antlr.CharStream) *DatemathLexer {
142
143
	l := new(DatemathLexer)
144
145
	l.BaseLexer = antlr.NewBaseLexer(input)
146
	l.Interpreter = antlr.NewLexerATNSimulator(l, lexerAtn, lexerDecisionToDFA, antlr.NewPredictionContextCache())
147
148
	l.channelNames = lexerChannelNames
149
	l.modeNames = lexerModeNames
150
	l.RuleNames = lexerRuleNames
151
	l.LiteralNames = lexerLiteralNames
152
	l.SymbolicNames = lexerSymbolicNames
153
	l.GrammarFileName = "Datemath.g4"
154
	// TODO: l.EOF = antlr.TokenEOF
155
156
	return l
157
}
158
159
// DatemathLexer tokens.
160
const (
161
	DatemathLexerEsDuration     = 1
162
	DatemathLexerGoDuration     = 2
163
	DatemathLexerLiteral        = 3
164
	DatemathLexerPlus           = 4
165
	DatemathLexerMinus          = 5
166
	DatemathLexerRound          = 6
167
	DatemathLexerBuiltins       = 7
168
	DatemathLexerIntegerLiteral = 8
169
	DatemathLexerFloatLiteral   = 9
170
	DatemathLexerIdentifier     = 10
171
	DatemathLexerWhiteSpaces    = 11
172
	DatemathLexerDateLiteral    = 12
173
)
174