package pql // Code generated by peg -inline pql.peg DO NOT EDIT. import ( "fmt" "io" "os" "sort" "strconv" "strings" ) 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 rulePegText ruleAction22 ruleAction23 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 ) 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", "PegText", "Action22", "Action23", "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", } 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 [94]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) SprintSyntaxTree() string { var bldr strings.Builder p.WriteSyntaxTree(&bldr) return bldr.String() } 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("Rows") case ruleAction15: p.endCall() case ruleAction16: p.startCall("Range") case ruleAction17: p.addField("from") case ruleAction18: p.addVal(text) case ruleAction19: p.addField("to") case ruleAction20: p.addVal(text) case ruleAction21: p.endCall() case ruleAction22: p.startCall(text) case ruleAction23: p.endCall() case ruleAction24: p.addBTWN() case ruleAction25: p.addLTE() case ruleAction26: p.addGTE() case ruleAction27: p.addEQ() case ruleAction28: p.addNEQ() case ruleAction29: p.addLT() case ruleAction30: p.addGT() case ruleAction31: p.startConditional() case ruleAction32: p.endConditional() case ruleAction33: p.condAdd(text) case ruleAction34: p.condAdd(text) case ruleAction35: p.condAdd(text) case ruleAction36: p.startList() case ruleAction37: p.endList() case ruleAction38: p.addVal(nil) case ruleAction39: p.addVal(true) case ruleAction40: p.addVal(false) case ruleAction41: p.addVal(text) case ruleAction42: p.addNumVal(text) case ruleAction43: p.startCall(text) case ruleAction44: p.addVal(p.endCall()) case ruleAction45: p.addVal(text) case ruleAction46: p.addVal(text) case ruleAction47: p.addVal(text) case ruleAction48: p.addField(text) case ruleAction49: p.addPosStr("_field", text) case ruleAction50: p.addPosNum("_col", text) case ruleAction51: p.addPosStr("_col", text) case ruleAction52: p.addPosStr("_col", text) case ruleAction53: p.addPosNum("_row", text) case ruleAction54: p.addPosStr("_row", text) case ruleAction55: p.addPosStr("_row", text) case ruleAction56: 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) / (('r' / 'R') ('o' / 'O') ('w' / 'W') ('s' / 'S') Action14 open posfield (comma allargs)? close Action15) / (('r' / 'R') ('a' / 'A') ('n' / 'N') ('g' / 'G') ('e' / 'E') Action16 open field eq value comma ('f' 'r' 'o' 'm' '=')? Action17 timestampfmt Action18 comma ('t' 'o' '=')? sp Action19 timestampfmt Action20 close Action21) / ( Action22 open allargs comma? close Action23))> */ 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(ruleAction56, 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(ruleAction53, 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(ruleAction54, 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(ruleAction55, 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('r') { goto l148 } position++ goto l147 l148: position, tokenIndex = position147, tokenIndex147 if buffer[position] != rune('R') { 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('w') { goto l152 } position++ goto l151 l152: position, tokenIndex = position151, tokenIndex151 if buffer[position] != rune('W') { goto l146 } position++ } l151: { position153, tokenIndex153 := position, tokenIndex if buffer[position] != rune('s') { goto l154 } position++ goto l153 l154: position, tokenIndex = position153, tokenIndex153 if buffer[position] != rune('S') { 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('a') { goto l163 } position++ goto l162 l163: position, tokenIndex = position162, tokenIndex162 if buffer[position] != rune('A') { goto l159 } position++ } l162: { position164, tokenIndex164 := position, tokenIndex if buffer[position] != rune('n') { goto l165 } position++ goto l164 l165: position, tokenIndex = position164, tokenIndex164 if buffer[position] != rune('N') { goto l159 } position++ } l164: { position166, tokenIndex166 := position, tokenIndex if buffer[position] != rune('g') { goto l167 } position++ goto l166 l167: position, tokenIndex = position166, tokenIndex166 if buffer[position] != rune('G') { goto l159 } position++ } l166: { position168, tokenIndex168 := position, tokenIndex if buffer[position] != rune('e') { goto l169 } position++ goto l168 l169: position, tokenIndex = position168, tokenIndex168 if buffer[position] != rune('E') { goto l159 } position++ } l168: { add(ruleAction16, position) } if !_rules[ruleopen]() { goto l159 } if !_rules[rulefield]() { goto l159 } if !_rules[ruleeq]() { goto l159 } if !_rules[rulevalue]() { goto l159 } if !_rules[rulecomma]() { goto l159 } { position171, tokenIndex171 := position, tokenIndex if buffer[position] != rune('f') { goto l171 } position++ if buffer[position] != rune('r') { goto l171 } position++ if buffer[position] != rune('o') { goto l171 } position++ if buffer[position] != rune('m') { goto l171 } position++ if buffer[position] != rune('=') { goto l171 } position++ goto l172 l171: position, tokenIndex = position171, tokenIndex171 } l172: { add(ruleAction17, position) } if !_rules[ruletimestampfmt]() { goto l159 } { add(ruleAction18, position) } if !_rules[rulecomma]() { goto l159 } { position175, tokenIndex175 := position, tokenIndex if buffer[position] != rune('t') { goto l175 } position++ if buffer[position] != rune('o') { goto l175 } position++ if buffer[position] != rune('=') { goto l175 } position++ goto l176 l175: position, tokenIndex = position175, tokenIndex175 } l176: if !_rules[rulesp]() { goto l159 } { add(ruleAction19, position) } if !_rules[ruletimestampfmt]() { goto l159 } { add(ruleAction20, position) } if !_rules[ruleclose]() { goto l159 } { add(ruleAction21, position) } goto l7 l159: position, tokenIndex = position7, tokenIndex7 { position180 := position if !_rules[ruleIDENT]() { goto l5 } add(rulePegText, position180) } { add(ruleAction22, position) } if !_rules[ruleopen]() { goto l5 } if !_rules[ruleallargs]() { goto l5 } { position182, tokenIndex182 := position, tokenIndex if !_rules[rulecomma]() { goto l182 } goto l183 l182: position, tokenIndex = position182, tokenIndex182 } l183: if !_rules[ruleclose]() { goto l5 } { add(ruleAction23, 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 { position185, tokenIndex185 := position, tokenIndex { position186 := position { position187, tokenIndex187 := position, tokenIndex if !_rules[ruleCall]() { goto l188 } l189: { position190, tokenIndex190 := position, tokenIndex if !_rules[rulecomma]() { goto l190 } if !_rules[ruleCall]() { goto l190 } goto l189 l190: position, tokenIndex = position190, tokenIndex190 } { position191, tokenIndex191 := position, tokenIndex if !_rules[rulecomma]() { goto l191 } if !_rules[ruleargs]() { goto l191 } goto l192 l191: position, tokenIndex = position191, tokenIndex191 } l192: goto l187 l188: position, tokenIndex = position187, tokenIndex187 if !_rules[ruleargs]() { goto l193 } goto l187 l193: position, tokenIndex = position187, tokenIndex187 if !_rules[rulesp]() { goto l185 } } l187: add(ruleallargs, position186) } return true l185: position, tokenIndex = position185, tokenIndex185 return false }, /* 3 args <- <(arg (comma args)? sp)> */ func() bool { position194, tokenIndex194 := position, tokenIndex { position195 := position if !_rules[rulearg]() { goto l194 } { position196, tokenIndex196 := position, tokenIndex if !_rules[rulecomma]() { goto l196 } if !_rules[ruleargs]() { goto l196 } goto l197 l196: position, tokenIndex = position196, tokenIndex196 } l197: if !_rules[rulesp]() { goto l194 } add(ruleargs, position195) } return true l194: position, tokenIndex = position194, tokenIndex194 return false }, /* 4 arg <- <((field eq value) / (field sp COND sp value) / conditional)> */ func() bool { position198, tokenIndex198 := position, tokenIndex { position199 := position { position200, tokenIndex200 := position, tokenIndex if !_rules[rulefield]() { goto l201 } if !_rules[ruleeq]() { goto l201 } if !_rules[rulevalue]() { goto l201 } goto l200 l201: position, tokenIndex = position200, tokenIndex200 if !_rules[rulefield]() { goto l202 } if !_rules[rulesp]() { goto l202 } { position203 := position { position204, tokenIndex204 := position, tokenIndex if buffer[position] != rune('>') { goto l205 } position++ if buffer[position] != rune('<') { goto l205 } position++ { add(ruleAction24, position) } goto l204 l205: position, tokenIndex = position204, tokenIndex204 if buffer[position] != rune('<') { goto l207 } position++ if buffer[position] != rune('=') { goto l207 } position++ { add(ruleAction25, position) } goto l204 l207: position, tokenIndex = position204, tokenIndex204 if buffer[position] != rune('>') { goto l209 } position++ if buffer[position] != rune('=') { goto l209 } position++ { add(ruleAction26, position) } goto l204 l209: position, tokenIndex = position204, tokenIndex204 if buffer[position] != rune('=') { goto l211 } position++ if buffer[position] != rune('=') { goto l211 } position++ { add(ruleAction27, position) } goto l204 l211: position, tokenIndex = position204, tokenIndex204 if buffer[position] != rune('!') { goto l213 } position++ if buffer[position] != rune('=') { goto l213 } position++ { add(ruleAction28, position) } goto l204 l213: position, tokenIndex = position204, tokenIndex204 if buffer[position] != rune('<') { goto l215 } position++ { add(ruleAction29, position) } goto l204 l215: position, tokenIndex = position204, tokenIndex204 if buffer[position] != rune('>') { goto l202 } position++ { add(ruleAction30, position) } } l204: add(ruleCOND, position203) } if !_rules[rulesp]() { goto l202 } if !_rules[rulevalue]() { goto l202 } goto l200 l202: position, tokenIndex = position200, tokenIndex200 { position218 := position { add(ruleAction31, position) } if !_rules[rulecondint]() { goto l198 } if !_rules[rulecondLT]() { goto l198 } { position220 := position { position221 := position if !_rules[rulefieldExpr]() { goto l198 } add(rulePegText, position221) } if !_rules[rulesp]() { goto l198 } { add(ruleAction35, position) } add(rulecondfield, position220) } if !_rules[rulecondLT]() { goto l198 } if !_rules[rulecondint]() { goto l198 } { add(ruleAction32, position) } add(ruleconditional, position218) } } l200: add(rulearg, position199) } return true l198: position, tokenIndex = position198, tokenIndex198 return false }, /* 5 COND <- <(('>' '<' Action24) / ('<' '=' Action25) / ('>' '=' Action26) / ('=' '=' Action27) / ('!' '=' Action28) / ('<' Action29) / ('>' Action30))> */ nil, /* 6 conditional <- <(Action31 condint condLT condfield condLT condint Action32)> */ nil, /* 7 condint <- <( sp Action33)> */ func() bool { position226, tokenIndex226 := position, tokenIndex { position227 := position { position228 := position if !_rules[ruledecimal]() { goto l226 } add(rulePegText, position228) } if !_rules[rulesp]() { goto l226 } { add(ruleAction33, position) } add(rulecondint, position227) } return true l226: position, tokenIndex = position226, tokenIndex226 return false }, /* 8 condLT <- <(<(('<' '=') / '<')> sp Action34)> */ func() bool { position230, tokenIndex230 := position, tokenIndex { position231 := position { position232 := position { position233, tokenIndex233 := position, tokenIndex if buffer[position] != rune('<') { goto l234 } position++ if buffer[position] != rune('=') { goto l234 } position++ goto l233 l234: position, tokenIndex = position233, tokenIndex233 if buffer[position] != rune('<') { goto l230 } position++ } l233: add(rulePegText, position232) } if !_rules[rulesp]() { goto l230 } { add(ruleAction34, position) } add(rulecondLT, position231) } return true l230: position, tokenIndex = position230, tokenIndex230 return false }, /* 9 condfield <- <( sp Action35)> */ nil, /* 10 value <- <(item / (lbrack Action36 items rbrack Action37))> */ func() bool { position237, tokenIndex237 := position, tokenIndex { position238 := position { position239, tokenIndex239 := position, tokenIndex if !_rules[ruleitem]() { goto l240 } goto l239 l240: position, tokenIndex = position239, tokenIndex239 { position241 := position if buffer[position] != rune('[') { goto l237 } position++ if !_rules[rulesp]() { goto l237 } add(rulelbrack, position241) } { add(ruleAction36, position) } if !_rules[ruleitems]() { goto l237 } { position243 := position if !_rules[rulesp]() { goto l237 } if buffer[position] != rune(']') { goto l237 } position++ if !_rules[rulesp]() { goto l237 } add(rulerbrack, position243) } { add(ruleAction37, position) } } l239: add(rulevalue, position238) } return true l237: position, tokenIndex = position237, tokenIndex237 return false }, /* 11 items <- <(item (comma items)?)> */ func() bool { position245, tokenIndex245 := position, tokenIndex { position246 := position if !_rules[ruleitem]() { goto l245 } { position247, tokenIndex247 := position, tokenIndex if !_rules[rulecomma]() { goto l247 } if !_rules[ruleitems]() { goto l247 } goto l248 l247: position, tokenIndex = position247, tokenIndex247 } l248: add(ruleitems, position246) } return true l245: position, tokenIndex = position245, tokenIndex245 return false }, /* 12 item <- <(('n' 'u' 'l' 'l' &(comma / close) Action38) / ('t' 'r' 'u' 'e' &(comma / close) Action39) / ('f' 'a' 'l' 's' 'e' &(comma / close) Action40) / (timestampfmt Action41) / ( Action42) / ( Action43 open allargs comma? close Action44) / (<([a-z] / [A-Z] / [0-9] / '-' / '_' / ':')+> Action45) / (<('"' doublequotedstring '"')> Action46) / (<('\'' singlequotedstring '\'')> Action47))> */ func() bool { position249, tokenIndex249 := position, tokenIndex { position250 := position { position251, tokenIndex251 := position, tokenIndex if buffer[position] != rune('n') { goto l252 } position++ if buffer[position] != rune('u') { goto l252 } position++ if buffer[position] != rune('l') { goto l252 } position++ if buffer[position] != rune('l') { goto l252 } position++ { position253, tokenIndex253 := position, tokenIndex { position254, tokenIndex254 := position, tokenIndex if !_rules[rulecomma]() { goto l255 } goto l254 l255: position, tokenIndex = position254, tokenIndex254 if !_rules[ruleclose]() { goto l252 } } l254: position, tokenIndex = position253, tokenIndex253 } { add(ruleAction38, position) } goto l251 l252: position, tokenIndex = position251, tokenIndex251 if buffer[position] != rune('t') { goto l257 } position++ if buffer[position] != rune('r') { goto l257 } position++ if buffer[position] != rune('u') { goto l257 } position++ if buffer[position] != rune('e') { goto l257 } position++ { position258, tokenIndex258 := position, tokenIndex { position259, tokenIndex259 := position, tokenIndex if !_rules[rulecomma]() { goto l260 } goto l259 l260: position, tokenIndex = position259, tokenIndex259 if !_rules[ruleclose]() { goto l257 } } l259: position, tokenIndex = position258, tokenIndex258 } { add(ruleAction39, position) } goto l251 l257: position, tokenIndex = position251, tokenIndex251 if buffer[position] != rune('f') { goto l262 } position++ if buffer[position] != rune('a') { goto l262 } position++ if buffer[position] != rune('l') { goto l262 } position++ if buffer[position] != rune('s') { goto l262 } position++ if buffer[position] != rune('e') { goto l262 } position++ { position263, tokenIndex263 := position, tokenIndex { position264, tokenIndex264 := position, tokenIndex if !_rules[rulecomma]() { goto l265 } goto l264 l265: position, tokenIndex = position264, tokenIndex264 if !_rules[ruleclose]() { goto l262 } } l264: position, tokenIndex = position263, tokenIndex263 } { add(ruleAction40, position) } goto l251 l262: position, tokenIndex = position251, tokenIndex251 if !_rules[ruletimestampfmt]() { goto l267 } { add(ruleAction41, position) } goto l251 l267: position, tokenIndex = position251, tokenIndex251 { position270 := position if !_rules[ruledecimal]() { goto l269 } add(rulePegText, position270) } { add(ruleAction42, position) } goto l251 l269: position, tokenIndex = position251, tokenIndex251 { position273 := position if !_rules[ruleIDENT]() { goto l272 } add(rulePegText, position273) } { add(ruleAction43, position) } if !_rules[ruleopen]() { goto l272 } if !_rules[ruleallargs]() { goto l272 } { position275, tokenIndex275 := position, tokenIndex if !_rules[rulecomma]() { goto l275 } goto l276 l275: position, tokenIndex = position275, tokenIndex275 } l276: if !_rules[ruleclose]() { goto l272 } { add(ruleAction44, position) } goto l251 l272: position, tokenIndex = position251, tokenIndex251 { position279 := position { position282, tokenIndex282 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { goto l283 } position++ goto l282 l283: position, tokenIndex = position282, tokenIndex282 if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l284 } position++ goto l282 l284: position, tokenIndex = position282, tokenIndex282 if c := buffer[position]; c < rune('0') || c > rune('9') { goto l285 } position++ goto l282 l285: position, tokenIndex = position282, tokenIndex282 if buffer[position] != rune('-') { goto l286 } position++ goto l282 l286: position, tokenIndex = position282, tokenIndex282 if buffer[position] != rune('_') { goto l287 } position++ goto l282 l287: position, tokenIndex = position282, tokenIndex282 if buffer[position] != rune(':') { goto l278 } position++ } l282: l280: { position281, tokenIndex281 := position, tokenIndex { position288, tokenIndex288 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { goto l289 } position++ goto l288 l289: position, tokenIndex = position288, tokenIndex288 if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l290 } position++ goto l288 l290: position, tokenIndex = position288, tokenIndex288 if c := buffer[position]; c < rune('0') || c > rune('9') { goto l291 } position++ goto l288 l291: position, tokenIndex = position288, tokenIndex288 if buffer[position] != rune('-') { goto l292 } position++ goto l288 l292: position, tokenIndex = position288, tokenIndex288 if buffer[position] != rune('_') { goto l293 } position++ goto l288 l293: position, tokenIndex = position288, tokenIndex288 if buffer[position] != rune(':') { goto l281 } position++ } l288: goto l280 l281: position, tokenIndex = position281, tokenIndex281 } add(rulePegText, position279) } { add(ruleAction45, position) } goto l251 l278: position, tokenIndex = position251, tokenIndex251 { position296 := position if buffer[position] != rune('"') { goto l295 } position++ if !_rules[ruledoublequotedstring]() { goto l295 } if buffer[position] != rune('"') { goto l295 } position++ add(rulePegText, position296) } { add(ruleAction46, position) } goto l251 l295: position, tokenIndex = position251, tokenIndex251 { position298 := position if buffer[position] != rune('\'') { goto l249 } position++ if !_rules[rulesinglequotedstring]() { goto l249 } if buffer[position] != rune('\'') { goto l249 } position++ add(rulePegText, position298) } { add(ruleAction47, position) } } l251: add(ruleitem, position250) } return true l249: position, tokenIndex = position249, tokenIndex249 return false }, /* 13 doublequotedstring <- <(('\\' '"') / ('\\' '\\') / ('\\' 'n') / ('\\' 't') / (!('"' / '\\') .))*> */ func() bool { { position301 := position l302: { position303, tokenIndex303 := position, tokenIndex { position304, tokenIndex304 := position, tokenIndex if buffer[position] != rune('\\') { goto l305 } position++ if buffer[position] != rune('"') { goto l305 } position++ goto l304 l305: position, tokenIndex = position304, tokenIndex304 if buffer[position] != rune('\\') { goto l306 } position++ if buffer[position] != rune('\\') { goto l306 } position++ goto l304 l306: position, tokenIndex = position304, tokenIndex304 if buffer[position] != rune('\\') { goto l307 } position++ if buffer[position] != rune('n') { goto l307 } position++ goto l304 l307: position, tokenIndex = position304, tokenIndex304 if buffer[position] != rune('\\') { goto l308 } position++ if buffer[position] != rune('t') { goto l308 } position++ goto l304 l308: position, tokenIndex = position304, tokenIndex304 { position309, tokenIndex309 := position, tokenIndex { position310, tokenIndex310 := position, tokenIndex if buffer[position] != rune('"') { goto l311 } position++ goto l310 l311: position, tokenIndex = position310, tokenIndex310 if buffer[position] != rune('\\') { goto l309 } position++ } l310: goto l303 l309: position, tokenIndex = position309, tokenIndex309 } if !matchDot() { goto l303 } } l304: goto l302 l303: position, tokenIndex = position303, tokenIndex303 } add(ruledoublequotedstring, position301) } return true }, /* 14 singlequotedstring <- <(('\\' '\'') / ('\\' '\\') / ('\\' 'n') / ('\\' 't') / (!('\'' / '\\') .))*> */ func() bool { { position313 := position l314: { position315, tokenIndex315 := position, tokenIndex { position316, tokenIndex316 := position, tokenIndex if buffer[position] != rune('\\') { goto l317 } position++ if buffer[position] != rune('\'') { goto l317 } position++ goto l316 l317: position, tokenIndex = position316, tokenIndex316 if buffer[position] != rune('\\') { goto l318 } position++ if buffer[position] != rune('\\') { goto l318 } position++ goto l316 l318: position, tokenIndex = position316, tokenIndex316 if buffer[position] != rune('\\') { goto l319 } position++ if buffer[position] != rune('n') { goto l319 } position++ goto l316 l319: position, tokenIndex = position316, tokenIndex316 if buffer[position] != rune('\\') { goto l320 } position++ if buffer[position] != rune('t') { goto l320 } position++ goto l316 l320: position, tokenIndex = position316, tokenIndex316 { position321, tokenIndex321 := position, tokenIndex { position322, tokenIndex322 := position, tokenIndex if buffer[position] != rune('\'') { goto l323 } position++ goto l322 l323: position, tokenIndex = position322, tokenIndex322 if buffer[position] != rune('\\') { goto l321 } position++ } l322: goto l315 l321: position, tokenIndex = position321, tokenIndex321 } if !matchDot() { goto l315 } } l316: goto l314 l315: position, tokenIndex = position315, tokenIndex315 } add(rulesinglequotedstring, position313) } return true }, /* 15 fieldExpr <- <(([a-z] / [A-Z] / '_') ([a-z] / [A-Z] / [0-9] / '_' / '-')*)> */ func() bool { position324, tokenIndex324 := position, tokenIndex { position325 := position { position326, tokenIndex326 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { goto l327 } position++ goto l326 l327: position, tokenIndex = position326, tokenIndex326 if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l328 } position++ goto l326 l328: position, tokenIndex = position326, tokenIndex326 if buffer[position] != rune('_') { goto l324 } position++ } l326: l329: { position330, tokenIndex330 := position, tokenIndex { position331, tokenIndex331 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { goto l332 } position++ goto l331 l332: position, tokenIndex = position331, tokenIndex331 if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l333 } position++ goto l331 l333: position, tokenIndex = position331, tokenIndex331 if c := buffer[position]; c < rune('0') || c > rune('9') { goto l334 } position++ goto l331 l334: position, tokenIndex = position331, tokenIndex331 if buffer[position] != rune('_') { goto l335 } position++ goto l331 l335: position, tokenIndex = position331, tokenIndex331 if buffer[position] != rune('-') { goto l330 } position++ } l331: goto l329 l330: position, tokenIndex = position330, tokenIndex330 } add(rulefieldExpr, position325) } return true l324: position, tokenIndex = position324, tokenIndex324 return false }, /* 16 field <- <(<(fieldExpr / reserved)> Action48)> */ func() bool { position336, tokenIndex336 := position, tokenIndex { position337 := position { position338 := position { position339, tokenIndex339 := position, tokenIndex if !_rules[rulefieldExpr]() { goto l340 } goto l339 l340: position, tokenIndex = position339, tokenIndex339 { position341 := position { position342, tokenIndex342 := position, tokenIndex if buffer[position] != rune('_') { goto l343 } position++ if buffer[position] != rune('r') { goto l343 } position++ if buffer[position] != rune('o') { goto l343 } position++ if buffer[position] != rune('w') { goto l343 } position++ goto l342 l343: position, tokenIndex = position342, tokenIndex342 if buffer[position] != rune('_') { goto l344 } position++ if buffer[position] != rune('c') { goto l344 } position++ if buffer[position] != rune('o') { goto l344 } position++ if buffer[position] != rune('l') { goto l344 } position++ goto l342 l344: position, tokenIndex = position342, tokenIndex342 if buffer[position] != rune('_') { goto l345 } position++ if buffer[position] != rune('s') { goto l345 } position++ if buffer[position] != rune('t') { goto l345 } position++ if buffer[position] != rune('a') { goto l345 } position++ if buffer[position] != rune('r') { goto l345 } position++ if buffer[position] != rune('t') { goto l345 } position++ goto l342 l345: position, tokenIndex = position342, tokenIndex342 if buffer[position] != rune('_') { goto l346 } position++ if buffer[position] != rune('e') { goto l346 } position++ if buffer[position] != rune('n') { goto l346 } position++ if buffer[position] != rune('d') { goto l346 } position++ goto l342 l346: position, tokenIndex = position342, tokenIndex342 if buffer[position] != rune('_') { goto l347 } position++ if buffer[position] != rune('t') { goto l347 } position++ if buffer[position] != rune('i') { goto l347 } position++ if buffer[position] != rune('m') { goto l347 } position++ if buffer[position] != rune('e') { goto l347 } position++ if buffer[position] != rune('s') { goto l347 } position++ if buffer[position] != rune('t') { goto l347 } position++ if buffer[position] != rune('a') { goto l347 } position++ if buffer[position] != rune('m') { goto l347 } position++ if buffer[position] != rune('p') { goto l347 } position++ goto l342 l347: position, tokenIndex = position342, tokenIndex342 if buffer[position] != rune('_') { goto l336 } position++ if buffer[position] != rune('f') { goto l336 } position++ if buffer[position] != rune('i') { goto l336 } position++ if buffer[position] != rune('e') { goto l336 } position++ if buffer[position] != rune('l') { goto l336 } position++ if buffer[position] != rune('d') { goto l336 } position++ } l342: add(rulereserved, position341) } } l339: add(rulePegText, position338) } { add(ruleAction48, position) } add(rulefield, position337) } return true l336: position, tokenIndex = position336, tokenIndex336 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 <- <( Action49)> */ func() bool { position350, tokenIndex350 := position, tokenIndex { position351 := position { position352 := position if !_rules[rulefieldExpr]() { goto l350 } add(rulePegText, position352) } { add(ruleAction49, position) } add(ruleposfield, position351) } return true l350: position, tokenIndex = position350, tokenIndex350 return false }, /* 19 col <- <(( Action50) / (<('\'' singlequotedstring '\'')> Action51) / (<('"' doublequotedstring '"')> Action52))> */ func() bool { position354, tokenIndex354 := position, tokenIndex { position355 := position { position356, tokenIndex356 := position, tokenIndex { position358 := position if !_rules[ruledigits]() { goto l357 } add(rulePegText, position358) } { add(ruleAction50, position) } goto l356 l357: position, tokenIndex = position356, tokenIndex356 { position361 := position if buffer[position] != rune('\'') { goto l360 } position++ if !_rules[rulesinglequotedstring]() { goto l360 } if buffer[position] != rune('\'') { goto l360 } position++ add(rulePegText, position361) } { add(ruleAction51, position) } goto l356 l360: position, tokenIndex = position356, tokenIndex356 { position363 := position if buffer[position] != rune('"') { goto l354 } position++ if !_rules[ruledoublequotedstring]() { goto l354 } if buffer[position] != rune('"') { goto l354 } position++ add(rulePegText, position363) } { add(ruleAction52, position) } } l356: add(rulecol, position355) } return true l354: position, tokenIndex = position354, tokenIndex354 return false }, /* 20 row <- <(( Action53) / (<('\'' singlequotedstring '\'')> Action54) / (<('"' doublequotedstring '"')> Action55))> */ nil, /* 21 open <- <('(' sp)> */ func() bool { position366, tokenIndex366 := position, tokenIndex { position367 := position if buffer[position] != rune('(') { goto l366 } position++ if !_rules[rulesp]() { goto l366 } add(ruleopen, position367) } return true l366: position, tokenIndex = position366, tokenIndex366 return false }, /* 22 close <- <(sp ')' sp)> */ func() bool { position368, tokenIndex368 := position, tokenIndex { position369 := position if !_rules[rulesp]() { goto l368 } if buffer[position] != rune(')') { goto l368 } position++ if !_rules[rulesp]() { goto l368 } add(ruleclose, position369) } return true l368: position, tokenIndex = position368, tokenIndex368 return false }, /* 23 sp <- <(' ' / '\t' / '\n')*> */ func() bool { { position371 := position l372: { position373, tokenIndex373 := position, tokenIndex { position374, tokenIndex374 := position, tokenIndex if buffer[position] != rune(' ') { goto l375 } position++ goto l374 l375: position, tokenIndex = position374, tokenIndex374 if buffer[position] != rune('\t') { goto l376 } position++ goto l374 l376: position, tokenIndex = position374, tokenIndex374 if buffer[position] != rune('\n') { goto l373 } position++ } l374: goto l372 l373: position, tokenIndex = position373, tokenIndex373 } add(rulesp, position371) } return true }, /* 24 eq <- <(sp '=' sp)> */ func() bool { position377, tokenIndex377 := position, tokenIndex { position378 := position if !_rules[rulesp]() { goto l377 } if buffer[position] != rune('=') { goto l377 } position++ if !_rules[rulesp]() { goto l377 } add(ruleeq, position378) } return true l377: position, tokenIndex = position377, tokenIndex377 return false }, /* 25 comma <- <(sp ',' sp)> */ func() bool { position379, tokenIndex379 := position, tokenIndex { position380 := position if !_rules[rulesp]() { goto l379 } if buffer[position] != rune(',') { goto l379 } position++ if !_rules[rulesp]() { goto l379 } add(rulecomma, position380) } return true l379: position, tokenIndex = position379, tokenIndex379 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 { position383, tokenIndex383 := position, tokenIndex { position384 := position { position385, tokenIndex385 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { goto l386 } position++ goto l385 l386: position, tokenIndex = position385, tokenIndex385 if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l383 } position++ } l385: l387: { position388, tokenIndex388 := position, tokenIndex { position389, tokenIndex389 := position, tokenIndex if c := buffer[position]; c < rune('a') || c > rune('z') { goto l390 } position++ goto l389 l390: position, tokenIndex = position389, tokenIndex389 if c := buffer[position]; c < rune('A') || c > rune('Z') { goto l391 } position++ goto l389 l391: position, tokenIndex = position389, tokenIndex389 if c := buffer[position]; c < rune('0') || c > rune('9') { goto l388 } position++ } l389: goto l387 l388: position, tokenIndex = position388, tokenIndex388 } add(ruleIDENT, position384) } return true l383: position, tokenIndex = position383, tokenIndex383 return false }, /* 29 digits <- <[0-9]+> */ func() bool { position392, tokenIndex392 := position, tokenIndex { position393 := position if c := buffer[position]; c < rune('0') || c > rune('9') { goto l392 } position++ l394: { position395, tokenIndex395 := position, tokenIndex if c := buffer[position]; c < rune('0') || c > rune('9') { goto l395 } position++ goto l394 l395: position, tokenIndex = position395, tokenIndex395 } add(ruledigits, position393) } return true l392: position, tokenIndex = position392, tokenIndex392 return false }, /* 30 signedDigits <- <('-'? digits)> */ nil, /* 31 decimal <- <((signedDigits ('.' digits?)?) / ('-'? '.' digits))> */ func() bool { position397, tokenIndex397 := position, tokenIndex { position398 := position { position399, tokenIndex399 := position, tokenIndex { position401 := position { position402, tokenIndex402 := position, tokenIndex if buffer[position] != rune('-') { goto l402 } position++ goto l403 l402: position, tokenIndex = position402, tokenIndex402 } l403: if !_rules[ruledigits]() { goto l400 } add(rulesignedDigits, position401) } { position404, tokenIndex404 := position, tokenIndex if buffer[position] != rune('.') { goto l404 } position++ { position406, tokenIndex406 := position, tokenIndex if !_rules[ruledigits]() { goto l406 } goto l407 l406: position, tokenIndex = position406, tokenIndex406 } l407: goto l405 l404: position, tokenIndex = position404, tokenIndex404 } l405: goto l399 l400: position, tokenIndex = position399, tokenIndex399 { position408, tokenIndex408 := position, tokenIndex if buffer[position] != rune('-') { goto l408 } position++ goto l409 l408: position, tokenIndex = position408, tokenIndex408 } l409: if buffer[position] != rune('.') { goto l397 } position++ if !_rules[ruledigits]() { goto l397 } } l399: add(ruledecimal, position398) } return true l397: position, tokenIndex = position397, tokenIndex397 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 { position410, tokenIndex410 := position, tokenIndex { position411 := position if c := buffer[position]; c < rune('0') || c > rune('9') { goto l410 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l410 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l410 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l410 } position++ if buffer[position] != rune('-') { goto l410 } position++ { position412, tokenIndex412 := position, tokenIndex if buffer[position] != rune('0') { goto l413 } position++ goto l412 l413: position, tokenIndex = position412, tokenIndex412 if buffer[position] != rune('1') { goto l410 } position++ } l412: if c := buffer[position]; c < rune('0') || c > rune('9') { goto l410 } position++ if buffer[position] != rune('-') { goto l410 } position++ if c := buffer[position]; c < rune('0') || c > rune('3') { goto l410 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l410 } position++ if buffer[position] != rune('T') { goto l410 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l410 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l410 } position++ if buffer[position] != rune(':') { goto l410 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l410 } position++ if c := buffer[position]; c < rune('0') || c > rune('9') { goto l410 } position++ add(ruletimestampbasicfmt, position411) } return true l410: position, tokenIndex = position410, tokenIndex410 return false }, /* 33 timestampfmt <- <(('"' '"') / ('\'' '\'') / )> */ func() bool { position414, tokenIndex414 := position, tokenIndex { position415 := position { position416, tokenIndex416 := position, tokenIndex if buffer[position] != rune('"') { goto l417 } position++ { position418 := position if !_rules[ruletimestampbasicfmt]() { goto l417 } add(rulePegText, position418) } if buffer[position] != rune('"') { goto l417 } position++ goto l416 l417: position, tokenIndex = position416, tokenIndex416 if buffer[position] != rune('\'') { goto l419 } position++ { position420 := position if !_rules[ruletimestampbasicfmt]() { goto l419 } add(rulePegText, position420) } if buffer[position] != rune('\'') { goto l419 } position++ goto l416 l419: position, tokenIndex = position416, tokenIndex416 { position421 := position if !_rules[ruletimestampbasicfmt]() { goto l414 } add(rulePegText, position421) } } l416: add(ruletimestampfmt, position415) } return true l414: position, tokenIndex = position414, tokenIndex414 return false }, /* 34 timestamp <- <( Action56)> */ 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("Rows")}> */ nil, /* 51 Action15 <- <{p.endCall()}> */ nil, /* 52 Action16 <- <{p.startCall("Range")}> */ nil, /* 53 Action17 <- <{p.addField("from")}> */ nil, /* 54 Action18 <- <{p.addVal(text)}> */ nil, /* 55 Action19 <- <{p.addField("to")}> */ nil, /* 56 Action20 <- <{p.addVal(text)}> */ nil, /* 57 Action21 <- <{p.endCall()}> */ nil, nil, /* 59 Action22 <- <{ p.startCall(text) }> */ nil, /* 60 Action23 <- <{ p.endCall() }> */ nil, /* 61 Action24 <- <{ p.addBTWN() }> */ nil, /* 62 Action25 <- <{ p.addLTE() }> */ nil, /* 63 Action26 <- <{ p.addGTE() }> */ nil, /* 64 Action27 <- <{ p.addEQ() }> */ nil, /* 65 Action28 <- <{ p.addNEQ() }> */ nil, /* 66 Action29 <- <{ p.addLT() }> */ nil, /* 67 Action30 <- <{ p.addGT() }> */ nil, /* 68 Action31 <- <{p.startConditional()}> */ nil, /* 69 Action32 <- <{p.endConditional()}> */ nil, /* 70 Action33 <- <{p.condAdd(text)}> */ nil, /* 71 Action34 <- <{p.condAdd(text)}> */ nil, /* 72 Action35 <- <{p.condAdd(text)}> */ nil, /* 73 Action36 <- <{ p.startList() }> */ nil, /* 74 Action37 <- <{ p.endList() }> */ nil, /* 75 Action38 <- <{ p.addVal(nil) }> */ nil, /* 76 Action39 <- <{ p.addVal(true) }> */ nil, /* 77 Action40 <- <{ p.addVal(false) }> */ nil, /* 78 Action41 <- <{ p.addVal(text) }> */ nil, /* 79 Action42 <- <{ p.addNumVal(text) }> */ nil, /* 80 Action43 <- <{ p.startCall(text) }> */ nil, /* 81 Action44 <- <{ p.addVal(p.endCall()) }> */ nil, /* 82 Action45 <- <{ p.addVal(text) }> */ nil, /* 83 Action46 <- <{ p.addVal(text) }> */ nil, /* 84 Action47 <- <{ p.addVal(text) }> */ nil, /* 85 Action48 <- <{ p.addField(text) }> */ nil, /* 86 Action49 <- <{ p.addPosStr("_field", text) }> */ nil, /* 87 Action50 <- <{p.addPosNum("_col", text)}> */ nil, /* 88 Action51 <- <{p.addPosStr("_col", text)}> */ nil, /* 89 Action52 <- <{p.addPosStr("_col", text)}> */ nil, /* 90 Action53 <- <{p.addPosNum("_row", text)}> */ nil, /* 91 Action54 <- <{p.addPosStr("_row", text)}> */ nil, /* 92 Action55 <- <{p.addPosStr("_row", text)}> */ nil, /* 93 Action56 <- <{p.addPosStr("_timestamp", text)}> */ nil, } p.rules = _rules return nil }