mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 07:34:04 -08:00
1f73073d73
Discussion see #7532. cc @juliusv Signed-off-by: Tobias Guggenmos <tobias.guggenmos@uni-ulm.de>
1655 lines
39 KiB
Go
1655 lines
39 KiB
Go
// Code generated by goyacc -o generated_parser.y.go generated_parser.y. DO NOT EDIT.
|
|
|
|
//line generated_parser.y:15
|
|
package parser
|
|
|
|
import __yyfmt__ "fmt"
|
|
|
|
//line generated_parser.y:15
|
|
|
|
import (
|
|
"math"
|
|
"sort"
|
|
"strconv"
|
|
"time"
|
|
|
|
"github.com/prometheus/prometheus/pkg/labels"
|
|
"github.com/prometheus/prometheus/pkg/value"
|
|
)
|
|
|
|
//line generated_parser.y:28
|
|
type yySymType struct {
|
|
yys int
|
|
node Node
|
|
item Item
|
|
matchers []*labels.Matcher
|
|
matcher *labels.Matcher
|
|
label labels.Label
|
|
labels labels.Labels
|
|
strings []string
|
|
series []SequenceValue
|
|
uint uint64
|
|
float float64
|
|
duration time.Duration
|
|
}
|
|
|
|
const ASSIGN = 57346
|
|
const BLANK = 57347
|
|
const COLON = 57348
|
|
const COMMA = 57349
|
|
const COMMENT = 57350
|
|
const DURATION = 57351
|
|
const EOF = 57352
|
|
const ERROR = 57353
|
|
const IDENTIFIER = 57354
|
|
const LEFT_BRACE = 57355
|
|
const LEFT_BRACKET = 57356
|
|
const LEFT_PAREN = 57357
|
|
const METRIC_IDENTIFIER = 57358
|
|
const NUMBER = 57359
|
|
const RIGHT_BRACE = 57360
|
|
const RIGHT_BRACKET = 57361
|
|
const RIGHT_PAREN = 57362
|
|
const SEMICOLON = 57363
|
|
const SPACE = 57364
|
|
const STRING = 57365
|
|
const TIMES = 57366
|
|
const operatorsStart = 57367
|
|
const ADD = 57368
|
|
const DIV = 57369
|
|
const EQL = 57370
|
|
const EQL_REGEX = 57371
|
|
const GTE = 57372
|
|
const GTR = 57373
|
|
const LAND = 57374
|
|
const LOR = 57375
|
|
const LSS = 57376
|
|
const LTE = 57377
|
|
const LUNLESS = 57378
|
|
const MOD = 57379
|
|
const MUL = 57380
|
|
const NEQ = 57381
|
|
const NEQ_REGEX = 57382
|
|
const POW = 57383
|
|
const SUB = 57384
|
|
const operatorsEnd = 57385
|
|
const aggregatorsStart = 57386
|
|
const AVG = 57387
|
|
const BOTTOMK = 57388
|
|
const COUNT = 57389
|
|
const COUNT_VALUES = 57390
|
|
const GROUP = 57391
|
|
const MAX = 57392
|
|
const MIN = 57393
|
|
const QUANTILE = 57394
|
|
const STDDEV = 57395
|
|
const STDVAR = 57396
|
|
const SUM = 57397
|
|
const TOPK = 57398
|
|
const aggregatorsEnd = 57399
|
|
const keywordsStart = 57400
|
|
const BOOL = 57401
|
|
const BY = 57402
|
|
const GROUP_LEFT = 57403
|
|
const GROUP_RIGHT = 57404
|
|
const IGNORING = 57405
|
|
const OFFSET = 57406
|
|
const ON = 57407
|
|
const WITHOUT = 57408
|
|
const keywordsEnd = 57409
|
|
const startSymbolsStart = 57410
|
|
const START_METRIC = 57411
|
|
const START_SERIES_DESCRIPTION = 57412
|
|
const START_EXPRESSION = 57413
|
|
const START_METRIC_SELECTOR = 57414
|
|
const startSymbolsEnd = 57415
|
|
|
|
var yyToknames = [...]string{
|
|
"$end",
|
|
"error",
|
|
"$unk",
|
|
"ASSIGN",
|
|
"BLANK",
|
|
"COLON",
|
|
"COMMA",
|
|
"COMMENT",
|
|
"DURATION",
|
|
"EOF",
|
|
"ERROR",
|
|
"IDENTIFIER",
|
|
"LEFT_BRACE",
|
|
"LEFT_BRACKET",
|
|
"LEFT_PAREN",
|
|
"METRIC_IDENTIFIER",
|
|
"NUMBER",
|
|
"RIGHT_BRACE",
|
|
"RIGHT_BRACKET",
|
|
"RIGHT_PAREN",
|
|
"SEMICOLON",
|
|
"SPACE",
|
|
"STRING",
|
|
"TIMES",
|
|
"operatorsStart",
|
|
"ADD",
|
|
"DIV",
|
|
"EQL",
|
|
"EQL_REGEX",
|
|
"GTE",
|
|
"GTR",
|
|
"LAND",
|
|
"LOR",
|
|
"LSS",
|
|
"LTE",
|
|
"LUNLESS",
|
|
"MOD",
|
|
"MUL",
|
|
"NEQ",
|
|
"NEQ_REGEX",
|
|
"POW",
|
|
"SUB",
|
|
"operatorsEnd",
|
|
"aggregatorsStart",
|
|
"AVG",
|
|
"BOTTOMK",
|
|
"COUNT",
|
|
"COUNT_VALUES",
|
|
"GROUP",
|
|
"MAX",
|
|
"MIN",
|
|
"QUANTILE",
|
|
"STDDEV",
|
|
"STDVAR",
|
|
"SUM",
|
|
"TOPK",
|
|
"aggregatorsEnd",
|
|
"keywordsStart",
|
|
"BOOL",
|
|
"BY",
|
|
"GROUP_LEFT",
|
|
"GROUP_RIGHT",
|
|
"IGNORING",
|
|
"OFFSET",
|
|
"ON",
|
|
"WITHOUT",
|
|
"keywordsEnd",
|
|
"startSymbolsStart",
|
|
"START_METRIC",
|
|
"START_SERIES_DESCRIPTION",
|
|
"START_EXPRESSION",
|
|
"START_METRIC_SELECTOR",
|
|
"startSymbolsEnd",
|
|
}
|
|
var yyStatenames = [...]string{}
|
|
|
|
const yyEofCode = 1
|
|
const yyErrCode = 2
|
|
const yyInitialStackSize = 16
|
|
|
|
//line generated_parser.y:710
|
|
|
|
//line yacctab:1
|
|
var yyExca = [...]int{
|
|
-1, 1,
|
|
1, -1,
|
|
-2, 0,
|
|
-1, 33,
|
|
1, 121,
|
|
10, 121,
|
|
22, 121,
|
|
-2, 0,
|
|
-1, 55,
|
|
2, 133,
|
|
15, 133,
|
|
60, 133,
|
|
66, 133,
|
|
-2, 89,
|
|
-1, 56,
|
|
2, 134,
|
|
15, 134,
|
|
60, 134,
|
|
66, 134,
|
|
-2, 90,
|
|
-1, 57,
|
|
2, 135,
|
|
15, 135,
|
|
60, 135,
|
|
66, 135,
|
|
-2, 92,
|
|
-1, 58,
|
|
2, 136,
|
|
15, 136,
|
|
60, 136,
|
|
66, 136,
|
|
-2, 93,
|
|
-1, 59,
|
|
2, 137,
|
|
15, 137,
|
|
60, 137,
|
|
66, 137,
|
|
-2, 94,
|
|
-1, 60,
|
|
2, 138,
|
|
15, 138,
|
|
60, 138,
|
|
66, 138,
|
|
-2, 99,
|
|
-1, 61,
|
|
2, 139,
|
|
15, 139,
|
|
60, 139,
|
|
66, 139,
|
|
-2, 101,
|
|
-1, 62,
|
|
2, 140,
|
|
15, 140,
|
|
60, 140,
|
|
66, 140,
|
|
-2, 103,
|
|
-1, 63,
|
|
2, 141,
|
|
15, 141,
|
|
60, 141,
|
|
66, 141,
|
|
-2, 104,
|
|
-1, 64,
|
|
2, 142,
|
|
15, 142,
|
|
60, 142,
|
|
66, 142,
|
|
-2, 105,
|
|
-1, 65,
|
|
2, 143,
|
|
15, 143,
|
|
60, 143,
|
|
66, 143,
|
|
-2, 106,
|
|
-1, 66,
|
|
2, 144,
|
|
15, 144,
|
|
60, 144,
|
|
66, 144,
|
|
-2, 107,
|
|
-1, 176,
|
|
12, 184,
|
|
13, 184,
|
|
16, 184,
|
|
17, 184,
|
|
23, 184,
|
|
26, 184,
|
|
32, 184,
|
|
33, 184,
|
|
36, 184,
|
|
42, 184,
|
|
45, 184,
|
|
46, 184,
|
|
47, 184,
|
|
48, 184,
|
|
49, 184,
|
|
50, 184,
|
|
51, 184,
|
|
52, 184,
|
|
53, 184,
|
|
54, 184,
|
|
55, 184,
|
|
56, 184,
|
|
60, 184,
|
|
64, 184,
|
|
66, 184,
|
|
-2, 0,
|
|
-1, 177,
|
|
12, 184,
|
|
13, 184,
|
|
16, 184,
|
|
17, 184,
|
|
23, 184,
|
|
26, 184,
|
|
32, 184,
|
|
33, 184,
|
|
36, 184,
|
|
42, 184,
|
|
45, 184,
|
|
46, 184,
|
|
47, 184,
|
|
48, 184,
|
|
49, 184,
|
|
50, 184,
|
|
51, 184,
|
|
52, 184,
|
|
53, 184,
|
|
54, 184,
|
|
55, 184,
|
|
56, 184,
|
|
60, 184,
|
|
64, 184,
|
|
66, 184,
|
|
-2, 0,
|
|
-1, 193,
|
|
19, 182,
|
|
-2, 0,
|
|
-1, 241,
|
|
19, 183,
|
|
-2, 0,
|
|
}
|
|
|
|
const yyPrivate = 57344
|
|
|
|
const yyLast = 598
|
|
|
|
var yyAct = [...]int{
|
|
|
|
247, 197, 35, 136, 237, 238, 168, 169, 108, 74,
|
|
97, 96, 99, 174, 121, 175, 98, 250, 100, 176,
|
|
177, 230, 95, 54, 231, 229, 171, 48, 69, 101,
|
|
50, 22, 49, 163, 245, 148, 251, 248, 51, 244,
|
|
116, 67, 172, 6, 170, 101, 228, 18, 19, 92,
|
|
115, 20, 243, 103, 162, 104, 69, 68, 117, 102,
|
|
55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
|
|
65, 66, 94, 95, 99, 13, 114, 105, 31, 24,
|
|
100, 30, 7, 252, 8, 79, 80, 81, 33, 82,
|
|
83, 84, 85, 86, 87, 88, 89, 90, 91, 139,
|
|
92, 93, 225, 145, 149, 143, 146, 141, 110, 142,
|
|
2, 3, 4, 5, 242, 224, 144, 78, 109, 32,
|
|
173, 138, 161, 94, 226, 178, 179, 180, 181, 182,
|
|
183, 184, 185, 186, 187, 188, 189, 190, 191, 122,
|
|
123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
|
|
133, 134, 135, 153, 46, 140, 10, 137, 152, 1,
|
|
70, 227, 138, 155, 138, 240, 71, 45, 44, 151,
|
|
34, 95, 48, 69, 232, 50, 22, 49, 233, 234,
|
|
235, 236, 239, 51, 80, 43, 67, 194, 42, 156,
|
|
158, 193, 18, 19, 89, 90, 20, 241, 92, 120,
|
|
157, 159, 68, 41, 192, 55, 56, 57, 58, 59,
|
|
60, 61, 62, 63, 64, 65, 66, 40, 165, 76,
|
|
13, 94, 39, 118, 24, 167, 30, 147, 246, 75,
|
|
170, 38, 249, 48, 69, 160, 50, 22, 49, 171,
|
|
113, 119, 110, 37, 51, 112, 254, 67, 36, 76,
|
|
166, 255, 109, 18, 19, 172, 111, 20, 107, 75,
|
|
77, 164, 195, 68, 72, 73, 55, 56, 57, 58,
|
|
59, 60, 61, 62, 63, 64, 65, 66, 199, 53,
|
|
52, 13, 9, 9, 198, 24, 154, 30, 209, 47,
|
|
106, 0, 215, 0, 0, 0, 253, 0, 0, 0,
|
|
0, 0, 0, 0, 0, 0, 0, 0, 211, 212,
|
|
0, 0, 213, 0, 0, 0, 0, 0, 0, 0,
|
|
0, 200, 202, 204, 205, 206, 214, 216, 219, 220,
|
|
221, 222, 223, 199, 0, 201, 203, 207, 208, 210,
|
|
217, 218, 0, 209, 0, 0, 0, 215, 0, 0,
|
|
0, 196, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
0, 0, 0, 211, 212, 0, 0, 213, 0, 0,
|
|
0, 0, 0, 0, 0, 0, 200, 202, 204, 205,
|
|
206, 214, 216, 219, 220, 221, 222, 223, 0, 0,
|
|
201, 203, 207, 208, 210, 217, 218, 17, 69, 0,
|
|
0, 22, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
0, 0, 0, 0, 0, 0, 0, 18, 19, 0,
|
|
0, 20, 17, 31, 0, 0, 22, 0, 0, 0,
|
|
11, 12, 14, 15, 16, 21, 23, 25, 26, 27,
|
|
28, 29, 18, 19, 0, 13, 20, 0, 0, 24,
|
|
0, 30, 0, 0, 0, 11, 12, 14, 15, 16,
|
|
21, 23, 25, 26, 27, 28, 29, 95, 0, 0,
|
|
13, 0, 0, 150, 24, 0, 30, 0, 0, 79,
|
|
80, 81, 0, 82, 83, 84, 85, 86, 87, 88,
|
|
89, 90, 91, 0, 92, 93, 0, 0, 95, 0,
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
79, 80, 81, 0, 82, 83, 84, 94, 86, 87,
|
|
88, 89, 90, 91, 0, 92, 93, 0, 0, 95,
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
0, 79, 80, 81, 0, 82, 83, 95, 94, 86,
|
|
87, 0, 89, 90, 91, 0, 92, 93, 0, 79,
|
|
80, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
89, 90, 0, 0, 92, 93, 0, 0, 0, 94,
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
0, 0, 0, 0, 0, 0, 0, 94,
|
|
}
|
|
var yyPact = [...]int{
|
|
|
|
41, 72, 410, 410, 160, 385, -1000, -1000, -1000, 65,
|
|
-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
|
|
-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
|
|
-1000, 247, -1000, 115, -1000, 59, -1000, -1000, -1000, -1000,
|
|
-1000, -1000, -1000, -1000, -1000, -1000, -1000, 14, 30, -1000,
|
|
221, -1000, 221, 43, -1000, -1000, -1000, -1000, -1000, -1000,
|
|
-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 240,
|
|
-1000, -1000, 238, -1000, -1000, 48, -1000, 18, -1000, -45,
|
|
-45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
|
|
-45, -45, -45, -45, 155, 153, 30, -48, -1000, 101,
|
|
101, 15, -1000, 453, 8, -1000, 151, -1000, -1000, 161,
|
|
-1000, -1000, 217, -1000, 31, -1000, 213, 221, -1000, -50,
|
|
-42, -1000, 221, 221, 221, 221, 221, 221, 221, 221,
|
|
221, 221, 221, 221, 221, 221, -1000, -1000, -1000, 185,
|
|
-1000, -1000, -1000, -1000, 331, -1000, -1000, 95, -1000, 59,
|
|
-1000, -1000, 106, -1000, 23, -1000, -1000, -1000, -1000, -1000,
|
|
-1000, -1000, -1000, -1000, -1000, -3, 0, -1000, -1000, -1000,
|
|
-1000, 27, 27, 157, 101, 101, 101, 101, 8, 533,
|
|
533, 533, 515, 484, 533, 533, 515, 8, 8, 533,
|
|
8, 157, -1000, 112, -1000, 32, -1000, -1000, -1000, -1000,
|
|
-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
|
|
-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
|
|
-1000, -1000, -1000, -1000, -1000, 221, -1000, -1000, -1000, -1000,
|
|
20, 20, -7, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
|
|
17, 81, -1000, -1000, 276, -1000, 59, -1000, -1000, -1000,
|
|
20, -1000, -1000, -1000, -1000, -1000,
|
|
}
|
|
var yyPgo = [...]int{
|
|
|
|
0, 290, 8, 289, 1, 286, 284, 279, 280, 156,
|
|
264, 84, 9, 262, 5, 4, 261, 260, 0, 6,
|
|
250, 7, 248, 11, 58, 243, 241, 2, 231, 227,
|
|
10, 223, 23, 222, 217, 203, 199, 188, 185, 168,
|
|
167, 154, 3, 165, 159, 119,
|
|
}
|
|
var yyR1 = [...]int{
|
|
|
|
0, 44, 44, 44, 44, 44, 44, 44, 27, 27,
|
|
27, 27, 27, 27, 27, 27, 27, 27, 27, 22,
|
|
22, 22, 22, 23, 23, 25, 25, 25, 25, 25,
|
|
25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
|
|
24, 26, 26, 36, 36, 31, 31, 31, 31, 14,
|
|
14, 14, 14, 13, 13, 13, 4, 4, 28, 30,
|
|
30, 29, 29, 29, 37, 35, 35, 33, 39, 39,
|
|
39, 39, 39, 40, 41, 41, 41, 32, 32, 32,
|
|
1, 1, 1, 2, 2, 2, 2, 11, 11, 7,
|
|
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
|
7, 7, 7, 7, 7, 7, 7, 7, 7, 9,
|
|
9, 9, 9, 10, 10, 10, 12, 12, 12, 12,
|
|
45, 17, 17, 17, 17, 16, 16, 16, 16, 16,
|
|
20, 20, 20, 3, 3, 3, 3, 3, 3, 3,
|
|
3, 3, 3, 3, 3, 6, 6, 6, 6, 6,
|
|
6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
|
|
6, 6, 6, 6, 6, 6, 6, 6, 6, 8,
|
|
8, 5, 5, 5, 5, 34, 19, 21, 21, 18,
|
|
42, 38, 43, 43, 15, 15,
|
|
}
|
|
var yyR2 = [...]int{
|
|
|
|
0, 2, 2, 2, 2, 2, 2, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
|
|
3, 2, 2, 2, 2, 4, 4, 4, 4, 4,
|
|
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
|
1, 0, 1, 3, 3, 1, 1, 3, 3, 3,
|
|
4, 2, 1, 3, 1, 2, 1, 1, 2, 3,
|
|
2, 3, 1, 2, 3, 3, 3, 4, 6, 6,
|
|
5, 4, 3, 2, 2, 1, 1, 3, 4, 2,
|
|
3, 1, 2, 3, 3, 2, 1, 2, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
|
|
4, 2, 0, 3, 1, 2, 3, 3, 2, 1,
|
|
2, 0, 3, 2, 1, 1, 3, 1, 3, 4,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
1, 1, 1, 1, 1, 1, 1, 2, 2, 1,
|
|
1, 1, 0, 1, 0, 1,
|
|
}
|
|
var yyChk = [...]int{
|
|
|
|
-1000, -44, 69, 70, 71, 72, 2, 10, -11, -7,
|
|
-9, 45, 46, 60, 47, 48, 49, 12, 32, 33,
|
|
36, 50, 16, 51, 64, 52, 53, 54, 55, 56,
|
|
66, 13, -45, -11, 10, -27, -22, -25, -28, -33,
|
|
-34, -35, -37, -38, -39, -40, -41, -3, 12, 17,
|
|
15, 23, -8, -7, -32, 45, 46, 47, 48, 49,
|
|
50, 51, 52, 53, 54, 55, 56, 26, 42, 13,
|
|
-41, -9, -10, 18, -12, 12, 2, -17, 2, 26,
|
|
27, 28, 30, 31, 32, 33, 34, 35, 36, 37,
|
|
38, 39, 41, 42, 64, 14, -23, -30, 2, 60,
|
|
66, 15, -30, -27, -27, -32, -1, 18, -2, 12,
|
|
2, 18, 7, 2, 28, 2, 22, -24, -31, -26,
|
|
-36, 59, -24, -24, -24, -24, -24, -24, -24, -24,
|
|
-24, -24, -24, -24, -24, -24, -42, 2, 9, -42,
|
|
2, -30, -23, -14, 15, 2, -14, -29, 20, -27,
|
|
20, 18, 7, 2, -5, 2, 28, 39, 29, 40,
|
|
18, -12, 23, 2, -16, 5, -20, 12, -19, -21,
|
|
17, 26, 42, -27, 63, 65, 61, 62, -27, -27,
|
|
-27, -27, -27, -27, -27, -27, -27, -27, -27, -27,
|
|
-27, -27, 19, 6, 2, -13, 20, -4, -6, 2,
|
|
45, 59, 46, 60, 47, 48, 49, 61, 62, 12,
|
|
63, 32, 33, 36, 50, 16, 51, 64, 65, 52,
|
|
53, 54, 55, 56, 20, 7, 18, -2, 23, 2,
|
|
24, 24, -21, -19, -19, -14, -14, -15, -14, -15,
|
|
-43, -42, 2, 20, 7, 2, -27, -18, 17, -18,
|
|
24, 19, 2, 20, -4, -18,
|
|
}
|
|
var yyDef = [...]int{
|
|
|
|
0, -2, 112, 112, 0, 0, 7, 6, 1, 112,
|
|
88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
|
|
98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
|
|
108, 0, 2, -2, 3, 4, 8, 9, 10, 11,
|
|
12, 13, 14, 15, 16, 17, 18, 0, 95, 175,
|
|
0, 181, 0, 75, 76, -2, -2, -2, -2, -2,
|
|
-2, -2, -2, -2, -2, -2, -2, 169, 170, 0,
|
|
5, 87, 0, 111, 114, 0, 119, 120, 124, 41,
|
|
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
|
|
41, 41, 41, 41, 0, 0, 0, 21, 22, 0,
|
|
0, 0, 58, 0, 73, 74, 0, 79, 81, 0,
|
|
86, 109, 0, 115, 0, 118, 123, 0, 40, 45,
|
|
46, 42, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
0, 0, 0, 0, 0, 0, 65, 66, 180, 0,
|
|
72, 19, 20, 23, 0, 52, 24, 0, 60, 62,
|
|
64, 77, 0, 82, 0, 85, 171, 172, 173, 174,
|
|
110, 113, 116, 117, 122, 125, 127, 130, 131, 132,
|
|
176, 0, 0, 25, 0, 0, -2, -2, 26, 27,
|
|
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
|
|
38, 39, 67, -2, 71, 0, 51, 54, 56, 57,
|
|
145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
|
|
155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
|
|
165, 166, 167, 168, 59, 63, 78, 80, 83, 84,
|
|
0, 0, 0, 177, 178, 43, 44, 47, 185, 48,
|
|
0, -2, 70, 49, 0, 55, 61, 126, 179, 128,
|
|
0, 68, 69, 50, 53, 129,
|
|
}
|
|
var yyTok1 = [...]int{
|
|
|
|
1,
|
|
}
|
|
var yyTok2 = [...]int{
|
|
|
|
2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
|
|
12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
|
|
22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
|
32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
|
|
42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
|
|
52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
|
|
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
|
|
72, 73,
|
|
}
|
|
var yyTok3 = [...]int{
|
|
0,
|
|
}
|
|
|
|
var yyErrorMessages = [...]struct {
|
|
state int
|
|
token int
|
|
msg string
|
|
}{}
|
|
|
|
//line yaccpar:1
|
|
|
|
/* parser for yacc output */
|
|
|
|
var (
|
|
yyDebug = 0
|
|
yyErrorVerbose = false
|
|
)
|
|
|
|
type yyLexer interface {
|
|
Lex(lval *yySymType) int
|
|
Error(s string)
|
|
}
|
|
|
|
type yyParser interface {
|
|
Parse(yyLexer) int
|
|
Lookahead() int
|
|
}
|
|
|
|
type yyParserImpl struct {
|
|
lval yySymType
|
|
stack [yyInitialStackSize]yySymType
|
|
char int
|
|
}
|
|
|
|
func (p *yyParserImpl) Lookahead() int {
|
|
return p.char
|
|
}
|
|
|
|
func yyNewParser() yyParser {
|
|
return &yyParserImpl{}
|
|
}
|
|
|
|
const yyFlag = -1000
|
|
|
|
func yyTokname(c int) string {
|
|
if c >= 1 && c-1 < len(yyToknames) {
|
|
if yyToknames[c-1] != "" {
|
|
return yyToknames[c-1]
|
|
}
|
|
}
|
|
return __yyfmt__.Sprintf("tok-%v", c)
|
|
}
|
|
|
|
func yyStatname(s int) string {
|
|
if s >= 0 && s < len(yyStatenames) {
|
|
if yyStatenames[s] != "" {
|
|
return yyStatenames[s]
|
|
}
|
|
}
|
|
return __yyfmt__.Sprintf("state-%v", s)
|
|
}
|
|
|
|
func yyErrorMessage(state, lookAhead int) string {
|
|
const TOKSTART = 4
|
|
|
|
if !yyErrorVerbose {
|
|
return "syntax error"
|
|
}
|
|
|
|
for _, e := range yyErrorMessages {
|
|
if e.state == state && e.token == lookAhead {
|
|
return "syntax error: " + e.msg
|
|
}
|
|
}
|
|
|
|
res := "syntax error: unexpected " + yyTokname(lookAhead)
|
|
|
|
// To match Bison, suggest at most four expected tokens.
|
|
expected := make([]int, 0, 4)
|
|
|
|
// Look for shiftable tokens.
|
|
base := yyPact[state]
|
|
for tok := TOKSTART; tok-1 < len(yyToknames); tok++ {
|
|
if n := base + tok; n >= 0 && n < yyLast && yyChk[yyAct[n]] == tok {
|
|
if len(expected) == cap(expected) {
|
|
return res
|
|
}
|
|
expected = append(expected, tok)
|
|
}
|
|
}
|
|
|
|
if yyDef[state] == -2 {
|
|
i := 0
|
|
for yyExca[i] != -1 || yyExca[i+1] != state {
|
|
i += 2
|
|
}
|
|
|
|
// Look for tokens that we accept or reduce.
|
|
for i += 2; yyExca[i] >= 0; i += 2 {
|
|
tok := yyExca[i]
|
|
if tok < TOKSTART || yyExca[i+1] == 0 {
|
|
continue
|
|
}
|
|
if len(expected) == cap(expected) {
|
|
return res
|
|
}
|
|
expected = append(expected, tok)
|
|
}
|
|
|
|
// If the default action is to accept or reduce, give up.
|
|
if yyExca[i+1] != 0 {
|
|
return res
|
|
}
|
|
}
|
|
|
|
for i, tok := range expected {
|
|
if i == 0 {
|
|
res += ", expecting "
|
|
} else {
|
|
res += " or "
|
|
}
|
|
res += yyTokname(tok)
|
|
}
|
|
return res
|
|
}
|
|
|
|
func yylex1(lex yyLexer, lval *yySymType) (char, token int) {
|
|
token = 0
|
|
char = lex.Lex(lval)
|
|
if char <= 0 {
|
|
token = yyTok1[0]
|
|
goto out
|
|
}
|
|
if char < len(yyTok1) {
|
|
token = yyTok1[char]
|
|
goto out
|
|
}
|
|
if char >= yyPrivate {
|
|
if char < yyPrivate+len(yyTok2) {
|
|
token = yyTok2[char-yyPrivate]
|
|
goto out
|
|
}
|
|
}
|
|
for i := 0; i < len(yyTok3); i += 2 {
|
|
token = yyTok3[i+0]
|
|
if token == char {
|
|
token = yyTok3[i+1]
|
|
goto out
|
|
}
|
|
}
|
|
|
|
out:
|
|
if token == 0 {
|
|
token = yyTok2[1] /* unknown char */
|
|
}
|
|
if yyDebug >= 3 {
|
|
__yyfmt__.Printf("lex %s(%d)\n", yyTokname(token), uint(char))
|
|
}
|
|
return char, token
|
|
}
|
|
|
|
func yyParse(yylex yyLexer) int {
|
|
return yyNewParser().Parse(yylex)
|
|
}
|
|
|
|
func (yyrcvr *yyParserImpl) Parse(yylex yyLexer) int {
|
|
var yyn int
|
|
var yyVAL yySymType
|
|
var yyDollar []yySymType
|
|
_ = yyDollar // silence set and not used
|
|
yyS := yyrcvr.stack[:]
|
|
|
|
Nerrs := 0 /* number of errors */
|
|
Errflag := 0 /* error recovery flag */
|
|
yystate := 0
|
|
yyrcvr.char = -1
|
|
yytoken := -1 // yyrcvr.char translated into internal numbering
|
|
defer func() {
|
|
// Make sure we report no lookahead when not parsing.
|
|
yystate = -1
|
|
yyrcvr.char = -1
|
|
yytoken = -1
|
|
}()
|
|
yyp := -1
|
|
goto yystack
|
|
|
|
ret0:
|
|
return 0
|
|
|
|
ret1:
|
|
return 1
|
|
|
|
yystack:
|
|
/* put a state and value onto the stack */
|
|
if yyDebug >= 4 {
|
|
__yyfmt__.Printf("char %v in %v\n", yyTokname(yytoken), yyStatname(yystate))
|
|
}
|
|
|
|
yyp++
|
|
if yyp >= len(yyS) {
|
|
nyys := make([]yySymType, len(yyS)*2)
|
|
copy(nyys, yyS)
|
|
yyS = nyys
|
|
}
|
|
yyS[yyp] = yyVAL
|
|
yyS[yyp].yys = yystate
|
|
|
|
yynewstate:
|
|
yyn = yyPact[yystate]
|
|
if yyn <= yyFlag {
|
|
goto yydefault /* simple state */
|
|
}
|
|
if yyrcvr.char < 0 {
|
|
yyrcvr.char, yytoken = yylex1(yylex, &yyrcvr.lval)
|
|
}
|
|
yyn += yytoken
|
|
if yyn < 0 || yyn >= yyLast {
|
|
goto yydefault
|
|
}
|
|
yyn = yyAct[yyn]
|
|
if yyChk[yyn] == yytoken { /* valid shift */
|
|
yyrcvr.char = -1
|
|
yytoken = -1
|
|
yyVAL = yyrcvr.lval
|
|
yystate = yyn
|
|
if Errflag > 0 {
|
|
Errflag--
|
|
}
|
|
goto yystack
|
|
}
|
|
|
|
yydefault:
|
|
/* default state action */
|
|
yyn = yyDef[yystate]
|
|
if yyn == -2 {
|
|
if yyrcvr.char < 0 {
|
|
yyrcvr.char, yytoken = yylex1(yylex, &yyrcvr.lval)
|
|
}
|
|
|
|
/* look through exception table */
|
|
xi := 0
|
|
for {
|
|
if yyExca[xi+0] == -1 && yyExca[xi+1] == yystate {
|
|
break
|
|
}
|
|
xi += 2
|
|
}
|
|
for xi += 2; ; xi += 2 {
|
|
yyn = yyExca[xi+0]
|
|
if yyn < 0 || yyn == yytoken {
|
|
break
|
|
}
|
|
}
|
|
yyn = yyExca[xi+1]
|
|
if yyn < 0 {
|
|
goto ret0
|
|
}
|
|
}
|
|
if yyn == 0 {
|
|
/* error ... attempt to resume parsing */
|
|
switch Errflag {
|
|
case 0: /* brand new error */
|
|
yylex.Error(yyErrorMessage(yystate, yytoken))
|
|
Nerrs++
|
|
if yyDebug >= 1 {
|
|
__yyfmt__.Printf("%s", yyStatname(yystate))
|
|
__yyfmt__.Printf(" saw %s\n", yyTokname(yytoken))
|
|
}
|
|
fallthrough
|
|
|
|
case 1, 2: /* incompletely recovered error ... try again */
|
|
Errflag = 3
|
|
|
|
/* find a state where "error" is a legal shift action */
|
|
for yyp >= 0 {
|
|
yyn = yyPact[yyS[yyp].yys] + yyErrCode
|
|
if yyn >= 0 && yyn < yyLast {
|
|
yystate = yyAct[yyn] /* simulate a shift of "error" */
|
|
if yyChk[yystate] == yyErrCode {
|
|
goto yystack
|
|
}
|
|
}
|
|
|
|
/* the current p has no shift on "error", pop stack */
|
|
if yyDebug >= 2 {
|
|
__yyfmt__.Printf("error recovery pops state %d\n", yyS[yyp].yys)
|
|
}
|
|
yyp--
|
|
}
|
|
/* there is no state on the stack with an error shift ... abort */
|
|
goto ret1
|
|
|
|
case 3: /* no shift yet; clobber input char */
|
|
if yyDebug >= 2 {
|
|
__yyfmt__.Printf("error recovery discards %s\n", yyTokname(yytoken))
|
|
}
|
|
if yytoken == yyEofCode {
|
|
goto ret1
|
|
}
|
|
yyrcvr.char = -1
|
|
yytoken = -1
|
|
goto yynewstate /* try again in the same state */
|
|
}
|
|
}
|
|
|
|
/* reduction by production yyn */
|
|
if yyDebug >= 2 {
|
|
__yyfmt__.Printf("reduce %v in:\n\t%v\n", yyn, yyStatname(yystate))
|
|
}
|
|
|
|
yynt := yyn
|
|
yypt := yyp
|
|
_ = yypt // guard against "declared and not used"
|
|
|
|
yyp -= yyR2[yyn]
|
|
// yyp is now the index of $0. Perform the default action. Iff the
|
|
// reduced production is ε, $1 is possibly out of range.
|
|
if yyp+1 >= len(yyS) {
|
|
nyys := make([]yySymType, len(yyS)*2)
|
|
copy(nyys, yyS)
|
|
yyS = nyys
|
|
}
|
|
yyVAL = yyS[yyp+1]
|
|
|
|
/* consult goto table to find next state */
|
|
yyn = yyR1[yyn]
|
|
yyg := yyPgo[yyn]
|
|
yyj := yyg + yyS[yyp].yys + 1
|
|
|
|
if yyj >= yyLast {
|
|
yystate = yyAct[yyg]
|
|
} else {
|
|
yystate = yyAct[yyj]
|
|
if yyChk[yystate] != -yyn {
|
|
yystate = yyAct[yyg]
|
|
}
|
|
}
|
|
// dummy call; replaced with literal code
|
|
switch yynt {
|
|
|
|
case 1:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:165
|
|
{
|
|
yylex.(*parser).generatedParserResult = yyDollar[2].labels
|
|
}
|
|
case 3:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:168
|
|
{
|
|
yylex.(*parser).addParseErrf(PositionRange{}, "no expression found in input")
|
|
}
|
|
case 4:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:170
|
|
{
|
|
yylex.(*parser).generatedParserResult = yyDollar[2].node
|
|
}
|
|
case 5:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:172
|
|
{
|
|
yylex.(*parser).generatedParserResult = yyDollar[2].node
|
|
}
|
|
case 7:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:175
|
|
{
|
|
yylex.(*parser).unexpected("", "")
|
|
}
|
|
case 19:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:197
|
|
{
|
|
yyVAL.node = yylex.(*parser).newAggregateExpr(yyDollar[1].item, yyDollar[2].node, yyDollar[3].node)
|
|
}
|
|
case 20:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:199
|
|
{
|
|
yyVAL.node = yylex.(*parser).newAggregateExpr(yyDollar[1].item, yyDollar[3].node, yyDollar[2].node)
|
|
}
|
|
case 21:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:201
|
|
{
|
|
yyVAL.node = yylex.(*parser).newAggregateExpr(yyDollar[1].item, &AggregateExpr{}, yyDollar[2].node)
|
|
}
|
|
case 22:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:203
|
|
{
|
|
yylex.(*parser).unexpected("aggregation", "")
|
|
yyVAL.node = yylex.(*parser).newAggregateExpr(yyDollar[1].item, &AggregateExpr{}, Expressions{})
|
|
}
|
|
case 23:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:211
|
|
{
|
|
yyVAL.node = &AggregateExpr{
|
|
Grouping: yyDollar[2].strings,
|
|
}
|
|
}
|
|
case 24:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:217
|
|
{
|
|
yyVAL.node = &AggregateExpr{
|
|
Grouping: yyDollar[2].strings,
|
|
Without: true,
|
|
}
|
|
}
|
|
case 25:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:230
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 26:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:231
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 27:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:232
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 28:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:233
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 29:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:234
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 30:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:235
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 31:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:236
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 32:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:237
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 33:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:238
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 34:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:239
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 35:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:240
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 36:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:241
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 37:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:242
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 38:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:243
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 39:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:244
|
|
{
|
|
yyVAL.node = yylex.(*parser).newBinaryExpression(yyDollar[1].node, yyDollar[2].item, yyDollar[3].node, yyDollar[4].node)
|
|
}
|
|
case 41:
|
|
yyDollar = yyS[yypt-0 : yypt+1]
|
|
//line generated_parser.y:252
|
|
{
|
|
yyVAL.node = &BinaryExpr{
|
|
VectorMatching: &VectorMatching{Card: CardOneToOne},
|
|
}
|
|
}
|
|
case 42:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:257
|
|
{
|
|
yyVAL.node = &BinaryExpr{
|
|
VectorMatching: &VectorMatching{Card: CardOneToOne},
|
|
ReturnBool: true,
|
|
}
|
|
}
|
|
case 43:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:265
|
|
{
|
|
yyVAL.node = yyDollar[1].node
|
|
yyVAL.node.(*BinaryExpr).VectorMatching.MatchingLabels = yyDollar[3].strings
|
|
}
|
|
case 44:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:270
|
|
{
|
|
yyVAL.node = yyDollar[1].node
|
|
yyVAL.node.(*BinaryExpr).VectorMatching.MatchingLabels = yyDollar[3].strings
|
|
yyVAL.node.(*BinaryExpr).VectorMatching.On = true
|
|
}
|
|
case 47:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:280
|
|
{
|
|
yyVAL.node = yyDollar[1].node
|
|
yyVAL.node.(*BinaryExpr).VectorMatching.Card = CardManyToOne
|
|
yyVAL.node.(*BinaryExpr).VectorMatching.Include = yyDollar[3].strings
|
|
}
|
|
case 48:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:286
|
|
{
|
|
yyVAL.node = yyDollar[1].node
|
|
yyVAL.node.(*BinaryExpr).VectorMatching.Card = CardOneToMany
|
|
yyVAL.node.(*BinaryExpr).VectorMatching.Include = yyDollar[3].strings
|
|
}
|
|
case 49:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:295
|
|
{
|
|
yyVAL.strings = yyDollar[2].strings
|
|
}
|
|
case 50:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:297
|
|
{
|
|
yyVAL.strings = yyDollar[2].strings
|
|
}
|
|
case 51:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:299
|
|
{
|
|
yyVAL.strings = []string{}
|
|
}
|
|
case 52:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:301
|
|
{
|
|
yylex.(*parser).unexpected("grouping opts", "\"(\"")
|
|
yyVAL.strings = nil
|
|
}
|
|
case 53:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:307
|
|
{
|
|
yyVAL.strings = append(yyDollar[1].strings, yyDollar[3].item.Val)
|
|
}
|
|
case 54:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:309
|
|
{
|
|
yyVAL.strings = []string{yyDollar[1].item.Val}
|
|
}
|
|
case 55:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:311
|
|
{
|
|
yylex.(*parser).unexpected("grouping opts", "\",\" or \")\"")
|
|
yyVAL.strings = yyDollar[1].strings
|
|
}
|
|
case 56:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:315
|
|
{
|
|
if !isLabel(yyDollar[1].item.Val) {
|
|
yylex.(*parser).unexpected("grouping opts", "label")
|
|
}
|
|
yyVAL.item = yyDollar[1].item
|
|
}
|
|
case 57:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:322
|
|
{
|
|
yylex.(*parser).unexpected("grouping opts", "label")
|
|
yyVAL.item = Item{}
|
|
}
|
|
case 58:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:330
|
|
{
|
|
fn, exist := getFunction(yyDollar[1].item.Val)
|
|
if !exist {
|
|
yylex.(*parser).addParseErrf(yyDollar[1].item.PositionRange(), "unknown function with name %q", yyDollar[1].item.Val)
|
|
}
|
|
yyVAL.node = &Call{
|
|
Func: fn,
|
|
Args: yyDollar[2].node.(Expressions),
|
|
PosRange: PositionRange{
|
|
Start: yyDollar[1].item.Pos,
|
|
End: yylex.(*parser).lastClosing,
|
|
},
|
|
}
|
|
}
|
|
case 59:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:347
|
|
{
|
|
yyVAL.node = yyDollar[2].node
|
|
}
|
|
case 60:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:349
|
|
{
|
|
yyVAL.node = Expressions{}
|
|
}
|
|
case 61:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:353
|
|
{
|
|
yyVAL.node = append(yyDollar[1].node.(Expressions), yyDollar[3].node.(Expr))
|
|
}
|
|
case 62:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:355
|
|
{
|
|
yyVAL.node = Expressions{yyDollar[1].node.(Expr)}
|
|
}
|
|
case 63:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:357
|
|
{
|
|
yylex.(*parser).addParseErrf(yyDollar[2].item.PositionRange(), "trailing commas not allowed in function call args")
|
|
yyVAL.node = yyDollar[1].node
|
|
}
|
|
case 64:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:368
|
|
{
|
|
yyVAL.node = &ParenExpr{Expr: yyDollar[2].node.(Expr), PosRange: mergeRanges(&yyDollar[1].item, &yyDollar[3].item)}
|
|
}
|
|
case 65:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:376
|
|
{
|
|
yylex.(*parser).addOffset(yyDollar[1].node, yyDollar[3].duration)
|
|
yyVAL.node = yyDollar[1].node
|
|
}
|
|
case 66:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:381
|
|
{
|
|
yylex.(*parser).unexpected("offset", "duration")
|
|
yyVAL.node = yyDollar[1].node
|
|
}
|
|
case 67:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:389
|
|
{
|
|
var errMsg string
|
|
vs, ok := yyDollar[1].node.(*VectorSelector)
|
|
if !ok {
|
|
errMsg = "ranges only allowed for vector selectors"
|
|
} else if vs.Offset != 0 {
|
|
errMsg = "no offset modifiers allowed before range"
|
|
}
|
|
|
|
if errMsg != "" {
|
|
errRange := mergeRanges(&yyDollar[2].item, &yyDollar[4].item)
|
|
yylex.(*parser).addParseErrf(errRange, errMsg)
|
|
}
|
|
|
|
yyVAL.node = &MatrixSelector{
|
|
VectorSelector: yyDollar[1].node.(Expr),
|
|
Range: yyDollar[3].duration,
|
|
EndPos: yylex.(*parser).lastClosing,
|
|
}
|
|
}
|
|
case 68:
|
|
yyDollar = yyS[yypt-6 : yypt+1]
|
|
//line generated_parser.y:412
|
|
{
|
|
yyVAL.node = &SubqueryExpr{
|
|
Expr: yyDollar[1].node.(Expr),
|
|
Range: yyDollar[3].duration,
|
|
Step: yyDollar[5].duration,
|
|
|
|
EndPos: yyDollar[6].item.Pos + 1,
|
|
}
|
|
}
|
|
case 69:
|
|
yyDollar = yyS[yypt-6 : yypt+1]
|
|
//line generated_parser.y:422
|
|
{
|
|
yylex.(*parser).unexpected("subquery selector", "\"]\"")
|
|
yyVAL.node = yyDollar[1].node
|
|
}
|
|
case 70:
|
|
yyDollar = yyS[yypt-5 : yypt+1]
|
|
//line generated_parser.y:424
|
|
{
|
|
yylex.(*parser).unexpected("subquery selector", "duration or \"]\"")
|
|
yyVAL.node = yyDollar[1].node
|
|
}
|
|
case 71:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:426
|
|
{
|
|
yylex.(*parser).unexpected("subquery or range", "\":\" or \"]\"")
|
|
yyVAL.node = yyDollar[1].node
|
|
}
|
|
case 72:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:428
|
|
{
|
|
yylex.(*parser).unexpected("subquery selector", "duration")
|
|
yyVAL.node = yyDollar[1].node
|
|
}
|
|
case 73:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:438
|
|
{
|
|
if nl, ok := yyDollar[2].node.(*NumberLiteral); ok {
|
|
if yyDollar[1].item.Typ == SUB {
|
|
nl.Val *= -1
|
|
}
|
|
nl.PosRange.Start = yyDollar[1].item.Pos
|
|
yyVAL.node = nl
|
|
} else {
|
|
yyVAL.node = &UnaryExpr{Op: yyDollar[1].item.Typ, Expr: yyDollar[2].node.(Expr), StartPos: yyDollar[1].item.Pos}
|
|
}
|
|
}
|
|
case 74:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:456
|
|
{
|
|
vs := yyDollar[2].node.(*VectorSelector)
|
|
vs.PosRange = mergeRanges(&yyDollar[1].item, vs)
|
|
vs.Name = yyDollar[1].item.Val
|
|
yylex.(*parser).assembleVectorSelector(vs)
|
|
yyVAL.node = vs
|
|
}
|
|
case 75:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:464
|
|
{
|
|
vs := &VectorSelector{
|
|
Name: yyDollar[1].item.Val,
|
|
LabelMatchers: []*labels.Matcher{},
|
|
PosRange: yyDollar[1].item.PositionRange(),
|
|
}
|
|
yylex.(*parser).assembleVectorSelector(vs)
|
|
yyVAL.node = vs
|
|
}
|
|
case 76:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:474
|
|
{
|
|
vs := yyDollar[1].node.(*VectorSelector)
|
|
yylex.(*parser).assembleVectorSelector(vs)
|
|
yyVAL.node = vs
|
|
}
|
|
case 77:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:482
|
|
{
|
|
yyVAL.node = &VectorSelector{
|
|
LabelMatchers: yyDollar[2].matchers,
|
|
PosRange: mergeRanges(&yyDollar[1].item, &yyDollar[3].item),
|
|
}
|
|
}
|
|
case 78:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:489
|
|
{
|
|
yyVAL.node = &VectorSelector{
|
|
LabelMatchers: yyDollar[2].matchers,
|
|
PosRange: mergeRanges(&yyDollar[1].item, &yyDollar[4].item),
|
|
}
|
|
}
|
|
case 79:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:496
|
|
{
|
|
yyVAL.node = &VectorSelector{
|
|
LabelMatchers: []*labels.Matcher{},
|
|
PosRange: mergeRanges(&yyDollar[1].item, &yyDollar[2].item),
|
|
}
|
|
}
|
|
case 80:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:505
|
|
{
|
|
if yyDollar[1].matchers != nil {
|
|
yyVAL.matchers = append(yyDollar[1].matchers, yyDollar[3].matcher)
|
|
} else {
|
|
yyVAL.matchers = yyDollar[1].matchers
|
|
}
|
|
}
|
|
case 81:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:513
|
|
{
|
|
yyVAL.matchers = []*labels.Matcher{yyDollar[1].matcher}
|
|
}
|
|
case 82:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:515
|
|
{
|
|
yylex.(*parser).unexpected("label matching", "\",\" or \"}\"")
|
|
yyVAL.matchers = yyDollar[1].matchers
|
|
}
|
|
case 83:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:519
|
|
{
|
|
yyVAL.matcher = yylex.(*parser).newLabelMatcher(yyDollar[1].item, yyDollar[2].item, yyDollar[3].item)
|
|
}
|
|
case 84:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:521
|
|
{
|
|
yylex.(*parser).unexpected("label matching", "string")
|
|
yyVAL.matcher = nil
|
|
}
|
|
case 85:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:523
|
|
{
|
|
yylex.(*parser).unexpected("label matching", "label matching operator")
|
|
yyVAL.matcher = nil
|
|
}
|
|
case 86:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:525
|
|
{
|
|
yylex.(*parser).unexpected("label matching", "identifier or \"}\"")
|
|
yyVAL.matcher = nil
|
|
}
|
|
case 87:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:533
|
|
{
|
|
yyVAL.labels = append(yyDollar[2].labels, labels.Label{Name: labels.MetricName, Value: yyDollar[1].item.Val})
|
|
sort.Sort(yyVAL.labels)
|
|
}
|
|
case 88:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:535
|
|
{
|
|
yyVAL.labels = yyDollar[1].labels
|
|
}
|
|
case 109:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:542
|
|
{
|
|
yyVAL.labels = labels.New(yyDollar[2].labels...)
|
|
}
|
|
case 110:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:544
|
|
{
|
|
yyVAL.labels = labels.New(yyDollar[2].labels...)
|
|
}
|
|
case 111:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:546
|
|
{
|
|
yyVAL.labels = labels.New()
|
|
}
|
|
case 112:
|
|
yyDollar = yyS[yypt-0 : yypt+1]
|
|
//line generated_parser.y:548
|
|
{
|
|
yyVAL.labels = labels.New()
|
|
}
|
|
case 113:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:552
|
|
{
|
|
yyVAL.labels = append(yyDollar[1].labels, yyDollar[3].label)
|
|
}
|
|
case 114:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:554
|
|
{
|
|
yyVAL.labels = []labels.Label{yyDollar[1].label}
|
|
}
|
|
case 115:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:556
|
|
{
|
|
yylex.(*parser).unexpected("label set", "\",\" or \"}\"")
|
|
yyVAL.labels = yyDollar[1].labels
|
|
}
|
|
case 116:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:561
|
|
{
|
|
yyVAL.label = labels.Label{Name: yyDollar[1].item.Val, Value: yylex.(*parser).unquoteString(yyDollar[3].item.Val)}
|
|
}
|
|
case 117:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:563
|
|
{
|
|
yylex.(*parser).unexpected("label set", "string")
|
|
yyVAL.label = labels.Label{}
|
|
}
|
|
case 118:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:565
|
|
{
|
|
yylex.(*parser).unexpected("label set", "\"=\"")
|
|
yyVAL.label = labels.Label{}
|
|
}
|
|
case 119:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:567
|
|
{
|
|
yylex.(*parser).unexpected("label set", "identifier or \"}\"")
|
|
yyVAL.label = labels.Label{}
|
|
}
|
|
case 120:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:575
|
|
{
|
|
yylex.(*parser).generatedParserResult = &seriesDescription{
|
|
labels: yyDollar[1].labels,
|
|
values: yyDollar[2].series,
|
|
}
|
|
}
|
|
case 121:
|
|
yyDollar = yyS[yypt-0 : yypt+1]
|
|
//line generated_parser.y:584
|
|
{
|
|
yyVAL.series = []SequenceValue{}
|
|
}
|
|
case 122:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:586
|
|
{
|
|
yyVAL.series = append(yyDollar[1].series, yyDollar[3].series...)
|
|
}
|
|
case 123:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:588
|
|
{
|
|
yyVAL.series = yyDollar[1].series
|
|
}
|
|
case 124:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:590
|
|
{
|
|
yylex.(*parser).unexpected("series values", "")
|
|
yyVAL.series = nil
|
|
}
|
|
case 125:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:594
|
|
{
|
|
yyVAL.series = []SequenceValue{{Omitted: true}}
|
|
}
|
|
case 126:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:596
|
|
{
|
|
yyVAL.series = []SequenceValue{}
|
|
for i := uint64(0); i < yyDollar[3].uint; i++ {
|
|
yyVAL.series = append(yyVAL.series, SequenceValue{Omitted: true})
|
|
}
|
|
}
|
|
case 127:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:603
|
|
{
|
|
yyVAL.series = []SequenceValue{{Value: yyDollar[1].float}}
|
|
}
|
|
case 128:
|
|
yyDollar = yyS[yypt-3 : yypt+1]
|
|
//line generated_parser.y:605
|
|
{
|
|
yyVAL.series = []SequenceValue{}
|
|
for i := uint64(0); i <= yyDollar[3].uint; i++ {
|
|
yyVAL.series = append(yyVAL.series, SequenceValue{Value: yyDollar[1].float})
|
|
}
|
|
}
|
|
case 129:
|
|
yyDollar = yyS[yypt-4 : yypt+1]
|
|
//line generated_parser.y:612
|
|
{
|
|
yyVAL.series = []SequenceValue{}
|
|
for i := uint64(0); i <= yyDollar[4].uint; i++ {
|
|
yyVAL.series = append(yyVAL.series, SequenceValue{Value: yyDollar[1].float})
|
|
yyDollar[1].float += yyDollar[2].float
|
|
}
|
|
}
|
|
case 130:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:622
|
|
{
|
|
if yyDollar[1].item.Val != "stale" {
|
|
yylex.(*parser).unexpected("series values", "number or \"stale\"")
|
|
}
|
|
yyVAL.float = math.Float64frombits(value.StaleNaN)
|
|
}
|
|
case 175:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:653
|
|
{
|
|
yyVAL.node = &NumberLiteral{
|
|
Val: yylex.(*parser).number(yyDollar[1].item.Val),
|
|
PosRange: yyDollar[1].item.PositionRange(),
|
|
}
|
|
}
|
|
case 176:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:661
|
|
{
|
|
yyVAL.float = yylex.(*parser).number(yyDollar[1].item.Val)
|
|
}
|
|
case 177:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:663
|
|
{
|
|
yyVAL.float = yyDollar[2].float
|
|
}
|
|
case 178:
|
|
yyDollar = yyS[yypt-2 : yypt+1]
|
|
//line generated_parser.y:664
|
|
{
|
|
yyVAL.float = -yyDollar[2].float
|
|
}
|
|
case 179:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:668
|
|
{
|
|
var err error
|
|
yyVAL.uint, err = strconv.ParseUint(yyDollar[1].item.Val, 10, 64)
|
|
if err != nil {
|
|
yylex.(*parser).addParseErrf(yyDollar[1].item.PositionRange(), "invalid repetition in series values: %s", err)
|
|
}
|
|
}
|
|
case 180:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:678
|
|
{
|
|
var err error
|
|
yyVAL.duration, err = parseDuration(yyDollar[1].item.Val)
|
|
if err != nil {
|
|
yylex.(*parser).addParseErr(yyDollar[1].item.PositionRange(), err)
|
|
}
|
|
}
|
|
case 181:
|
|
yyDollar = yyS[yypt-1 : yypt+1]
|
|
//line generated_parser.y:689
|
|
{
|
|
yyVAL.node = &StringLiteral{
|
|
Val: yylex.(*parser).unquoteString(yyDollar[1].item.Val),
|
|
PosRange: yyDollar[1].item.PositionRange(),
|
|
}
|
|
}
|
|
case 182:
|
|
yyDollar = yyS[yypt-0 : yypt+1]
|
|
//line generated_parser.y:702
|
|
{
|
|
yyVAL.duration = 0
|
|
}
|
|
case 184:
|
|
yyDollar = yyS[yypt-0 : yypt+1]
|
|
//line generated_parser.y:706
|
|
{
|
|
yyVAL.strings = nil
|
|
}
|
|
}
|
|
goto yystack /* stack new state and value */
|
|
}
|