package pql // Code generated by peg -inline pql.peg DO NOT EDIT. import ( "fmt" "io" "os" "sort" "strconv" ) const endSymbol rune = 1114112 /* The rule types inferred from the grammar are below. */ type pegRule uint8 const ( ruleUnknown pegRule = iota ruleCalls ruleCall ruleallargs ruleargs rulearg ruleCOND ruleconditional rulecondint rulecondLT rulecondfield rulevalue ruleitems ruleitem ruledoublequotedstring rulesinglequotedstring rulefieldExpr rulefield rulereserved ruleposfield rulecol rulerow ruleopen ruleclose rulesp ruleeq rulecomma rulelbrack rulerbrack ruleIDENT ruledigits rulesignedDigits ruledecimal ruletimestampbasicfmt ruletimestampfmt ruletimestamp ruleAction0 ruleAction1 ruleAction2 ruleAction3 ruleAction4 ruleAction5 ruleAction6 ruleAction7 ruleAction8 ruleAction9 ruleAction10 ruleAction11 ruleAction12 ruleAction13 ruleAction14 ruleAction15 ruleAction16 ruleAction17 ruleAction18 ruleAction19 ruleAction20 ruleAction21 ruleAction22 ruleAction23 rulePegText ruleAction24 ruleAction25 ruleAction26 ruleAction27 ruleAction28 ruleAction29 ruleAction30 ruleAction31 ruleAction32 ruleAction33 ruleAction34 ruleAction35 ruleAction36 ruleAction37 ruleAction38 ruleAction39 ruleAction40 ruleAction41 ruleAction42 ruleAction43 ruleAction44 ruleAction45 ruleAction46 ruleAction47 ruleAction48 ruleAction49 ruleAction50 ruleAction51 ruleAction52 ruleAction53 ruleAction54 ruleAction55 ruleAction56 ruleAction57 ruleAction58 ) var rul3s = [...]string{ "Unknown", "Calls", "Call", "allargs", "args", "arg", "COND", "conditional", "condint", "condLT", "condfield", "value", "items", "item", "doublequotedstring", "singlequotedstring", "fieldExpr", "field", "reserved", "posfield", "col", "row", "open", "close", "sp", "eq", "comma", "lbrack", "rbrack", "IDENT", "digits", "signedDigits", "decimal", "timestampbasicfmt", "timestampfmt", "timestamp", "Action0", "Action1", "Action2", "Action3", "Action4", "Action5", "Action6", "Action7", "Action8", "Action9", "Action10", "Action11", "Action12", "Action13", "Action14", "Action15", "Action16", "Action17", "Action18", "Action19", "Action20", "Action21", "Action22", "Action23", "PegText", "Action24", "Action25", "Action26", "Action27", "Action28", "Action29", "Action30", "Action31", "Action32", "Action33", "Action34", "Action35", "Action36", "Action37", "Action38", "Action39", "Action40", "Action41", "Action42", "Action43", "Action44", "Action45", "Action46", "Action47", "Action48", "Action49", "Action50", "Action51", "Action52", "Action53", "Action54", "Action55", "Action56", "Action57", "Action58", } type token32 struct { pegRule begin, end uint32 } func (t *token32) String() string { return fmt.Sprintf("\x1B[34m%v\x1B[m %v %v", rul3s[t.pegRule], t.begin, t.end) } type node32 struct { token32 up, next *node32 } func (node *node32) print(w io.Writer, pretty bool, buffer string) { var print func(node *node32, depth int) print = func(node *node32, depth int) { for node != nil { for c := 0; c < depth; c++ { fmt.Fprintf(w, " ") } rule := rul3s[node.pegRule] quote := strconv.Quote(string(([]rune(buffer)[node.begin:node.end]))) if !pretty { fmt.Fprintf(w, "%v %v\n", rule, quote) } else { fmt.Fprintf(w, "\x1B[34m%v\x1B[m %v\n", rule, quote) } if node.up != nil { print(node.up, depth+1) } node = node.next } } print(node, 0) } func (node *node32) Print(w io.Writer, buffer string) { node.print(w, false, buffer) } func (node *node32) PrettyPrint(w io.Writer, buffer string) { node.print(w, true, buffer) } type tokens32 struct { tree []token32 } func (t *tokens32) Trim(length uint32) { t.tree = t.tree[:length] } func (t *tokens32) Print() { for _, token := range t.tree { fmt.Println(token.String()) } } func (t *tokens32) AST() *node32 { type element struct { node *node32 down *element } tokens := t.Tokens() var stack *element for _, token := range tokens { if token.begin == token.end { continue } node := &node32{token32: token} for stack != nil && stack.node.begin >= token.begin && stack.node.end <= token.end { stack.node.next = node.up node.up = stack.node stack = stack.down } stack = &element{node: node, down: stack} } if stack != nil { return stack.node } return nil } func (t *tokens32) PrintSyntaxTree(buffer string) { t.AST().Print(os.Stdout, buffer) } func (t *tokens32) WriteSyntaxTree(w io.Writer, buffer string) { t.AST().Print(w, buffer) } func (t *tokens32) PrettyPrintSyntaxTree(buffer string) { t.AST().PrettyPrint(os.Stdout, buffer) } func (t *tokens32) Add(rule pegRule, begin, end, index uint32) { tree, i := t.tree, int(index) if i >= len(tree) { t.tree = append(tree, token32{pegRule: rule, begin: begin, end: end}) return } tree[i] = token32{pegRule: rule, begin: begin, end: end} } func (t *tokens32) Tokens() []token32 { return t.tree } type PQL struct { Query Buffer string buffer []rune rules [96]func() bool parse func(rule ...int) error reset func() Pretty bool tokens32 } func (p *PQL) Parse(rule ...int) error { return p.parse(rule...) } func (p *PQL) Reset() { p.reset() } type textPosition struct { line, symbol int } type textPositionMap map[int]textPosition func translatePositions(buffer []rune, positions []int) textPositionMap { length, translations, j, line, symbol := len(positions), make(textPositionMap, len(positions)), 0, 1, 0 sort.Ints(positions) search: for i, c := range buffer { if c == '\n' { line, symbol = line+1, 0 } else { symbol++ } if i == positions[j] { translations[positions[j]] = textPosition{line, symbol} for j++; j < length; j++ { if i != positions[j] { continue search } } break search } } return translations } type parseError struct { p *PQL max token32 } func (e *parseError) Error() string { tokens, err := []token32{e.max}, "\n" positions, p := make([]int, 2*len(tokens)), 0 for _, token := range tokens { positions[p], p = int(token.begin), p+1 positions[p], p = int(token.end), p+1 } translations := translatePositions(e.p.buffer, positions) format := "parse error near %v (line %v symbol %v - line %v symbol %v):\n%v\n" if e.p.Pretty { format = "parse error near \x1B[34m%v\x1B[m (line %v symbol %v - line %v symbol %v):\n%v\n" } for _, token := range tokens { begin, end := int(token.begin), int(token.end) err += fmt.Sprintf(format, rul3s[token.pegRule], translations[begin].line, translations[begin].symbol, translations[end].line, translations[end].symbol, strconv.Quote(string(e.p.buffer[begin:end]))) } return err } func (p *PQL) PrintSyntaxTree() { if p.Pretty { p.tokens32.PrettyPrintSyntaxTree(p.Buffer) } else { p.tokens32.PrintSyntaxTree(p.Buffer) } } func (p *PQL) WriteSyntaxTree(w io.Writer) { p.tokens32.WriteSyntaxTree(w, p.Buffer) } func (p *PQL) Execute() { buffer, _buffer, text, begin, end := p.Buffer, p.buffer, "", 0, 0 for _, token := range p.Tokens() { switch token.pegRule { case rulePegText: begin, end = int(token.begin), int(token.end) text = string(_buffer[begin:end]) case ruleAction0: p.startCall("Set") case ruleAction1: p.endCall() case ruleAction2: p.startCall("SetRowAttrs") case ruleAction3: p.endCall() case ruleAction4: p.startCall("SetColumnAttrs") case ruleAction5: p.endCall() case ruleAction6: p.startCall("Clear") case ruleAction7: p.endCall() case ruleAction8: p.startCall("ClearRow") case ruleAction9: p.endCall() case ruleAction10: p.startCall("Store") case ruleAction11: p.endCall() case ruleAction12: p.startCall("TopN") case ruleAction13: p.endCall() case ruleAction14: p.startCall("TopK") case ruleAction15: p.endCall() case ruleAction16: p.startCall("Rows") case ruleAction17: p.endCall() case ruleAction18: p.startCall("Range") case ruleAction19: p.addField("from") case ruleAction20: p.addVal(text) case ruleAction21: p.addField("to") case ruleAction22: p.addVal(text) case ruleAction23: p.endCall() case ruleAction24: p.startCall(text) case ruleAction25: p.endCall() case ruleAction26: p.addBTWN() case ruleAction27: p.addLTE() case ruleAction28: p.addGTE() case ruleAction29: p.addEQ() case ruleAction30: p.addNEQ() case ruleAction31: p.addLT() case ruleAction32: p.addGT() case ruleAction33: p.startConditional() case ruleAction34: p.endConditional() case ruleAction35: p.condAdd(text) case ruleAction36: p.condAdd(text) case ruleAction37: p.condAdd(text) case ruleAction38: p.startList() case ruleAction39: p.endList() case ruleAction40: p.addVal(nil) case ruleAction41: p.addVal(true) case ruleAction42: p.addVal(false) case ruleAction43: p.addVal(text) case ruleAction44: p.addNumVal(text) case ruleAction45: p.startCall(text) case ruleAction46: p.addVal(p.endCall()) case ruleAction47: p.addVal(text) case ruleAction48: p.addVal(text) case ruleAction49: p.addVal(text) case ruleAction50: p.addField(text) case ruleAction51: p.addPosStr("_field", text) case ruleAction52: p.addPosNum("_col", text) case ruleAction53: p.addPosStr("_col", text) case ruleAction54: p.addPosStr("_col", text) case ruleAction55: p.addPosNum("_row", text) case ruleAction56: p.addPosStr("_row", text) case ruleAction57: p.addPosStr("_row", text) case ruleAction58: p.addPosStr("_timestamp", text) } } _, _, _, _, _ = buffer, _buffer, text, begin, end } func Pretty(pretty bool) func(*PQL) error { return func(p *PQL) error { p.Pretty = pretty return nil } } func Size(size int) func(*PQL) error { return func(p *PQL) error { p.tokens32 = tokens32{tree: make([]token32, 0, size)} return nil } } func (p *PQL) Init(options ...func(*PQL) error) error { var ( max token32 position, tokenIndex uint32 buffer []rune ) for _, option := range options { err := option(p) if err != nil { return err } } p.reset = func() { max = token32{} position, tokenIndex = 0, 0 p.buffer = []rune(p.Buffer) if len(p.buffer) == 0 || p.buffer[len(p.buffer)-1] != endSymbol { p.buffer = append(p.buffer, endSymbol) } buffer = p.buffer } p.reset() _rules := p.rules tree := p.tokens32 p.parse = func(rule ...int) error { r := 1 if len(rule) > 0 { r = rule[0] } matches := p.rules[r]() p.tokens32 = tree if matches { p.Trim(tokenIndex) return nil } return &parseError{p, max} } add := func(rule pegRule, begin uint32) { tree.Add(rule, begin, position, tokenIndex) tokenIndex++ if begin != position && position > max.end { max = token32{rule, begin, position} } } matchDot := func() bool { if buffer[position] != endSymbol { position++ return true } return false } /*matchChar := func(c byte) bool { if buffer[position] == c { position++ return true } return false }*/ /*matchRange := func(lower byte, upper byte) bool { if c := buffer[position]; c >= lower && c <= upper { position++ return true } return false }*/ _rules = [...]func() bool{ nil, /* 0 Calls <- <(sp (Call sp)* !.)> */ func() bool { position0, tokenIndex0 := position, tokenIndex { position1 := position if !_rules[rulesp]() { goto l0 } l2: { position3, tokenIndex3 := position, tokenIndex if !_rules[ruleCall]() { goto l3 } if !_rules[rulesp]() { goto l3 } goto l2 l3: position, tokenIndex = position3, tokenIndex3 } { position4, tokenIndex4 := position, tokenIndex if !matchDot() { goto l4 } goto l0 l4: position, tokenIndex = position4, tokenIndex4 } add(ruleCalls, position1) } return true l0: position, tokenIndex = position0, tokenIndex0 return false }, /* 1 Call <- <((('s' / 'S') ('e' / 'E') ('t' / 'T') Action0 open col comma args (comma timestamp)? close Action1) / (('s' / 'S') ('e' / 'E') ('t' / 'T') ('r' / 'R') ('o' / 'O') ('w' / 'W') ('a' / 'A') ('t' / 'T') ('t' / 'T') ('r' / 'R') ('s' / 'S') Action2 open posfield comma row comma args close Action3) / (('s' / 'S') ('e' / 'E') ('t' / 'T') ('c' / 'C') ('o' / 'O') ('l' / 'L') ('u' / 'U') ('m' / 'M') ('n' / 'N') ('a' / 'A') ('t' / 'T') ('t' / 'T') ('r' / 'R') ('s' / 'S') Action4 open col comma args close Action5) / (('c' / 'C') ('l' / 'L') ('e' / 'E') ('a' / 'A') ('r' / 'R') Action6 open col comma args close Action7) / (('c' / 'C') ('l' / 'L') ('e' / 'E') ('a' / 'A') ('r' / 'R') ('r' / 'R') ('o' / 'O') ('w' / 'W') Action8 open arg close Action9) / (('s' / 'S') ('t' / 'T') ('o' / 'O') ('r' / 'R') ('e' / 'E') Action10 open Call comma arg close Action11) / (('t' / 'T') ('o' / 'O') ('p' / 'P') ('n' / 'N') Action12 open posfield (comma allargs)? close Action13) / (('t' / 'T') ('o' / 'O') ('p' / 'P') ('k' / 'K') Action14 open posfield (comma allargs)? close Action15) / (('r' / 'R') ('o' / 'O') ('w' / 'W') ('s' / 'S') Action16 open posfield (comma allargs)? close Action17) / (('r' / 'R') ('a' / 'A') ('n' / 'N') ('g' / 'G') ('e' / 'E') Action18 open field eq value comma ('f' 'r' 'o' 'm' '=')? Action19 timestampfmt Action20 comma ('t' 'o' '=')? sp Action21 timestampfmt Action22 close Action23) / ( Action24 open allargs comma? close Action25))> */ func() bool { position5, tokenIndex5 := position, tokenIndex { position6 := position { position7, tokenIndex7 := position, tokenIndex { position9, tokenIndex9 := position, tokenIndex if buffer[position] != rune('s') { goto l10 } position++ goto l9 l10: position, tokenIndex = position9, tokenIndex9 if buffer[position] != rune('S') { goto l8 } position++ } l9: { position11, tokenIndex11 := position, tokenIndex if buffer[position] != rune('e') { goto l12 } position++ goto l11 l12: position, tokenIndex = position11, tokenIndex11 if buffer[position] != rune('E') { goto l8 } position++ } l11: { position13, tokenIndex13 := position, tokenIndex if buffer[position] != rune('t') { goto l14 } position++ goto l13 l14: position, tokenIndex = position13, tokenIndex13 if buffer[position] != rune('T') { goto l8 } position++ } l13: { add(ruleAction0, position) } if !_rules[ruleopen]() { goto l8 } if !_rules[rulecol]() { goto l8 } if !_rules[rulecomma]() { goto l8 } if !_rules[ruleargs]() { goto l8 } { position16, tokenIndex16 := position, tokenIndex if !_rules[rulecomma]() { goto l16 } { position18 := position { position19 := position if !_rules[ruletimestampfmt]() { goto l16 } add(rulePegText, position19) } { add(ruleAction58, position) } add(ruletimestamp, position18) } goto l17 l16: position, tokenIndex = position16, tokenIndex16 } l17: if !_rules[ruleclose]() { goto l8 } { add(ruleAction1, position) } goto l7 l8: position, tokenIndex = position7, tokenIndex7 { position23, tokenIndex23 := position, tokenIndex if buffer[position] != rune('s') { goto l24 } position++ goto l23 l24: position, tokenIndex = position23, tokenIndex23 if buffer[position] != rune('S') { goto l22 } position++ } l23: { position25, tokenIndex25 := position, tokenIndex if buffer[position] != rune('e') { goto l26 } position++ goto l25 l26: position, tokenIndex = position25, tokenIndex25 if buffer[position] != rune('E') { goto l22 } position++ } l25: { position27, tokenIndex27 := position, tokenIndex if buffer[position] != rune('t') { goto l28 } position++ goto l27 l28: position, tokenIndex = position27, tokenIndex27 if buffer[position] != rune('T') { goto l22 } position++ } l27: { position29, tokenIndex29 := position, tokenIndex if buffer[position] != rune('r') { goto l30 } position++ goto l29 l30: position, tokenIndex = position29, tokenIndex29 if buffer[position] != rune('R') { goto l22 } position++ } l29: { position31, tokenIndex31 := position, tokenIndex if buffer[position] != rune('o') { goto l32 } position++ goto l31 l32: position, tokenIndex = position31, tokenIndex31 if buffer[position] != rune('O') { goto l22 } position++ } l31: { position33, tokenIndex33 := position, tokenIndex if buffer[position] != rune('w') { goto l34 } position++ goto l33 l34: position, tokenIndex = position33, tokenIndex33 if buffer[position] != rune('W') { goto l22 } position++ } l33: { position35, tokenIndex35 := position, tokenIndex if buffer[position] != rune('a') { goto l36 } position++ goto l35 l36: position, tokenIndex = position35, tokenIndex35 if buffer[position] != rune('A') { goto l22 } position++ } l35: { position37, tokenIndex37 := position, tokenIndex if buffer[position] != rune('t') { goto l38 } position++ goto l37 l38: position, tokenIndex = position37, tokenIndex37 if buffer[position] != rune('T') { goto l22 } position++ } l37: { position39, tokenIndex39 := position, tokenIndex if buffer[position] != rune('t') { goto l40 } position++ goto l39 l40: position, tokenIndex = position39, tokenIndex39 if buffer[position] != rune('T') { goto l22 } position++ } l39: { position41, tokenIndex41 := position, tokenIndex if buffer[position] != rune('r') { goto l42 } position++ goto l41 l42: position, tokenIndex = position41, tokenIndex41 if buffer[position] != rune('R') { goto l22 } position++ } l41: { position43, tokenIndex43 := position, tokenIndex if buffer[position] != rune('s') { goto l44 } position++ goto l43 l44: position, tokenIndex = position43, tokenIndex43 if buffer[position] != rune('S') { goto l22 } position++ } l43: { add(ruleAction2, position) } if !_rules[ruleopen]() { goto l22 } if !_rules[ruleposfield]() { goto l22 } if !_rules[rulecomma]() { goto l22 } { position46 := position { position47, tokenIndex47 := position, tokenIndex { position49 := position if !_rules[ruledigits]() { goto l48 } add(rulePegText, position49) } { add(ruleAction55, position) } goto l47 l48: position, tokenIndex = position47, tokenIndex47 { position52 := position if buffer[position] != rune('\'') { goto l51 } position++ if !_rules[rulesinglequotedstring]() { goto l51 } if buffer[position] != rune('\'') { goto l51 } position++ add(rulePegText, position52) } { add(ruleAction56, position) } goto l47 l51: position, tokenIndex = position47, tokenIndex47 { position54 := position if buffer[position] != rune('"') { goto l22 } position++ if !_rules[ruledoublequotedstring]() { goto l22 } if buffer[position] != rune('"') { goto l22 } position++ add(rulePegText, position54) } { add(ruleAction57, position) } } l47: add(rulerow, position46) } if !_rules[rulecomma]() { goto l22 } if !_rules[ruleargs]() { goto l22 } if !_rules[ruleclose]() { goto l22 } { add(ruleAction3, position) } goto l7 l22: position, tokenIndex = position7, tokenIndex7 { position58, tokenIndex58 := position, tokenIndex if buffer[position] != rune('s') { goto l59 } position++ goto l58 l59: position, tokenIndex = position58, tokenIndex58 if buffer[position] != rune('S') { goto l57 } position++ } l58: { position60, tokenIndex60 := position, tokenIndex if buffer[position] != rune('e') { goto l61 } position++ goto l60 l61: position, tokenIndex = position60, tokenIndex60 if buffer[position] != rune('E') { goto l57 } position++ } l60: { position62, tokenIndex62 := position, tokenIndex if buffer[position] != rune('t') { goto l63 } position++ goto l62 l63: position, tokenIndex = position62, tokenIndex62 if buffer[position] != rune('T') { goto l57 } position++ } l62: { position64, tokenIndex64 := position, tokenIndex if buffer[position] != rune('c') { goto l65 } position++ goto l64 l65: position, tokenIndex = position64, tokenIndex64 if buffer[position] != rune('C') { goto l57 } position++ } l64: { position66, tokenIndex66 := position, tokenIndex if buffer[position] != rune('o') { goto l67 } position++ goto l66 l67: position, tokenIndex = position66, tokenIndex66 if buffer[position] != rune('O') { goto l57 } position++ } l66: { position68, tokenIndex68 := position, tokenIndex if buffer[position] != rune('l') { goto l69 } position++ goto l68 l69: position, tokenIndex = position68, tokenIndex68 if buffer[position] != rune('L') { goto l57 } position++ } l68: { position70, tokenIndex70 := position, tokenIndex if buffer[position] != rune('u') { goto l71 } position++ goto l70 l71: position, tokenIndex = position70, tokenIndex70 if buffer[position] != rune('U') { goto l57 } position++ } l70: { position72, tokenIndex72 := position, tokenIndex if buffer[position] != rune('m') { goto l73 } position++ goto l72 l73: position, tokenIndex = position72, tokenIndex72 if buffer[position] != rune('M') { goto l57 } position++ } l72: { position74, tokenIndex74 := position, tokenIndex if buffer[position] != rune('n') { goto l75 } position++ goto l74 l75: position, tokenIndex = position74, tokenIndex74 if buffer[position] != rune('N') { goto l57 } position++ } l74: { position76, tokenIndex76 := position, tokenIndex if buffer[position] != rune('a') { goto l77 } position++ goto l76 l77: position, tokenIndex = position76, tokenIndex76 if buffer[position] != rune('A') { goto l57 } position++ } l76: { position78, tokenIndex78 := position, tokenIndex if buffer[position] != rune('t') { goto l79 } position++ goto l78 l79: position, tokenIndex = position78, tokenIndex78 if buffer[position] != rune('T') { goto l57 } position++ } l78: { position80, tokenIndex80 := position, tokenIndex if buffer[position] != rune('t') { goto l81 } position++ goto l80 l81: position, tokenIndex = position80, tokenIndex80 if buffer[position] != rune('T') { goto l57 } position++ } l80: { position82, tokenIndex82 := position, tokenIndex if buffer[position] != rune('r') { goto l83 } position++ goto l82 l83: position, tokenIndex = position82, tokenIndex82 if buffer[position] != rune('R') { goto l57 } position++ } l82: { position84, tokenIndex84 := position, tokenIndex if buffer[position] != rune('s') { goto l85 } position++ goto l84 l85: position, tokenIndex = position84, tokenIndex84 if buffer[position] != rune('S') { goto l57 } position++ } l84: { add(ruleAction4, position) } if !_rules[ruleopen]() { goto l57 } if !_rules[rulecol]() { goto l57 } if !_rules[rulecomma]() { goto l57 } if !_rules[ruleargs]() { goto l57 } if !_rules[ruleclose]() { goto l57 } { add(ruleAction5, position) } goto l7 l57: position, tokenIndex = position7, tokenIndex7 { position89, tokenIndex89 := position, tokenIndex if buffer[position] != rune('c') { goto l90 } position++ goto l89 l90: position, tokenIndex = position89, tokenIndex89 if buffer[position] != rune('C') { goto l88 } position++ } l89: { position91, tokenIndex91 := position, tokenIndex if buffer[position] != rune('l') { goto l92 } position++ goto l91 l92: position, tokenIndex = position91, tokenIndex91 if buffer[position] != rune('L') { goto l88 } position++ } l91: { position93, tokenIndex93 := position, tokenIndex if buffer[position] != rune('e') { goto l94 } position++ goto l93 l94: position, tokenIndex = position93, tokenIndex93 if buffer[position] != rune('E') { goto l88 } position++ } l93: { position95, tokenIndex95 := position, tokenIndex if buffer[position] != rune('a') { goto l96 } position++ goto l95 l96: position, tokenIndex = position95, tokenIndex95 if buffer[position] != rune('A') { goto l88 } position++ } l95: { position97, tokenIndex97 := position, tokenIndex if buffer[position] != rune('r') { goto l98 } position++ goto l97 l98: position, tokenIndex = position97, tokenIndex97 if buffer[position] != rune('R') { goto l88 } position++ } l97: { add(ruleAction6, position) } if !_rules[ruleopen]() { goto l88 } if !_rules[rulecol]() { goto l88 } if !_rules[rulecomma]() { goto l88 } if !_rules[ruleargs]() { goto l88 } if !_rules[ruleclose]() { goto l88 } { add(ruleAction7, position) } goto l7 l88: position, tokenIndex = position7, tokenIndex7 { position102, tokenIndex102 := position, tokenIndex if buffer[position] != rune('c') { goto l103 } position++ goto l102 l103: position, tokenIndex = position102, tokenIndex102 if buffer[position] != rune('C') { goto l101 } position++ } l102: { position104, tokenIndex104 := position, tokenIndex if buffer[position] != rune('l') { goto l105 } position++ goto l104 l105: position, tokenIndex = position104, tokenIndex104 if buffer[position] != rune('L') { goto l101 } position++ } l104: { position106, tokenIndex106 := position, tokenIndex if buffer[position] != rune('e') { goto l107 } position++ goto l106 l107: position, tokenIndex = position106, tokenIndex106 if buffer[position] != rune('E') { goto l101 } position++ } l106: { position108, tokenIndex108 := position, tokenIndex if buffer[position] != rune('a') { goto l109 } position++ goto l108 l109: position, tokenIndex = position108, tokenIndex108 if buffer[position] != rune('A') { goto l101 } position++ } l108: { position110, tokenIndex110 := position, tokenIndex if buffer[position] != rune('r') { goto l111 } position++ goto l110 l111: position, tokenIndex = position110, tokenIndex110 if buffer[position] != rune('R') { goto l101 } position++ } l110: { position112, tokenIndex112 := position, tokenIndex if buffer[position] != rune('r') { goto l113 } position++ goto l112 l113: position, tokenIndex = position112, tokenIndex112 if buffer[position] != rune('R') { goto l101 } position++ } l112: { position114, tokenIndex114 := position, tokenIndex if buffer[position] != rune('o') { goto l115 } position++ goto l114 l115: position, tokenIndex = position114, tokenIndex114 if buffer[position] != rune('O') { goto l101 } position++ } l114: { position116, tokenIndex116 := position, tokenIndex if buffer[position] != rune('w') { goto l117 } position++ goto l116 l117: position, tokenIndex = position116, tokenIndex116 if buffer[position] != rune('W') { goto l101 } position++ } l116: { add(ruleAction8, position) } if !_rules[ruleopen]() { goto l101 } if !_rules[rulearg]() { goto l101 } if !_rules[ruleclose]() { goto l101 } { add(ruleAction9, position) } goto l7 l101: position, tokenIndex = position7, tokenIndex7 { position121, tokenIndex121 := position, tokenIndex if buffer[position] != rune('s') { goto l122 } position++ goto l121 l122: position, tokenIndex = position121, tokenIndex121 if buffer[position] != rune('S') { goto l120 } position++ } l121: { position123, tokenIndex123 := position, tokenIndex if buffer[position] != rune('t') { goto l124 } position++ goto l123 l124: position, tokenIndex = position123, tokenIndex123 if buffer[position] != rune('T') { goto l120 } position++ } l123: { position125, tokenIndex125 := position, tokenIndex if buffer[position] != rune('o') { goto l126 } position++ goto l125 l126: position, tokenIndex = position125, tokenIndex125 if buffer[position] != rune('O') { goto l120 } position++ } l125: { position127, tokenIndex127 := position, tokenIndex if buffer[position] != rune('r') { goto l128 } position++ goto l127 l128: position, tokenIndex = position127, tokenIndex127 if buffer[position] != rune('R') { goto l120 } position++ } l127: { position129, tokenIndex129 := position, tokenIndex if buffer[position] != rune('e') { goto l130 } position++ goto l129 l130: position, tokenIndex = position129, tokenIndex129 if buffer[position] != rune('E') { goto l120 } position++ } l129: { add(ruleAction10, position) } if !_rules[ruleopen]() { goto l120 } if !_rules[ruleCall]() { goto l120 } if !_rules[rulecomma]() { goto l120 } if !_rules[rulearg]() { goto l120 } if !_rules[ruleclose]() { goto l120 } { add(ruleAction11, position) } goto l7 l120: position, tokenIndex = position7, tokenIndex7 { position134, tokenIndex134 := position, tokenIndex if buffer[position] != rune('t') { goto l135 } position++ goto l134 l135: position, tokenIndex = position134, tokenIndex134 if buffer[position] != rune('T') { goto l133 } position++ } l134: { position136, tokenIndex136 := position, tokenIndex if buffer[position] != rune('o') { goto l137 } position++ goto l136 l137: position, tokenIndex = position136, tokenIndex136 if buffer[position] != rune('O') { goto l133 } position++ } l136: { position138, tokenIndex138 := position, tokenIndex if buffer[position] != rune('p') { goto l139 } position++ goto l138 l139: position, tokenIndex = position138, tokenIndex138 if buffer[position] != rune('P') { goto l133 } position++ } l138: { position140, tokenIndex140 := position, tokenIndex if buffer[position] != rune('n') { goto l141 } position++ goto l140 l141: position, tokenIndex = position140, tokenIndex140 if buffer[position] != rune('N') { goto l133 } position++ } l140: { add(ruleAction12, position) } if !_rules[ruleopen]() { goto l133 } if !_rules[ruleposfield]() { goto l133 } { position143, tokenIndex143 := position, tokenIndex if !_rules[rulecomma]() { goto l143 } if !_rules[ruleallargs]() { goto l143 } goto l144 l143: position, tokenIndex = position143, tokenIndex143 } l144: if !_rules[ruleclose]() { goto l133 } { add(ruleAction13, position) } goto l7 l133: position, tokenIndex = position7, tokenIndex7 { position147, tokenIndex147 := position, tokenIndex if buffer[position] != rune('t') { goto l148 } position++ goto l147 l148: position, tokenIndex = position147, tokenIndex147 if buffer[position] != rune('T') { goto l146 } position++ } l147: { position149, tokenIndex149 := position, tokenIndex if buffer[position] != rune('o') { goto l150 } position++ goto l149 l150: position, tokenIndex = position149, tokenIndex149 if buffer[position] != rune('O') { goto l146 } position++ } l149: { position151, tokenIndex151 := position, tokenIndex if buffer[position] != rune('p') { goto l152 } position++ goto l151 l152: position, tokenIndex = position151, tokenIndex151 if buffer[position] != rune('P') { goto l146 } position++ } l151: { position153, tokenIndex153 := position, tokenIndex if buffer[position] != rune('k') { goto l154 } position++ goto l153 l154: position, tokenIndex = position153, tokenIndex153 if buffer[position] != rune('K') { goto l146 } position++ } l153: { add(ruleAction14, position) } if !_rules[ruleopen]() { goto l146 } if !_rules[ruleposfield]() { goto l146 } { position156, tokenIndex156 := position, tokenIndex if !_rules[rulecomma]() { goto l156 } if !_rules[ruleallargs]() { goto l156 } goto l157 l156: position, tokenIndex = position156, tokenIndex156 } l157: if !_rules[ruleclose]() { goto l146 } { add(ruleAction15, position) } goto l7 l146: position, tokenIndex = position7, tokenIndex7 { position160, tokenIndex160 := position, tokenIndex if buffer[position] != rune('r') { goto l161 } position++ goto l160 l161: position, tokenIndex = position160, tokenIndex160 if buffer[position] != rune('R') { goto l159 } position++ } l160: { position162, tokenIndex162 := position, tokenIndex if buffer[position] != rune('o') { goto l163 } position++ goto l162 l163: position, tokenIndex = position162, tokenIndex162 if buffer[position] != rune('O') { goto l159 } position++ } l162: { position164, tokenIndex164 := position, tokenIndex if buffer[position] != rune('w') { goto l165 } position++ goto l164 l165: position, tokenIndex = position164, tokenIndex164 if buffer[position] != rune('W') { goto l159 } position++ } l164: { position166, tokenIndex166 := position, tokenIndex if buffer[position] != rune('s') { goto l167 } position++ goto l166 l167: position, tokenIndex = position166, tokenIndex166 if buffer[position] != rune('S') { goto l159 } position++ } l166: { add(ruleAction16, position) } if !_rules[ruleopen]() { goto l159 } if !_rules[ruleposfield]() { goto l159 } { position169, tokenIndex169 := position, tokenIndex if !_rules[rulecomma]() { goto l169 } if !_rules[ruleallargs]() { goto l169 } goto l170 l169: position, tokenIndex = position169, tokenIndex169 } l170: if !_rules[ruleclose]() { goto l159 } { add(ruleAction17, position) } goto l7 l159: position, tokenIndex = position7, tokenIndex7 { position173, tokenIndex173 := position, tokenIndex if buffer[position] != rune('r') { goto l174 } position++ goto l173 l174: position, tokenIndex = position173, tokenIndex173 if buffer[position] != rune('R') { goto l172 } position++ } l173: { position175, tokenIndex175 := position, tokenIndex if buffer[position] != rune('a') { goto l176 } position++ goto l175 l176: position, tokenIndex = position175, tokenIndex175 if buffer[position] != rune('A') { goto l172 } position++ } l175: { position177, tokenIndex177 := position, tokenIndex if buffer[position] != rune('n') { goto l178 } position++ goto l177 l178: position, tokenIndex = position177, tokenIndex177 if buffer[position] != rune('N') { goto l172 } position++ } l177: { position179, tokenIndex179 := position, tokenIndex if buffer[position] != rune('g') { goto l180 } position++ goto l179 l180: position, tokenIndex = position179, tokenIndex179 if buffer[position] != rune('G') { goto l172 } position++ } l179: { position181, tokenIndex181 := position, tokenIndex if buffer[position] != rune('e') { goto l182 } position++ goto l181 l182: position, tokenIndex = position181, tokenIndex181 if buffer[position] != rune('E') { goto l172 } position++ } l181: { add(ruleAction18, position) } if !_rules[ruleopen]() { goto l172 } if !_rules[rulefield]() { goto l172 } if !_rules[ruleeq]() { goto l172 } if !_rules[rulevalue]() { goto l172 } if !_rules[rulecomma]() { goto l172 } { position184, tokenIndex184 := position, tokenIndex if buffer[position] != rune('f') { goto l184 } position++ if buffer[position] != rune('r') { goto l184 } position++ if buffer[position] != rune('o') { goto l184 } position++ if buffer[position] != rune('m') { goto l184 } position++ if buffer[position] != rune('=') { goto l184 } position++ goto l185 l184: position, tokenIndex = position184, tokenIndex184 } l185: { add(ruleAction19, position) } if !_rules[ruletimestampfmt]() { goto l172 } { add(ruleAction20, position) } if !_rules[rulecomma]() { goto l172 } { position188, tokenIndex188 := position, tokenIndex if buffer[position] != rune('t') { goto l188 } position++ if buffer[position] != rune('o') { goto l188 } position++ if buffer[position] != rune('=') { goto l188 } position++ goto l189 l188: position, tokenIndex = position188, tokenIndex188 } l189: if !_rules[rulesp]() { goto l172 } { add(ruleAction21, position) } if !_rules[ruletimestampfmt]() { goto l172 } { add(ruleAction22, position) } if !_rules[ruleclose]() { goto l172 } { add(ruleAction23, position) } goto l7 l172: position, tokenIndex = position7, tokenIndex7 { position193 := position if !_rules[ruleIDENT]() { goto l5 } add(rulePegText, position193) } { add(ruleAction24, position) } if !_rules[ruleopen]() { goto l5 } if !_rules[ruleallargs]() { goto l5 } { position195, tokenIndex195 := position, tokenIndex if !_rules[rulecomma]() { goto l195 } goto l196 l195: position, tokenIndex = position195, tokenIndex195 } l196: if !_rules[ruleclose]() { goto l5 } { add(ruleAction25, position) } } l7: add(ruleCall, position6) } return true l5: position, tokenIndex = position5, tokenIndex5 return false }, /* 2 allargs <- <((Call (comma Call)* (comma args)?) / args / sp)> */ func() bool { position198, tokenIndex198 := position, tokenIndex { position199 := position { position200, tokenIndex200 := position, tokenIndex if !_rules[ruleCall]() { goto l201 } l202: { position203, tokenIndex203 := position, tokenIndex if !_rules[rulecomma]() { goto l203 } if !_rules[ruleCall]() { goto l203 } goto l202 l203: position, tokenIndex = position203, tokenIndex203 } { position204, tokenIndex204 := position, tokenIndex if !_rules[rulecomma]() { goto l204 } if !_rules[ruleargs]() { goto l204 } goto l205 l204: position, tokenIndex = position204, tokenIndex204 } l205: goto l200 l201: position, tokenIndex = position200, tokenIndex200 if !_rules[ruleargs]() { goto l206 } goto l200 l206: position, tokenIndex = position200, tokenIndex200 if !_rules[rulesp]() { goto l198 } } l200: add(ruleallargs, position199) } return true l198: position, tokenIndex = position198, tokenIndex198 return false }, /* 3 args <- <(arg (comma args)? sp)> */ func() bool { position207, tokenIndex207 := position, tokenIndex { position208 := position if !_rules[rulearg]() { goto l207 } { position209, tokenIndex209 := position, tokenIndex if !_rules[rulecomma]() { goto l209 } if !_rules[ruleargs]() { goto l209 } goto l210 l209: position, tokenIndex = position209, tokenIndex209 } l210: if !_rules[rulesp]() { goto l207 } add(ruleargs, position208) } return true l207: position, tokenIndex = position207, tokenIndex207 return false }, /* 4 arg <- <((field eq value) / (field sp COND sp value) / conditional)> */ func() bool { position211, tokenIndex211 := position, tokenIndex { position212 := position { position213, tokenIndex213 := position, tokenIndex if !_rules[rulefield]() { goto l214 } if !_rules[ruleeq]() { goto l214 } if !_rules[rulevalue]() { goto l214 } goto l213 l214: position, tokenIndex = position213, tokenIndex213 if !_rules[rulefield]() { goto l215 } if !_rules[rulesp]() { goto l215 } { position216 := position { position217, tokenIndex217 := position, tokenIndex if buffer[position] != rune('>') { goto l218 } position++ if buffer[position] != rune('<') { goto l218 } position++ { add(ruleAction26, position) } goto l217 l218: position, tokenIndex = position217, tokenIndex217 if buffer[position] != rune('<') { goto l220 } position++ if buffer[position] != rune('=') { goto l220 } position++ { add(ruleAction27, position) } goto l217 l220: position, tokenIndex = position217, tokenIndex217 if buffer[position] != rune('>') { goto l222 } position++ if buffer[position] != rune('=') { goto l222 } position++ { add(ruleAction28, position) } goto l217 l222: position, tokenIndex = position217, tokenIndex217 if buffer[position] != rune('=') { goto l224 } position++ if buffer[position] != rune('=') { goto l224 } position++ { add(ruleAction29, position) } goto l217 l224: position, tokenIndex = position217, tokenIndex217 if buffer[position] != rune('!') { goto l226 } position++ if buffer[position] != rune('=') { goto l226 } position++ { add(ruleAction30, position) } goto l217 l226: position, tokenIndex = position217, tokenIndex217 if buffer[position] != rune('<') { goto l228 } position++ { add(ruleAction31, position) } goto l217 l228: position, tokenIndex = position217, tokenIndex217 if buffer[position] != rune('>') { goto l215 } position++ { add(ruleAction32, position) } } l217: add(ruleCOND, position216) } if !_rules[rulesp]() { goto l215 } if !_rules[rulevalue]() { goto l215 } goto l213 l215: position, tokenIndex = position213, tokenIndex213 { position231 := position { add(ruleAction33, position) } if !_rules[rulecondint]() { goto l211 } if !_rules[rulecondLT]() { goto l211 } { position233 := position { position234 := position if !_rules[rulefieldExpr]() { goto l211 } add(rulePegText, position234) } if !_rules[rulesp]() { goto l211 } { add(ruleAction37, position) } add(rulecondfield, position233) } if !_rules[rulecondLT]() { goto l211 } if !_rules[rulecondint]() { goto l211 } { add(ruleAction34, position) } add(ruleconditional, position231) } } l213: add(rulearg, position212) } return true l211: position, tokenIndex = position211, tokenIndex211 return false }, /* 5 COND <- <(('>' '<' Action26) / ('<' '=' Action27) / ('>' '=' Action28) / ('=' '=' Action29) / ('!' '=' Action30) / ('<' Action31) / ('>' Action32))> */ nil, /* 6 conditional <- <(Action33 condint condLT condfield condLT condint Action34)> */ nil, /* 7 condint <- <( sp Action35)> */ func() bool { position239, tokenIndex239 := position, tokenIndex { position240 := position { position241 := position if !_rules[ruledecimal]() { goto l239 } add(rulePegText, position241) } if !_rules[rulesp]() { goto l239 } { add(ruleAction35, position) } add(rulecondint, position240) } return true l239: position, tokenIndex = position239, tokenIndex239 return false }, /* 8 condLT <- <(<(('<' '=') / '<')> sp Action36)> */ func() bool { position243, tokenIndex243 := position, tokenIndex { position244 := position { position245 := position { position246, tokenIndex246 := position, tokenIndex if buffer[position] != rune('<') { goto l247 } position++ if buffer[position] != rune('=') { goto l247 } position++ goto l246 l247: position, tokenIndex = position246, tokenIndex246 if buffer[position] != rune('<') { goto l243 } position++ } l246: add(rulePegText, position245) } if !_rules[rulesp]() { goto l243 } { add(ruleAction36, position) } add(rulecondLT, position244) } return true l243: position, tokenIndex = position243, tokenIndex243 return false }, /* 9 condfield <- <( sp Action37)> */ nil, /* 10 value <- <(item / (lbrack Action38 items rbrack Action39))> */ func() bool { position250, tokenIndex250 := position, tokenIndex { position251 := position { position252, tokenIndex252 := position, tokenIndex if !_rules[ruleitem]() { goto l253 } goto l252 l253: position, tokenIndex = position252, tokenIndex252 { position254 := position if buffer[position] != rune('[') { goto l250 } position++ if !_rules[rulesp]() { goto l250 } add(rulelbrack, position254) } { add(ruleAction38, position) } if !_rules[ruleitems]() { goto l250 } { position256 := position if !_rules[rulesp]() { goto l250 } if buffer[position] != rune(']') { goto l250 } position++ if !_rules[rulesp]() { goto l250 } add(rulerbrack, position256) } { add(ruleAction39, position) } } l252: add(rulevalue, position251) } return true l250: position, tokenIndex = position250, tokenIndex250 return false }, /* 11 items <- <(item (comma items)?)> */ func() bool { position258, tokenIndex258 := position, tokenIndex { position259 := position if !_rules[ruleitem]() { goto l258 } { position260, tokenIndex260 := position, tokenIndex if !_rules[rulecomma]() { goto l260 } if !_rules[ruleitems]() { goto l260 } goto l261 l260: position, tokenIndex = position260, tokenIndex260 } l261: add(ruleitems, position259) } return true l258: position, tokenIndex = position258, tokenIndex258 return false }, /* 12 item <- <(('n' 'u' 'l' 'l' &(comma / close) Action40) / ('t' 'r' 'u' 'e' &(comma / close) Action41) / ('f' 'a' 'l' 's' 'e' &(comma / close) Action42) / (timestampfmt Action43) / ( Action44) / ( Action45 open allargs comma? close Action46) / (<([a-z] / [A-Z] / [0-9] / '-' / '_' / ':')+> Action47) / (<('"' doublequotedstring '"')> Action48) / (<('\'' singlequotedstring '\'')> Action49))> */ func() bool { position262, tokenIndex262 := position, tokenIndex { position263 := position { position264, tokenIndex264 := position, tokenIndex if buffer[position] != rune('n') { goto l265 } position++ if buffer[position] != rune('u') { goto l265 } position++ if buffer[position] != rune('l') { goto l265 } position++ if buffer[position] != rune('l') { goto l265 } position++ { position266, tokenIndex266 := position, tokenIndex { position267, tokenIndex267 := position, tokenIndex if !_rules[rulecomma]() { goto l268 } goto l267 l268: position, tokenIndex = position267, tokenIndex267 if !_rules[ruleclose]() { goto l265 } } l267: position, tokenIndex = position266, tokenIndex266 } { add(ruleAction40, position) } goto l264 l265: position, tokenIndex = position264, tokenIndex264 if buffer[position] != rune('t') { goto l270 } position++ if buffer[position] != rune('r') { goto l270 } position++ if buffer[position] != rune('u') { goto l270 } position++ if buffer[position] != rune('e') { goto l270 } position++ { position271, tokenIndex271 := position, tokenIndex { position272, tokenIndex272 := position, tokenIndex if !_rules[rulecomma]() { goto l273 } goto l272 l273: position, tokenIndex = position272, tokenIndex272 if !_rules[ruleclose]() { goto l270 } } l272: position, tokenIndex = position271, tokenIndex271 } { add(ruleAction41, position) } goto l264 l270: position, tokenIndex = position264, tokenIndex264 if buffer[position] != rune('f') { goto l275 } position++ if buffer[position] != rune('a') { goto l275 } position++ if buffer[position] != rune('l') { goto l275 } position++ if buffer[position] != rune('s') { goto l275 } position++ if buffer[position] != rune('e') { goto l275 } position++ { position276, tokenIndex276 := position, tokenIndex { position277, tokenIndex277 := position, tokenIndex if !_rules[rulecomma]() { goto l278 } goto l277 l278: position, tokenIndex = position277, tokenIndex277 if !_rules[ruleclose]() { goto l275 } } l277: position, tokenIndex = position276, tokenIndex276 } { add(ruleAction42, position) } goto l264 l275: position, tokenIndex = position264, tokenIndex264 if !_rules[ruletimestampfmt]() { goto l280 } { add(ruleAction43, position) } goto l264 l280: position, tokenIndex = position264, tokenIndex264 { position283 := position if !_rules[ruledecimal]() { goto l282 } add(rulePegText, position283) } { add(ruleAction44, position) } goto l264 l282: position, tokenIndex = position264, tokenIndex264 { position286 := position if !_rules[ruleIDENT]() { goto l285 } add(rulePegText, position286) } { add(ruleAction45, position) } if !_rules[ruleopen]() { goto l285 } if !_rules[ruleallargs]() { goto l285 } { position288, tokenIndex288 := position, tokenIndex if !_rules[rulecomma]() { goto l288 } goto l289 l288: position, tokenIndex = position288, tokenIndex288 } l289: if !_rules[ruleclose]() { goto l285 } { add(ruleAction46, position) } goto l264 l285: position, tokenIndex = position264, tokenIndex264 { position292 := position { position295, tokenIndex295 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { goto l296 } position++ goto l295 l296: position, tokenIndex = position295, tokenIndex295 if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l297 } position++ goto l295 l297: position, tokenIndex = position295, tokenIndex295 if c := buffer[position]; c < rune('0') || c > rune('9') { goto l298 } position++ goto l295 l298: position, tokenIndex = position295, tokenIndex295 if buffer[position] != rune('-') { goto l299 } position++ goto l295 l299: position, tokenIndex = position295, tokenIndex295 if buffer[position] != rune('_') { goto l300 } position++ goto l295 l300: position, tokenIndex = position295, tokenIndex295 if buffer[position] != rune(':') { goto l291 } position++ } l295: l293: { position294, tokenIndex294 := position, tokenIndex { position301, tokenIndex301 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { goto l302 } position++ goto l301 l302: position, tokenIndex = position301, tokenIndex301 if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l303 } position++ goto l301 l303: position, tokenIndex = position301, tokenIndex301 if c := buffer[position]; c < rune('0') || c > rune('9') { goto l304 } position++ goto l301 l304: position, tokenIndex = position301, tokenIndex301 if buffer[position] != rune('-') { goto l305 } position++ goto l301 l305: position, tokenIndex = position301, tokenIndex301 if buffer[position] != rune('_') { goto l306 } position++ goto l301 l306: position, tokenIndex = position301, tokenIndex301 if buffer[position] != rune(':') { goto l294 } position++ } l301: goto l293 l294: position, tokenIndex = position294, tokenIndex294 } add(rulePegText, position292) } { add(ruleAction47, position) } goto l264 l291: position, tokenIndex = position264, tokenIndex264 { position309 := position if buffer[position] != rune('"') { goto l308 } position++ if !_rules[ruledoublequotedstring]() { goto l308 } if buffer[position] != rune('"') { goto l308 } position++ add(rulePegText, position309) } { add(ruleAction48, position) } goto l264 l308: position, tokenIndex = position264, tokenIndex264 { position311 := position if buffer[position] != rune('\'') { goto l262 } position++ if !_rules[rulesinglequotedstring]() { goto l262 } if buffer[position] != rune('\'') { goto l262 } position++ add(rulePegText, position311) } { add(ruleAction49, position) } } l264: add(ruleitem, position263) } return true l262: position, tokenIndex = position262, tokenIndex262 return false }, /* 13 doublequotedstring <- <(('\\' '"') / ('\\' '\\') / ('\\' 'n') / ('\\' 't') / (!('"' / '\\') .))*> */ func() bool { { position314 := position l315: { position316, tokenIndex316 := position, tokenIndex { position317, tokenIndex317 := position, tokenIndex if buffer[position] != rune('\\') { goto l318 } position++ if buffer[position] != rune('"') { goto l318 } position++ goto l317 l318: position, tokenIndex = position317, tokenIndex317 if buffer[position] != rune('\\') { goto l319 } position++ if buffer[position] != rune('\\') { goto l319 } position++ goto l317 l319: position, tokenIndex = position317, tokenIndex317 if buffer[position] != rune('\\') { goto l320 } position++ if buffer[position] != rune('n') { goto l320 } position++ goto l317 l320: position, tokenIndex = position317, tokenIndex317 if buffer[position] != rune('\\') { goto l321 } position++ if buffer[position] != rune('t') { goto l321 } position++ goto l317 l321: position, tokenIndex = position317, tokenIndex317 { position322, tokenIndex322 := position, tokenIndex { position323, tokenIndex323 := position, tokenIndex if buffer[position] != rune('"') { goto l324 } position++ goto l323 l324: position, tokenIndex = position323, tokenIndex323 if buffer[position] != rune('\\') { goto l322 } position++ } l323: goto l316 l322: position, tokenIndex = position322, tokenIndex322 } if !matchDot() { goto l316 } } l317: goto l315 l316: position, tokenIndex = position316, tokenIndex316 } add(ruledoublequotedstring, position314) } return true }, /* 14 singlequotedstring <- <(('\\' '\'') / ('\\' '\\') / ('\\' 'n') / ('\\' 't') / (!('\'' / '\\') .))*> */ func() bool { { position326 := position l327: { position328, tokenIndex328 := position, tokenIndex { position329, tokenIndex329 := position, tokenIndex if buffer[position] != rune('\\') { goto l330 } position++ if buffer[position] != rune('\'') { goto l330 } position++ goto l329 l330: position, tokenIndex = position329, tokenIndex329 if buffer[position] != rune('\\') { goto l331 } position++ if buffer[position] != rune('\\') { goto l331 } position++ goto l329 l331: position, tokenIndex = position329, tokenIndex329 if buffer[position] != rune('\\') { goto l332 } position++ if buffer[position] != rune('n') { goto l332 } position++ goto l329 l332: position, tokenIndex = position329, tokenIndex329 if buffer[position] != rune('\\') { goto l333 } position++ if buffer[position] != rune('t') { goto l333 } position++ goto l329 l333: position, tokenIndex = position329, tokenIndex329 { position334, tokenIndex334 := position, tokenIndex { position335, tokenIndex335 := position, tokenIndex if buffer[position] != rune('\'') { goto l336 } position++ goto l335 l336: position, tokenIndex = position335, tokenIndex335 if buffer[position] != rune('\\') { goto l334 } position++ } l335: goto l328 l334: position, tokenIndex = position334, tokenIndex334 } if !matchDot() { goto l328 } } l329: goto l327 l328: position, tokenIndex = position328, tokenIndex328 } add(rulesinglequotedstring, position326) } return true }, /* 15 fieldExpr <- <(([a-z] / [A-Z] / '_') ([a-z] / [A-Z] / [0-9] / '_' / '-')*)> */ func() bool { position337, tokenIndex337 := position, tokenIndex { position338 := position { position339, tokenIndex339 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { goto l340 } position++ goto l339 l340: position, tokenIndex = position339, tokenIndex339 if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l341 } position++ goto l339 l341: position, tokenIndex = position339, tokenIndex339 if buffer[position] != rune('_') { goto l337 } position++ } l339: l342: { position343, tokenIndex343 := position, tokenIndex { position344, tokenIndex344 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { goto l345 } position++ goto l344 l345: position, tokenIndex = position344, tokenIndex344 if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l346 } position++ goto l344 l346: position, tokenIndex = position344, tokenIndex344 if c := buffer[position]; c < rune('0') || c > rune('9') { goto l347 } position++ goto l344 l347: position, tokenIndex = position344, tokenIndex344 if buffer[position] != rune('_') { goto l348 } position++ goto l344 l348: position, tokenIndex = position344, tokenIndex344 if buffer[position] != rune('-') { goto l343 } position++ } l344: goto l342 l343: position, tokenIndex = position343, tokenIndex343 } add(rulefieldExpr, position338) } return true l337: position, tokenIndex = position337, tokenIndex337 return false }, /* 16 field <- <(<(fieldExpr / reserved)> Action50)> */ func() bool { position349, tokenIndex349 := position, tokenIndex { position350 := position { position351 := position { position352, tokenIndex352 := position, tokenIndex if !_rules[rulefieldExpr]() { goto l353 } goto l352 l353: position, tokenIndex = position352, tokenIndex352 { position354 := position { position355, tokenIndex355 := position, tokenIndex if buffer[position] != rune('_') { goto l356 } position++ if buffer[position] != rune('r') { goto l356 } position++ if buffer[position] != rune('o') { goto l356 } position++ if buffer[position] != rune('w') { goto l356 } position++ goto l355 l356: position, tokenIndex = position355, tokenIndex355 if buffer[position] != rune('_') { goto l357 } position++ if buffer[position] != rune('c') { goto l357 } position++ if buffer[position] != rune('o') { goto l357 } position++ if buffer[position] != rune('l') { goto l357 } position++ goto l355 l357: position, tokenIndex = position355, tokenIndex355 if buffer[position] != rune('_') { goto l358 } position++ if buffer[position] != rune('s') { goto l358 } position++ if buffer[position] != rune('t') { goto l358 } position++ if buffer[position] != rune('a') { goto l358 } position++ if buffer[position] != rune('r') { goto l358 } position++ if buffer[position] != rune('t') { goto l358 } position++ goto l355 l358: position, tokenIndex = position355, tokenIndex355 if buffer[position] != rune('_') { goto l359 } position++ if buffer[position] != rune('e') { goto l359 } position++ if buffer[position] != rune('n') { goto l359 } position++ if buffer[position] != rune('d') { goto l359 } position++ goto l355 l359: position, tokenIndex = position355, tokenIndex355 if buffer[position] != rune('_') { goto l360 } position++ if buffer[position] != rune('t') { goto l360 } position++ if buffer[position] != rune('i') { goto l360 } position++ if buffer[position] != rune('m') { goto l360 } position++ if buffer[position] != rune('e') { goto l360 } position++ if buffer[position] != rune('s') { goto l360 } position++ if buffer[position] != rune('t') { goto l360 } position++ if buffer[position] != rune('a') { goto l360 } position++ if buffer[position] != rune('m') { goto l360 } position++ if buffer[position] != rune('p') { goto l360 } position++ goto l355 l360: position, tokenIndex = position355, tokenIndex355 if buffer[position] != rune('_') { goto l349 } position++ if buffer[position] != rune('f') { goto l349 } position++ if buffer[position] != rune('i') { goto l349 } position++ if buffer[position] != rune('e') { goto l349 } position++ if buffer[position] != rune('l') { goto l349 } position++ if buffer[position] != rune('d') { goto l349 } position++ } l355: add(rulereserved, position354) } } l352: add(rulePegText, position351) } { add(ruleAction50, position) } add(rulefield, position350) } return true l349: position, tokenIndex = position349, tokenIndex349 return false }, /* 17 reserved <- <(('_' 'r' 'o' 'w') / ('_' 'c' 'o' 'l') / ('_' 's' 't' 'a' 'r' 't') / ('_' 'e' 'n' 'd') / ('_' 't' 'i' 'm' 'e' 's' 't' 'a' 'm' 'p') / ('_' 'f' 'i' 'e' 'l' 'd'))> */ nil, /* 18 posfield <- <( Action51)> */ func() bool { position363, tokenIndex363 := position, tokenIndex { position364 := position { position365 := position if !_rules[rulefieldExpr]() { goto l363 } add(rulePegText, position365) } { add(ruleAction51, position) } add(ruleposfield, position364) } return true l363: position, tokenIndex = position363, tokenIndex363 return false }, /* 19 col <- <(( Action52) / (<('\'' singlequotedstring '\'')> Action53) / (<('"' doublequotedstring '"')> Action54))> */ func() bool { position367, tokenIndex367 := position, tokenIndex { position368 := position { position369, tokenIndex369 := position, tokenIndex { position371 := position if !_rules[ruledigits]() { goto l370 } add(rulePegText, position371) } { add(ruleAction52, position) } goto l369 l370: position, tokenIndex = position369, tokenIndex369 { position374 := position if buffer[position] != rune('\'') { goto l373 } position++ if !_rules[rulesinglequotedstring]() { goto l373 } if buffer[position] != rune('\'') { goto l373 } position++ add(rulePegText, position374) } { add(ruleAction53, position) } goto l369 l373: position, tokenIndex = position369, tokenIndex369 { position376 := position if buffer[position] != rune('"') { goto l367 } position++ if !_rules[ruledoublequotedstring]() { goto l367 } if buffer[position] != rune('"') { goto l367 } position++ add(rulePegText, position376) } { add(ruleAction54, position) } } l369: add(rulecol, position368) } return true l367: position, tokenIndex = position367, tokenIndex367 return false }, /* 20 row <- <(( Action55) / (<('\'' singlequotedstring '\'')> Action56) / (<('"' doublequotedstring '"')> Action57))> */ nil, /* 21 open <- <('(' sp)> */ func() bool { position379, tokenIndex379 := position, tokenIndex { position380 := position if buffer[position] != rune('(') { goto l379 } position++ if !_rules[rulesp]() { goto l379 } add(ruleopen, position380) } return true l379: position, tokenIndex = position379, tokenIndex379 return false }, /* 22 close <- <(sp ')' sp)> */ func() bool { position381, tokenIndex381 := position, tokenIndex { position382 := position if !_rules[rulesp]() { goto l381 } if buffer[position] != rune(')') { goto l381 } position++ if !_rules[rulesp]() { goto l381 } add(ruleclose, position382) } return true l381: position, tokenIndex = position381, tokenIndex381 return false }, /* 23 sp <- <(' ' / '\t' / '\n')*> */ func() bool { { position384 := position l385: { position386, tokenIndex386 := position, tokenIndex { position387, tokenIndex387 := position, tokenIndex if buffer[position] != rune(' ') { goto l388 } position++ goto l387 l388: position, tokenIndex = position387, tokenIndex387 if buffer[position] != rune('\t') { goto l389 } position++ goto l387 l389: position, tokenIndex = position387, tokenIndex387 if buffer[position] != rune('\n') { goto l386 } position++ } l387: goto l385 l386: position, tokenIndex = position386, tokenIndex386 } add(rulesp, position384) } return true }, /* 24 eq <- <(sp '=' sp)> */ func() bool { position390, tokenIndex390 := position, tokenIndex { position391 := position if !_rules[rulesp]() { goto l390 } if buffer[position] != rune('=') { goto l390 } position++ if !_rules[rulesp]() { goto l390 } add(ruleeq, position391) } return true l390: position, tokenIndex = position390, tokenIndex390 return false }, /* 25 comma <- <(sp ',' sp)> */ func() bool { position392, tokenIndex392 := position, tokenIndex { position393 := position if !_rules[rulesp]() { goto l392 } if buffer[position] != rune(',') { goto l392 } position++ if !_rules[rulesp]() { goto l392 } add(rulecomma, position393) } return true l392: position, tokenIndex = position392, tokenIndex392 return false }, /* 26 lbrack <- <('[' sp)> */ nil, /* 27 rbrack <- <(sp ']' sp)> */ nil, /* 28 IDENT <- <(([a-z] / [A-Z]) ([a-z] / [A-Z] / [0-9])*)> */ func() bool { position396, tokenIndex396 := position, tokenIndex { position397 := position { position398, tokenIndex398 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { goto l399 } position++ goto l398 l399: position, tokenIndex = position398, tokenIndex398 if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l396 } position++ } l398: l400: { position401, tokenIndex401 := position, tokenIndex { position402, tokenIndex402 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { goto l403 } position++ goto l402 l403: position, tokenIndex = position402, tokenIndex402 if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l404 } position++ goto l402 l404: position, tokenIndex = position402, tokenIndex402 if c := buffer[position]; c < rune('0') || c > rune('9') { goto l401 } position++ } l402: goto l400 l401: position, tokenIndex = position401, tokenIndex401 } add(ruleIDENT, position397) } return true l396: position, tokenIndex = position396, tokenIndex396 return false }, /* 29 digits <- <[0-9]+> */ func() bool { position405, tokenIndex405 := position, tokenIndex { position406 := position if c := buffer[position]; c < rune('0') || c > rune('9') { goto l405 } position++ l407: { position408, tokenIndex408 := position, tokenIndex if c := buffer[position]; c < rune('0') || c > rune('9') { goto l408 } position++ goto l407 l408: position, tokenIndex = position408, tokenIndex408 } add(ruledigits, position406) } return true l405: position, tokenIndex = position405, tokenIndex405 return false }, /* 30 signedDigits <- <('-'? digits)> */ nil, /* 31 decimal <- <((signedDigits ('.' digits?)?) / ('-'? '.' digits))> */ func() bool { position410, tokenIndex410 := position, tokenIndex { position411 := position { position412, tokenIndex412 := position, tokenIndex { position414 := position { position415, tokenIndex415 := position, tokenIndex if buffer[position] != rune('-') { goto l415 } position++ goto l416 l415: position, tokenIndex = position415, tokenIndex415 } l416: if !_rules[ruledigits]() { goto l413 } add(rulesignedDigits, position414) } { position417, tokenIndex417 := position, tokenIndex if buffer[position] != rune('.') { goto l417 } position++ { position419, tokenIndex419 := position, tokenIndex if !_rules[ruledigits]() { goto l419 } goto l420 l419: position, tokenIndex = position419, tokenIndex419 } l420: goto l418 l417: position, tokenIndex = position417, tokenIndex417 } l418: goto l412 l413: position, tokenIndex = position412, tokenIndex412 { position421, tokenIndex421 := position, tokenIndex if buffer[position] != rune('-') { goto l421 } position++ goto l422 l421: position, tokenIndex = position421, tokenIndex421 } l422: if buffer[position] != rune('.') { goto l410 } position++ if !_rules[ruledigits]() { goto l410 } } l412: add(ruledecimal, position411) } return true l410: position, tokenIndex = position410, tokenIndex410 return false }, /* 32 timestampbasicfmt <- <([0-9] [0-9] [0-9] [0-9] '-' ('0' / '1') [0-9] '-' [0-3] [0-9] 'T' [0-9] [0-9] ':' [0-9] [0-9])> */ func() bool { position423, tokenIndex423 := position, tokenIndex { position424 := position if c := buffer[position]; c < rune('0') || c > rune('9') { goto l423 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l423 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l423 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l423 } position++ if buffer[position] != rune('-') { goto l423 } position++ { position425, tokenIndex425 := position, tokenIndex if buffer[position] != rune('0') { goto l426 } position++ goto l425 l426: position, tokenIndex = position425, tokenIndex425 if buffer[position] != rune('1') { goto l423 } position++ } l425: if c := buffer[position]; c < rune('0') || c > rune('9') { goto l423 } position++ if buffer[position] != rune('-') { goto l423 } position++ if c := buffer[position]; c < rune('0') || c > rune('3') { goto l423 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l423 } position++ if buffer[position] != rune('T') { goto l423 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l423 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l423 } position++ if buffer[position] != rune(':') { goto l423 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l423 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l423 } position++ add(ruletimestampbasicfmt, position424) } return true l423: position, tokenIndex = position423, tokenIndex423 return false }, /* 33 timestampfmt <- <(('"' '"') / ('\'' '\'') / )> */ func() bool { position427, tokenIndex427 := position, tokenIndex { position428 := position { position429, tokenIndex429 := position, tokenIndex if buffer[position] != rune('"') { goto l430 } position++ { position431 := position if !_rules[ruletimestampbasicfmt]() { goto l430 } add(rulePegText, position431) } if buffer[position] != rune('"') { goto l430 } position++ goto l429 l430: position, tokenIndex = position429, tokenIndex429 if buffer[position] != rune('\'') { goto l432 } position++ { position433 := position if !_rules[ruletimestampbasicfmt]() { goto l432 } add(rulePegText, position433) } if buffer[position] != rune('\'') { goto l432 } position++ goto l429 l432: position, tokenIndex = position429, tokenIndex429 { position434 := position if !_rules[ruletimestampbasicfmt]() { goto l427 } add(rulePegText, position434) } } l429: add(ruletimestampfmt, position428) } return true l427: position, tokenIndex = position427, tokenIndex427 return false }, /* 34 timestamp <- <( Action58)> */ nil, /* 36 Action0 <- <{p.startCall("Set")}> */ nil, /* 37 Action1 <- <{p.endCall()}> */ nil, /* 38 Action2 <- <{p.startCall("SetRowAttrs")}> */ nil, /* 39 Action3 <- <{p.endCall()}> */ nil, /* 40 Action4 <- <{p.startCall("SetColumnAttrs")}> */ nil, /* 41 Action5 <- <{p.endCall()}> */ nil, /* 42 Action6 <- <{p.startCall("Clear")}> */ nil, /* 43 Action7 <- <{p.endCall()}> */ nil, /* 44 Action8 <- <{p.startCall("ClearRow")}> */ nil, /* 45 Action9 <- <{p.endCall()}> */ nil, /* 46 Action10 <- <{p.startCall("Store")}> */ nil, /* 47 Action11 <- <{p.endCall()}> */ nil, /* 48 Action12 <- <{p.startCall("TopN")}> */ nil, /* 49 Action13 <- <{p.endCall()}> */ nil, /* 50 Action14 <- <{p.startCall("TopK")}> */ nil, /* 51 Action15 <- <{p.endCall()}> */ nil, /* 52 Action16 <- <{p.startCall("Rows")}> */ nil, /* 53 Action17 <- <{p.endCall()}> */ nil, /* 54 Action18 <- <{p.startCall("Range")}> */ nil, /* 55 Action19 <- <{p.addField("from")}> */ nil, /* 56 Action20 <- <{p.addVal(text)}> */ nil, /* 57 Action21 <- <{p.addField("to")}> */ nil, /* 58 Action22 <- <{p.addVal(text)}> */ nil, /* 59 Action23 <- <{p.endCall()}> */ nil, nil, /* 61 Action24 <- <{ p.startCall(text) }> */ nil, /* 62 Action25 <- <{ p.endCall() }> */ nil, /* 63 Action26 <- <{ p.addBTWN() }> */ nil, /* 64 Action27 <- <{ p.addLTE() }> */ nil, /* 65 Action28 <- <{ p.addGTE() }> */ nil, /* 66 Action29 <- <{ p.addEQ() }> */ nil, /* 67 Action30 <- <{ p.addNEQ() }> */ nil, /* 68 Action31 <- <{ p.addLT() }> */ nil, /* 69 Action32 <- <{ p.addGT() }> */ nil, /* 70 Action33 <- <{p.startConditional()}> */ nil, /* 71 Action34 <- <{p.endConditional()}> */ nil, /* 72 Action35 <- <{p.condAdd(text)}> */ nil, /* 73 Action36 <- <{p.condAdd(text)}> */ nil, /* 74 Action37 <- <{p.condAdd(text)}> */ nil, /* 75 Action38 <- <{ p.startList() }> */ nil, /* 76 Action39 <- <{ p.endList() }> */ nil, /* 77 Action40 <- <{ p.addVal(nil) }> */ nil, /* 78 Action41 <- <{ p.addVal(true) }> */ nil, /* 79 Action42 <- <{ p.addVal(false) }> */ nil, /* 80 Action43 <- <{ p.addVal(text) }> */ nil, /* 81 Action44 <- <{ p.addNumVal(text) }> */ nil, /* 82 Action45 <- <{ p.startCall(text) }> */ nil, /* 83 Action46 <- <{ p.addVal(p.endCall()) }> */ nil, /* 84 Action47 <- <{ p.addVal(text) }> */ nil, /* 85 Action48 <- <{ p.addVal(text) }> */ nil, /* 86 Action49 <- <{ p.addVal(text) }> */ nil, /* 87 Action50 <- <{ p.addField(text) }> */ nil, /* 88 Action51 <- <{ p.addPosStr("_field", text) }> */ nil, /* 89 Action52 <- <{p.addPosNum("_col", text)}> */ nil, /* 90 Action53 <- <{p.addPosStr("_col", text)}> */ nil, /* 91 Action54 <- <{p.addPosStr("_col", text)}> */ nil, /* 92 Action55 <- <{p.addPosNum("_row", text)}> */ nil, /* 93 Action56 <- <{p.addPosStr("_row", text)}> */ nil, /* 94 Action57 <- <{p.addPosStr("_row", text)}> */ nil, /* 95 Action58 <- <{p.addPosStr("_timestamp", text)}> */ nil, } p.rules = _rules return nil }