// Code generated by pigeon; DO NOT EDIT. package internal import ( "bytes" "errors" "fmt" "io" "io/ioutil" "math" "os" "sort" "strconv" "strings" "unicode" "unicode/utf8" "github.com/dexon-foundation/dexon/core/vm/sqlvm/ast" se "github.com/dexon-foundation/dexon/core/vm/sqlvm/errors" ) var g = &grammar{ rules: []*rule{ { name: "S", pos: position{line: 10, col: 1, offset: 150}, expr: &actionExpr{ pos: position{line: 11, col: 5, offset: 156}, run: (*parser).callonS1, expr: &seqExpr{ pos: position{line: 11, col: 5, offset: 156}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 11, col: 5, offset: 156}, name: "_", }, &labeledExpr{ pos: position{line: 11, col: 7, offset: 158}, label: "x", expr: &zeroOrOneExpr{ pos: position{line: 11, col: 9, offset: 160}, expr: &ruleRefExpr{ pos: position{line: 11, col: 9, offset: 160}, name: "Stmt", }, }, }, &ruleRefExpr{ pos: position{line: 11, col: 15, offset: 166}, name: "_", }, &labeledExpr{ pos: position{line: 11, col: 17, offset: 168}, label: "xs", expr: &zeroOrMoreExpr{ pos: position{line: 11, col: 20, offset: 171}, expr: &actionExpr{ pos: position{line: 11, col: 22, offset: 173}, run: (*parser).callonS10, expr: &seqExpr{ pos: position{line: 11, col: 22, offset: 173}, exprs: []interface{}{ &litMatcher{ pos: position{line: 11, col: 22, offset: 173}, val: ";", ignoreCase: false, }, &ruleRefExpr{ pos: position{line: 11, col: 26, offset: 177}, name: "_", }, &labeledExpr{ pos: position{line: 11, col: 28, offset: 179}, label: "s", expr: &zeroOrOneExpr{ pos: position{line: 11, col: 30, offset: 181}, expr: &ruleRefExpr{ pos: position{line: 11, col: 30, offset: 181}, name: "Stmt", }, }, }, &ruleRefExpr{ pos: position{line: 11, col: 36, offset: 187}, name: "_", }, }, }, }, }, }, &ruleRefExpr{ pos: position{line: 11, col: 59, offset: 210}, name: "EOF", }, }, }, }, }, { name: "Stmt", pos: position{line: 26, col: 1, offset: 503}, expr: &choiceExpr{ pos: position{line: 27, col: 4, offset: 511}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 27, col: 4, offset: 511}, name: "SelectStmt", }, &ruleRefExpr{ pos: position{line: 28, col: 4, offset: 525}, name: "UpdateStmt", }, &ruleRefExpr{ pos: position{line: 29, col: 4, offset: 539}, name: "DeleteStmt", }, &ruleRefExpr{ pos: position{line: 30, col: 4, offset: 553}, name: "InsertStmt", }, &ruleRefExpr{ pos: position{line: 31, col: 4, offset: 567}, name: "CreateTableStmt", }, &ruleRefExpr{ pos: position{line: 32, col: 4, offset: 586}, name: "CreateIndexStmt", }, }, }, }, { name: "SelectStmt", pos: position{line: 34, col: 1, offset: 603}, expr: &actionExpr{ pos: position{line: 35, col: 4, offset: 617}, run: (*parser).callonSelectStmt1, expr: &seqExpr{ pos: position{line: 35, col: 4, offset: 617}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 35, col: 4, offset: 617}, label: "v", expr: &ruleRefExpr{ pos: position{line: 35, col: 6, offset: 619}, name: "SelectToken", }, }, &ruleRefExpr{ pos: position{line: 36, col: 2, offset: 632}, name: "_", }, &labeledExpr{ pos: position{line: 36, col: 4, offset: 634}, label: "f", expr: &ruleRefExpr{ pos: position{line: 36, col: 6, offset: 636}, name: "SelectColumn", }, }, &labeledExpr{ pos: position{line: 36, col: 19, offset: 649}, label: "fs", expr: &zeroOrMoreExpr{ pos: position{line: 36, col: 22, offset: 652}, expr: &actionExpr{ pos: position{line: 36, col: 24, offset: 654}, run: (*parser).callonSelectStmt10, expr: &seqExpr{ pos: position{line: 36, col: 24, offset: 654}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 36, col: 24, offset: 654}, name: "_", }, &ruleRefExpr{ pos: position{line: 36, col: 26, offset: 656}, name: "SeparatorToken", }, &ruleRefExpr{ pos: position{line: 36, col: 41, offset: 671}, name: "_", }, &labeledExpr{ pos: position{line: 36, col: 43, offset: 673}, label: "s", expr: &ruleRefExpr{ pos: position{line: 36, col: 45, offset: 675}, name: "SelectColumn", }, }, }, }, }, }, }, &labeledExpr{ pos: position{line: 37, col: 2, offset: 710}, label: "table", expr: &zeroOrOneExpr{ pos: position{line: 37, col: 8, offset: 716}, expr: &actionExpr{ pos: position{line: 37, col: 10, offset: 718}, run: (*parser).callonSelectStmt19, expr: &seqExpr{ pos: position{line: 37, col: 10, offset: 718}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 37, col: 10, offset: 718}, name: "_", }, &ruleRefExpr{ pos: position{line: 37, col: 12, offset: 720}, name: "FromToken", }, &ruleRefExpr{ pos: position{line: 37, col: 22, offset: 730}, name: "_", }, &labeledExpr{ pos: position{line: 37, col: 24, offset: 732}, label: "i", expr: &ruleRefExpr{ pos: position{line: 37, col: 26, offset: 734}, name: "Identifier", }, }, }, }, }, }, }, &labeledExpr{ pos: position{line: 38, col: 2, offset: 767}, label: "where", expr: &zeroOrOneExpr{ pos: position{line: 38, col: 8, offset: 773}, expr: &actionExpr{ pos: position{line: 38, col: 10, offset: 775}, run: (*parser).callonSelectStmt28, expr: &seqExpr{ pos: position{line: 38, col: 10, offset: 775}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 38, col: 10, offset: 775}, name: "_", }, &labeledExpr{ pos: position{line: 38, col: 12, offset: 777}, label: "w", expr: &ruleRefExpr{ pos: position{line: 38, col: 14, offset: 779}, name: "WhereClause", }, }, }, }, }, }, }, &labeledExpr{ pos: position{line: 39, col: 2, offset: 813}, label: "group", expr: &zeroOrOneExpr{ pos: position{line: 39, col: 8, offset: 819}, expr: &actionExpr{ pos: position{line: 39, col: 10, offset: 821}, run: (*parser).callonSelectStmt35, expr: &seqExpr{ pos: position{line: 39, col: 10, offset: 821}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 39, col: 10, offset: 821}, name: "_", }, &labeledExpr{ pos: position{line: 39, col: 12, offset: 823}, label: "g", expr: &ruleRefExpr{ pos: position{line: 39, col: 14, offset: 825}, name: "GroupByClause", }, }, }, }, }, }, }, &labeledExpr{ pos: position{line: 40, col: 2, offset: 861}, label: "order", expr: &zeroOrOneExpr{ pos: position{line: 40, col: 8, offset: 867}, expr: &actionExpr{ pos: position{line: 40, col: 10, offset: 869}, run: (*parser).callonSelectStmt42, expr: &seqExpr{ pos: position{line: 40, col: 10, offset: 869}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 40, col: 10, offset: 869}, name: "_", }, &labeledExpr{ pos: position{line: 40, col: 12, offset: 871}, label: "or", expr: &ruleRefExpr{ pos: position{line: 40, col: 15, offset: 874}, name: "OrderByClause", }, }, }, }, }, }, }, &labeledExpr{ pos: position{line: 41, col: 2, offset: 911}, label: "limit", expr: &zeroOrOneExpr{ pos: position{line: 41, col: 8, offset: 917}, expr: &actionExpr{ pos: position{line: 41, col: 10, offset: 919}, run: (*parser).callonSelectStmt49, expr: &seqExpr{ pos: position{line: 41, col: 10, offset: 919}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 41, col: 10, offset: 919}, name: "_", }, &labeledExpr{ pos: position{line: 41, col: 12, offset: 921}, label: "l", expr: &ruleRefExpr{ pos: position{line: 41, col: 14, offset: 923}, name: "LimitClause", }, }, }, }, }, }, }, &labeledExpr{ pos: position{line: 42, col: 2, offset: 957}, label: "offset", expr: &zeroOrOneExpr{ pos: position{line: 42, col: 9, offset: 964}, expr: &actionExpr{ pos: position{line: 42, col: 11, offset: 966}, run: (*parser).callonSelectStmt56, expr: &seqExpr{ pos: position{line: 42, col: 11, offset: 966}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 42, col: 11, offset: 966}, name: "_", }, &labeledExpr{ pos: position{line: 42, col: 13, offset: 968}, label: "of", expr: &ruleRefExpr{ pos: position{line: 42, col: 16, offset: 971}, name: "OffsetClause", }, }, }, }, }, }, }, }, }, }, }, { name: "SelectColumn", pos: position{line: 74, col: 1, offset: 1864}, expr: &choiceExpr{ pos: position{line: 75, col: 4, offset: 1880}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 75, col: 4, offset: 1880}, name: "AnyLiteral", }, &ruleRefExpr{ pos: position{line: 76, col: 4, offset: 1894}, name: "Expr", }, }, }, }, { name: "UpdateStmt", pos: position{line: 78, col: 1, offset: 1900}, expr: &actionExpr{ pos: position{line: 79, col: 4, offset: 1914}, run: (*parser).callonUpdateStmt1, expr: &seqExpr{ pos: position{line: 79, col: 4, offset: 1914}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 79, col: 4, offset: 1914}, label: "v", expr: &ruleRefExpr{ pos: position{line: 79, col: 6, offset: 1916}, name: "UpdateToken", }, }, &ruleRefExpr{ pos: position{line: 80, col: 2, offset: 1929}, name: "_", }, &labeledExpr{ pos: position{line: 80, col: 4, offset: 1931}, label: "table", expr: &ruleRefExpr{ pos: position{line: 80, col: 10, offset: 1937}, name: "Identifier", }, }, &ruleRefExpr{ pos: position{line: 81, col: 2, offset: 1949}, name: "_", }, &ruleRefExpr{ pos: position{line: 81, col: 4, offset: 1951}, name: "SetToken", }, &ruleRefExpr{ pos: position{line: 82, col: 2, offset: 1961}, name: "_", }, &labeledExpr{ pos: position{line: 82, col: 4, offset: 1963}, label: "a", expr: &ruleRefExpr{ pos: position{line: 82, col: 6, offset: 1965}, name: "Assignment", }, }, &labeledExpr{ pos: position{line: 82, col: 17, offset: 1976}, label: "as", expr: &zeroOrMoreExpr{ pos: position{line: 82, col: 20, offset: 1979}, expr: &actionExpr{ pos: position{line: 82, col: 22, offset: 1981}, run: (*parser).callonUpdateStmt15, expr: &seqExpr{ pos: position{line: 82, col: 22, offset: 1981}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 82, col: 22, offset: 1981}, name: "_", }, &ruleRefExpr{ pos: position{line: 82, col: 24, offset: 1983}, name: "SeparatorToken", }, &ruleRefExpr{ pos: position{line: 82, col: 39, offset: 1998}, name: "_", }, &labeledExpr{ pos: position{line: 82, col: 41, offset: 2000}, label: "s", expr: &ruleRefExpr{ pos: position{line: 82, col: 43, offset: 2002}, name: "Assignment", }, }, }, }, }, }, }, &labeledExpr{ pos: position{line: 83, col: 2, offset: 2035}, label: "where", expr: &zeroOrOneExpr{ pos: position{line: 83, col: 8, offset: 2041}, expr: &actionExpr{ pos: position{line: 83, col: 10, offset: 2043}, run: (*parser).callonUpdateStmt24, expr: &seqExpr{ pos: position{line: 83, col: 10, offset: 2043}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 83, col: 10, offset: 2043}, name: "_", }, &labeledExpr{ pos: position{line: 83, col: 12, offset: 2045}, label: "w", expr: &ruleRefExpr{ pos: position{line: 83, col: 14, offset: 2047}, name: "WhereClause", }, }, }, }, }, }, }, }, }, }, }, { name: "DeleteStmt", pos: position{line: 101, col: 1, offset: 2561}, expr: &actionExpr{ pos: position{line: 102, col: 4, offset: 2575}, run: (*parser).callonDeleteStmt1, expr: &seqExpr{ pos: position{line: 102, col: 4, offset: 2575}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 102, col: 4, offset: 2575}, label: "v1", expr: &ruleRefExpr{ pos: position{line: 102, col: 7, offset: 2578}, name: "DeleteToken", }, }, &labeledExpr{ pos: position{line: 102, col: 19, offset: 2590}, label: "v2", expr: &ruleRefExpr{ pos: position{line: 102, col: 22, offset: 2593}, name: "_", }, }, &labeledExpr{ pos: position{line: 102, col: 24, offset: 2595}, label: "v3", expr: &ruleRefExpr{ pos: position{line: 102, col: 27, offset: 2598}, name: "FromToken", }, }, &ruleRefExpr{ pos: position{line: 103, col: 2, offset: 2609}, name: "_", }, &labeledExpr{ pos: position{line: 103, col: 4, offset: 2611}, label: "table", expr: &ruleRefExpr{ pos: position{line: 103, col: 10, offset: 2617}, name: "Identifier", }, }, &labeledExpr{ pos: position{line: 104, col: 2, offset: 2629}, label: "where", expr: &zeroOrOneExpr{ pos: position{line: 104, col: 8, offset: 2635}, expr: &actionExpr{ pos: position{line: 104, col: 10, offset: 2637}, run: (*parser).callonDeleteStmt14, expr: &seqExpr{ pos: position{line: 104, col: 10, offset: 2637}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 104, col: 10, offset: 2637}, name: "_", }, &labeledExpr{ pos: position{line: 104, col: 12, offset: 2639}, label: "w", expr: &ruleRefExpr{ pos: position{line: 104, col: 14, offset: 2641}, name: "WhereClause", }, }, }, }, }, }, }, }, }, }, }, { name: "InsertStmt", pos: position{line: 118, col: 1, offset: 2996}, expr: &actionExpr{ pos: position{line: 119, col: 4, offset: 3010}, run: (*parser).callonInsertStmt1, expr: &seqExpr{ pos: position{line: 119, col: 4, offset: 3010}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 119, col: 4, offset: 3010}, label: "v1", expr: &ruleRefExpr{ pos: position{line: 119, col: 7, offset: 3013}, name: "InsertToken", }, }, &labeledExpr{ pos: position{line: 119, col: 19, offset: 3025}, label: "v2", expr: &ruleRefExpr{ pos: position{line: 119, col: 22, offset: 3028}, name: "_", }, }, &labeledExpr{ pos: position{line: 119, col: 24, offset: 3030}, label: "v3", expr: &ruleRefExpr{ pos: position{line: 119, col: 27, offset: 3033}, name: "IntoToken", }, }, &ruleRefExpr{ pos: position{line: 120, col: 2, offset: 3044}, name: "_", }, &labeledExpr{ pos: position{line: 120, col: 4, offset: 3046}, label: "table", expr: &ruleRefExpr{ pos: position{line: 120, col: 10, offset: 3052}, name: "Identifier", }, }, &ruleRefExpr{ pos: position{line: 121, col: 2, offset: 3064}, name: "_", }, &labeledExpr{ pos: position{line: 121, col: 4, offset: 3066}, label: "insert", expr: &choiceExpr{ pos: position{line: 121, col: 13, offset: 3075}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 121, col: 13, offset: 3075}, name: "InsertWithColumnClause", }, &ruleRefExpr{ pos: position{line: 121, col: 38, offset: 3100}, name: "InsertWithDefaultClause", }, }, }, }, }, }, }, }, { name: "InsertValue", pos: position{line: 140, col: 1, offset: 3594}, expr: &actionExpr{ pos: position{line: 141, col: 4, offset: 3609}, run: (*parser).callonInsertValue1, expr: &seqExpr{ pos: position{line: 141, col: 4, offset: 3609}, exprs: []interface{}{ &litMatcher{ pos: position{line: 141, col: 4, offset: 3609}, val: "(", ignoreCase: false, }, &ruleRefExpr{ pos: position{line: 141, col: 8, offset: 3613}, name: "_", }, &labeledExpr{ pos: position{line: 141, col: 10, offset: 3615}, label: "e", expr: &ruleRefExpr{ pos: position{line: 141, col: 12, offset: 3617}, name: "MultiExprWithDefault", }, }, &ruleRefExpr{ pos: position{line: 141, col: 33, offset: 3638}, name: "_", }, &litMatcher{ pos: position{line: 141, col: 35, offset: 3640}, val: ")", ignoreCase: false, }, }, }, }, }, { name: "CreateTableStmt", pos: position{line: 144, col: 1, offset: 3663}, expr: &actionExpr{ pos: position{line: 145, col: 4, offset: 3682}, run: (*parser).callonCreateTableStmt1, expr: &seqExpr{ pos: position{line: 145, col: 4, offset: 3682}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 145, col: 4, offset: 3682}, label: "v1", expr: &ruleRefExpr{ pos: position{line: 145, col: 7, offset: 3685}, name: "CreateToken", }, }, &labeledExpr{ pos: position{line: 145, col: 19, offset: 3697}, label: "v2", expr: &ruleRefExpr{ pos: position{line: 145, col: 22, offset: 3700}, name: "_", }, }, &labeledExpr{ pos: position{line: 145, col: 24, offset: 3702}, label: "v3", expr: &ruleRefExpr{ pos: position{line: 145, col: 27, offset: 3705}, name: "TableToken", }, }, &ruleRefExpr{ pos: position{line: 146, col: 2, offset: 3717}, name: "_", }, &labeledExpr{ pos: position{line: 146, col: 4, offset: 3719}, label: "table", expr: &ruleRefExpr{ pos: position{line: 146, col: 10, offset: 3725}, name: "Identifier", }, }, &ruleRefExpr{ pos: position{line: 147, col: 2, offset: 3737}, name: "_", }, &litMatcher{ pos: position{line: 147, col: 4, offset: 3739}, val: "(", ignoreCase: false, }, &ruleRefExpr{ pos: position{line: 148, col: 2, offset: 3744}, name: "_", }, &labeledExpr{ pos: position{line: 148, col: 4, offset: 3746}, label: "column", expr: &zeroOrOneExpr{ pos: position{line: 148, col: 11, offset: 3753}, expr: &actionExpr{ pos: position{line: 149, col: 3, offset: 3757}, run: (*parser).callonCreateTableStmt17, expr: &seqExpr{ pos: position{line: 149, col: 3, offset: 3757}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 149, col: 3, offset: 3757}, label: "s", expr: &ruleRefExpr{ pos: position{line: 149, col: 5, offset: 3759}, name: "ColumnSchema", }, }, &labeledExpr{ pos: position{line: 150, col: 3, offset: 3774}, label: "ss", expr: &zeroOrMoreExpr{ pos: position{line: 150, col: 6, offset: 3777}, expr: &actionExpr{ pos: position{line: 150, col: 8, offset: 3779}, run: (*parser).callonCreateTableStmt23, expr: &seqExpr{ pos: position{line: 150, col: 8, offset: 3779}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 150, col: 8, offset: 3779}, name: "_", }, &ruleRefExpr{ pos: position{line: 150, col: 10, offset: 3781}, name: "SeparatorToken", }, &ruleRefExpr{ pos: position{line: 150, col: 25, offset: 3796}, name: "_", }, &labeledExpr{ pos: position{line: 150, col: 27, offset: 3798}, label: "t", expr: &ruleRefExpr{ pos: position{line: 150, col: 29, offset: 3800}, name: "ColumnSchema", }, }, }, }, }, }, }, }, }, }, }, }, &ruleRefExpr{ pos: position{line: 153, col: 2, offset: 3885}, name: "_", }, &litMatcher{ pos: position{line: 153, col: 4, offset: 3887}, val: ")", ignoreCase: false, }, }, }, }, }, { name: "ColumnSchema", pos: position{line: 169, col: 1, offset: 4348}, expr: &actionExpr{ pos: position{line: 170, col: 4, offset: 4364}, run: (*parser).callonColumnSchema1, expr: &seqExpr{ pos: position{line: 170, col: 4, offset: 4364}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 170, col: 4, offset: 4364}, label: "i", expr: &ruleRefExpr{ pos: position{line: 170, col: 6, offset: 4366}, name: "Identifier", }, }, &ruleRefExpr{ pos: position{line: 171, col: 2, offset: 4378}, name: "_", }, &labeledExpr{ pos: position{line: 171, col: 4, offset: 4380}, label: "t", expr: &ruleRefExpr{ pos: position{line: 171, col: 6, offset: 4382}, name: "DataType", }, }, &labeledExpr{ pos: position{line: 172, col: 2, offset: 4392}, label: "cs", expr: &zeroOrMoreExpr{ pos: position{line: 172, col: 5, offset: 4395}, expr: &actionExpr{ pos: position{line: 172, col: 7, offset: 4397}, run: (*parser).callonColumnSchema10, expr: &seqExpr{ pos: position{line: 172, col: 7, offset: 4397}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 172, col: 7, offset: 4397}, name: "_", }, &labeledExpr{ pos: position{line: 172, col: 9, offset: 4399}, label: "s", expr: &ruleRefExpr{ pos: position{line: 172, col: 11, offset: 4401}, name: "ColumnConstraint", }, }, }, }, }, }, }, }, }, }, }, { name: "ColumnConstraint", pos: position{line: 202, col: 1, offset: 5253}, expr: &choiceExpr{ pos: position{line: 203, col: 4, offset: 5273}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 203, col: 4, offset: 5273}, name: "PrimaryKeyClause", }, &ruleRefExpr{ pos: position{line: 204, col: 4, offset: 5293}, name: "NotNullClause", }, &ruleRefExpr{ pos: position{line: 205, col: 4, offset: 5310}, name: "UniqueClause", }, &ruleRefExpr{ pos: position{line: 206, col: 4, offset: 5326}, name: "DefaultClause", }, &ruleRefExpr{ pos: position{line: 207, col: 4, offset: 5343}, name: "ForeignClause", }, &ruleRefExpr{ pos: position{line: 208, col: 4, offset: 5360}, name: "AutoincrementClause", }, }, }, }, { name: "CreateIndexStmt", pos: position{line: 210, col: 1, offset: 5381}, expr: &actionExpr{ pos: position{line: 211, col: 4, offset: 5400}, run: (*parser).callonCreateIndexStmt1, expr: &seqExpr{ pos: position{line: 211, col: 4, offset: 5400}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 211, col: 4, offset: 5400}, label: "v1", expr: &ruleRefExpr{ pos: position{line: 211, col: 7, offset: 5403}, name: "CreateToken", }, }, &labeledExpr{ pos: position{line: 212, col: 2, offset: 5416}, label: "unique", expr: &zeroOrOneExpr{ pos: position{line: 212, col: 9, offset: 5423}, expr: &actionExpr{ pos: position{line: 212, col: 11, offset: 5425}, run: (*parser).callonCreateIndexStmt7, expr: &seqExpr{ pos: position{line: 212, col: 11, offset: 5425}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 212, col: 11, offset: 5425}, name: "_", }, &labeledExpr{ pos: position{line: 212, col: 13, offset: 5427}, label: "u", expr: &ruleRefExpr{ pos: position{line: 212, col: 15, offset: 5429}, name: "UniqueClause", }, }, }, }, }, }, }, &labeledExpr{ pos: position{line: 213, col: 2, offset: 5464}, label: "v2", expr: &ruleRefExpr{ pos: position{line: 213, col: 5, offset: 5467}, name: "_", }, }, &labeledExpr{ pos: position{line: 213, col: 7, offset: 5469}, label: "v3", expr: &ruleRefExpr{ pos: position{line: 213, col: 10, offset: 5472}, name: "IndexToken", }, }, &ruleRefExpr{ pos: position{line: 214, col: 2, offset: 5484}, name: "_", }, &labeledExpr{ pos: position{line: 214, col: 4, offset: 5486}, label: "index", expr: &ruleRefExpr{ pos: position{line: 214, col: 10, offset: 5492}, name: "Identifier", }, }, &ruleRefExpr{ pos: position{line: 215, col: 2, offset: 5504}, name: "_", }, &ruleRefExpr{ pos: position{line: 215, col: 4, offset: 5506}, name: "OnToken", }, &ruleRefExpr{ pos: position{line: 216, col: 2, offset: 5515}, name: "_", }, &labeledExpr{ pos: position{line: 216, col: 4, offset: 5517}, label: "table", expr: &ruleRefExpr{ pos: position{line: 216, col: 10, offset: 5523}, name: "Identifier", }, }, &ruleRefExpr{ pos: position{line: 217, col: 2, offset: 5535}, name: "_", }, &litMatcher{ pos: position{line: 217, col: 4, offset: 5537}, val: "(", ignoreCase: false, }, &ruleRefExpr{ pos: position{line: 217, col: 8, offset: 5541}, name: "_", }, &labeledExpr{ pos: position{line: 217, col: 10, offset: 5543}, label: "i", expr: &ruleRefExpr{ pos: position{line: 217, col: 12, offset: 5545}, name: "Identifier", }, }, &labeledExpr{ pos: position{line: 217, col: 23, offset: 5556}, label: "is", expr: &zeroOrMoreExpr{ pos: position{line: 217, col: 26, offset: 5559}, expr: &actionExpr{ pos: position{line: 217, col: 28, offset: 5561}, run: (*parser).callonCreateIndexStmt31, expr: &seqExpr{ pos: position{line: 217, col: 28, offset: 5561}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 217, col: 28, offset: 5561}, name: "_", }, &ruleRefExpr{ pos: position{line: 217, col: 30, offset: 5563}, name: "SeparatorToken", }, &ruleRefExpr{ pos: position{line: 217, col: 45, offset: 5578}, name: "_", }, &labeledExpr{ pos: position{line: 217, col: 47, offset: 5580}, label: "x", expr: &ruleRefExpr{ pos: position{line: 217, col: 49, offset: 5582}, name: "Identifier", }, }, }, }, }, }, }, &ruleRefExpr{ pos: position{line: 217, col: 81, offset: 5614}, name: "_", }, &litMatcher{ pos: position{line: 217, col: 83, offset: 5616}, val: ")", ignoreCase: false, }, }, }, }, }, { name: "WhereClause", pos: position{line: 238, col: 1, offset: 6220}, expr: &actionExpr{ pos: position{line: 239, col: 4, offset: 6235}, run: (*parser).callonWhereClause1, expr: &seqExpr{ pos: position{line: 239, col: 4, offset: 6235}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 239, col: 4, offset: 6235}, name: "WhereToken", }, &ruleRefExpr{ pos: position{line: 239, col: 15, offset: 6246}, name: "_", }, &labeledExpr{ pos: position{line: 239, col: 17, offset: 6248}, label: "e", expr: &ruleRefExpr{ pos: position{line: 239, col: 19, offset: 6250}, name: "Expr", }, }, }, }, }, }, { name: "OrderByClause", pos: position{line: 248, col: 1, offset: 6422}, expr: &actionExpr{ pos: position{line: 249, col: 4, offset: 6439}, run: (*parser).callonOrderByClause1, expr: &seqExpr{ pos: position{line: 249, col: 4, offset: 6439}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 249, col: 4, offset: 6439}, name: "OrderToken", }, &ruleRefExpr{ pos: position{line: 250, col: 2, offset: 6451}, name: "_", }, &ruleRefExpr{ pos: position{line: 250, col: 4, offset: 6453}, name: "ByToken", }, &ruleRefExpr{ pos: position{line: 251, col: 2, offset: 6462}, name: "_", }, &labeledExpr{ pos: position{line: 251, col: 4, offset: 6464}, label: "f", expr: &ruleRefExpr{ pos: position{line: 251, col: 6, offset: 6466}, name: "OrderColumn", }, }, &labeledExpr{ pos: position{line: 252, col: 2, offset: 6479}, label: "fs", expr: &zeroOrMoreExpr{ pos: position{line: 252, col: 5, offset: 6482}, expr: &actionExpr{ pos: position{line: 252, col: 7, offset: 6484}, run: (*parser).callonOrderByClause11, expr: &seqExpr{ pos: position{line: 252, col: 7, offset: 6484}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 252, col: 7, offset: 6484}, name: "_", }, &ruleRefExpr{ pos: position{line: 252, col: 9, offset: 6486}, name: "SeparatorToken", }, &ruleRefExpr{ pos: position{line: 252, col: 24, offset: 6501}, name: "_", }, &labeledExpr{ pos: position{line: 252, col: 26, offset: 6503}, label: "s", expr: &ruleRefExpr{ pos: position{line: 252, col: 28, offset: 6505}, name: "OrderColumn", }, }, }, }, }, }, }, }, }, }, }, { name: "OrderColumn", pos: position{line: 257, col: 1, offset: 6584}, expr: &actionExpr{ pos: position{line: 258, col: 4, offset: 6599}, run: (*parser).callonOrderColumn1, expr: &seqExpr{ pos: position{line: 258, col: 4, offset: 6599}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 258, col: 4, offset: 6599}, label: "i", expr: &ruleRefExpr{ pos: position{line: 258, col: 6, offset: 6601}, name: "Expr", }, }, &labeledExpr{ pos: position{line: 259, col: 2, offset: 6607}, label: "s", expr: &zeroOrOneExpr{ pos: position{line: 259, col: 4, offset: 6609}, expr: &actionExpr{ pos: position{line: 259, col: 6, offset: 6611}, run: (*parser).callonOrderColumn7, expr: &seqExpr{ pos: position{line: 259, col: 6, offset: 6611}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 259, col: 6, offset: 6611}, name: "_", }, &labeledExpr{ pos: position{line: 259, col: 8, offset: 6613}, label: "t", expr: &choiceExpr{ pos: position{line: 259, col: 12, offset: 6617}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 259, col: 12, offset: 6617}, name: "AscToken", }, &ruleRefExpr{ pos: position{line: 259, col: 23, offset: 6628}, name: "DescToken", }, }, }, }, }, }, }, }, }, &labeledExpr{ pos: position{line: 260, col: 2, offset: 6662}, label: "n", expr: &zeroOrOneExpr{ pos: position{line: 260, col: 4, offset: 6664}, expr: &actionExpr{ pos: position{line: 260, col: 6, offset: 6666}, run: (*parser).callonOrderColumn16, expr: &seqExpr{ pos: position{line: 260, col: 6, offset: 6666}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 260, col: 6, offset: 6666}, name: "_", }, &ruleRefExpr{ pos: position{line: 260, col: 8, offset: 6668}, name: "NullsToken", }, &ruleRefExpr{ pos: position{line: 260, col: 19, offset: 6679}, name: "_", }, &labeledExpr{ pos: position{line: 260, col: 21, offset: 6681}, label: "l", expr: &choiceExpr{ pos: position{line: 260, col: 25, offset: 6685}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 260, col: 25, offset: 6685}, name: "LastToken", }, &ruleRefExpr{ pos: position{line: 260, col: 37, offset: 6697}, name: "FirstToken", }, }, }, }, }, }, }, }, }, }, }, }, }, { name: "GroupByClause", pos: position{line: 271, col: 1, offset: 7038}, expr: &actionExpr{ pos: position{line: 272, col: 4, offset: 7055}, run: (*parser).callonGroupByClause1, expr: &seqExpr{ pos: position{line: 272, col: 4, offset: 7055}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 272, col: 4, offset: 7055}, name: "GroupToken", }, &ruleRefExpr{ pos: position{line: 273, col: 2, offset: 7067}, name: "_", }, &ruleRefExpr{ pos: position{line: 273, col: 4, offset: 7069}, name: "ByToken", }, &ruleRefExpr{ pos: position{line: 274, col: 2, offset: 7078}, name: "_", }, &labeledExpr{ pos: position{line: 274, col: 4, offset: 7080}, label: "f", expr: &ruleRefExpr{ pos: position{line: 274, col: 6, offset: 7082}, name: "GroupColumn", }, }, &labeledExpr{ pos: position{line: 275, col: 2, offset: 7095}, label: "fs", expr: &zeroOrMoreExpr{ pos: position{line: 275, col: 5, offset: 7098}, expr: &actionExpr{ pos: position{line: 275, col: 7, offset: 7100}, run: (*parser).callonGroupByClause11, expr: &seqExpr{ pos: position{line: 275, col: 7, offset: 7100}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 275, col: 7, offset: 7100}, name: "_", }, &ruleRefExpr{ pos: position{line: 275, col: 9, offset: 7102}, name: "SeparatorToken", }, &ruleRefExpr{ pos: position{line: 275, col: 24, offset: 7117}, name: "_", }, &labeledExpr{ pos: position{line: 275, col: 26, offset: 7119}, label: "s", expr: &ruleRefExpr{ pos: position{line: 275, col: 28, offset: 7121}, name: "GroupColumn", }, }, }, }, }, }, }, }, }, }, }, { name: "GroupColumn", pos: position{line: 280, col: 1, offset: 7200}, expr: &actionExpr{ pos: position{line: 281, col: 4, offset: 7215}, run: (*parser).callonGroupColumn1, expr: &labeledExpr{ pos: position{line: 281, col: 4, offset: 7215}, label: "i", expr: &ruleRefExpr{ pos: position{line: 281, col: 6, offset: 7217}, name: "Expr", }, }, }, }, { name: "OffsetClause", pos: position{line: 290, col: 1, offset: 7384}, expr: &actionExpr{ pos: position{line: 291, col: 4, offset: 7400}, run: (*parser).callonOffsetClause1, expr: &seqExpr{ pos: position{line: 291, col: 4, offset: 7400}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 291, col: 4, offset: 7400}, name: "OffsetToken", }, &ruleRefExpr{ pos: position{line: 291, col: 16, offset: 7412}, name: "_", }, &labeledExpr{ pos: position{line: 291, col: 18, offset: 7414}, label: "i", expr: &ruleRefExpr{ pos: position{line: 291, col: 20, offset: 7416}, name: "IntegerLiteral", }, }, }, }, }, }, { name: "LimitClause", pos: position{line: 300, col: 1, offset: 7604}, expr: &actionExpr{ pos: position{line: 301, col: 4, offset: 7619}, run: (*parser).callonLimitClause1, expr: &seqExpr{ pos: position{line: 301, col: 4, offset: 7619}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 301, col: 4, offset: 7619}, name: "LimitToken", }, &ruleRefExpr{ pos: position{line: 301, col: 15, offset: 7630}, name: "_", }, &labeledExpr{ pos: position{line: 301, col: 17, offset: 7632}, label: "i", expr: &ruleRefExpr{ pos: position{line: 301, col: 19, offset: 7634}, name: "IntegerLiteral", }, }, }, }, }, }, { name: "InsertWithColumnClause", pos: position{line: 310, col: 1, offset: 7821}, expr: &actionExpr{ pos: position{line: 311, col: 4, offset: 7847}, run: (*parser).callonInsertWithColumnClause1, expr: &seqExpr{ pos: position{line: 311, col: 4, offset: 7847}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 311, col: 4, offset: 7847}, label: "cs", expr: &zeroOrOneExpr{ pos: position{line: 311, col: 7, offset: 7850}, expr: &actionExpr{ pos: position{line: 311, col: 9, offset: 7852}, run: (*parser).callonInsertWithColumnClause5, expr: &seqExpr{ pos: position{line: 311, col: 9, offset: 7852}, exprs: []interface{}{ &litMatcher{ pos: position{line: 311, col: 9, offset: 7852}, val: "(", ignoreCase: false, }, &ruleRefExpr{ pos: position{line: 312, col: 4, offset: 7859}, name: "_", }, &labeledExpr{ pos: position{line: 312, col: 6, offset: 7861}, label: "f", expr: &ruleRefExpr{ pos: position{line: 312, col: 8, offset: 7863}, name: "Identifier", }, }, &labeledExpr{ pos: position{line: 313, col: 4, offset: 7877}, label: "fs", expr: &zeroOrMoreExpr{ pos: position{line: 313, col: 7, offset: 7880}, expr: &actionExpr{ pos: position{line: 313, col: 9, offset: 7882}, run: (*parser).callonInsertWithColumnClause13, expr: &seqExpr{ pos: position{line: 313, col: 9, offset: 7882}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 313, col: 9, offset: 7882}, name: "_", }, &ruleRefExpr{ pos: position{line: 313, col: 11, offset: 7884}, name: "SeparatorToken", }, &ruleRefExpr{ pos: position{line: 313, col: 26, offset: 7899}, name: "_", }, &labeledExpr{ pos: position{line: 313, col: 28, offset: 7901}, label: "x", expr: &ruleRefExpr{ pos: position{line: 313, col: 30, offset: 7903}, name: "Identifier", }, }, }, }, }, }, }, &ruleRefExpr{ pos: position{line: 314, col: 4, offset: 7938}, name: "_", }, &litMatcher{ pos: position{line: 314, col: 6, offset: 7940}, val: ")", ignoreCase: false, }, &ruleRefExpr{ pos: position{line: 315, col: 4, offset: 7947}, name: "_", }, }, }, }, }, }, &ruleRefExpr{ pos: position{line: 317, col: 3, offset: 8000}, name: "ValuesToken", }, &ruleRefExpr{ pos: position{line: 318, col: 2, offset: 8013}, name: "_", }, &labeledExpr{ pos: position{line: 318, col: 4, offset: 8015}, label: "v", expr: &ruleRefExpr{ pos: position{line: 318, col: 6, offset: 8017}, name: "InsertValue", }, }, &labeledExpr{ pos: position{line: 319, col: 2, offset: 8030}, label: "vs", expr: &zeroOrMoreExpr{ pos: position{line: 319, col: 5, offset: 8033}, expr: &actionExpr{ pos: position{line: 319, col: 7, offset: 8035}, run: (*parser).callonInsertWithColumnClause29, expr: &seqExpr{ pos: position{line: 319, col: 7, offset: 8035}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 319, col: 7, offset: 8035}, name: "_", }, &ruleRefExpr{ pos: position{line: 319, col: 9, offset: 8037}, name: "SeparatorToken", }, &ruleRefExpr{ pos: position{line: 319, col: 24, offset: 8052}, name: "_", }, &labeledExpr{ pos: position{line: 319, col: 26, offset: 8054}, label: "y", expr: &ruleRefExpr{ pos: position{line: 319, col: 28, offset: 8056}, name: "InsertValue", }, }, }, }, }, }, }, }, }, }, }, { name: "InsertWithDefaultClause", pos: position{line: 338, col: 1, offset: 8632}, expr: &actionExpr{ pos: position{line: 339, col: 4, offset: 8659}, run: (*parser).callonInsertWithDefaultClause1, expr: &seqExpr{ pos: position{line: 339, col: 4, offset: 8659}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 339, col: 4, offset: 8659}, name: "DefaultToken", }, &ruleRefExpr{ pos: position{line: 339, col: 17, offset: 8672}, name: "_", }, &ruleRefExpr{ pos: position{line: 339, col: 19, offset: 8674}, name: "ValuesToken", }, }, }, }, }, { name: "PrimaryKeyClause", pos: position{line: 347, col: 1, offset: 8830}, expr: &actionExpr{ pos: position{line: 348, col: 4, offset: 8850}, run: (*parser).callonPrimaryKeyClause1, expr: &seqExpr{ pos: position{line: 348, col: 4, offset: 8850}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 348, col: 4, offset: 8850}, name: "PrimaryToken", }, &ruleRefExpr{ pos: position{line: 348, col: 17, offset: 8863}, name: "_", }, &ruleRefExpr{ pos: position{line: 348, col: 19, offset: 8865}, name: "KeyToken", }, }, }, }, }, { name: "NotNullClause", pos: position{line: 356, col: 1, offset: 9008}, expr: &actionExpr{ pos: position{line: 357, col: 4, offset: 9025}, run: (*parser).callonNotNullClause1, expr: &seqExpr{ pos: position{line: 357, col: 4, offset: 9025}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 357, col: 4, offset: 9025}, name: "NotToken", }, &ruleRefExpr{ pos: position{line: 357, col: 13, offset: 9034}, name: "_", }, &ruleRefExpr{ pos: position{line: 357, col: 15, offset: 9036}, name: "NullToken", }, }, }, }, }, { name: "UniqueClause", pos: position{line: 365, col: 1, offset: 9180}, expr: &actionExpr{ pos: position{line: 366, col: 4, offset: 9196}, run: (*parser).callonUniqueClause1, expr: &ruleRefExpr{ pos: position{line: 366, col: 4, offset: 9196}, name: "UniqueToken", }, }, }, { name: "DefaultClause", pos: position{line: 374, col: 1, offset: 9341}, expr: &actionExpr{ pos: position{line: 375, col: 4, offset: 9358}, run: (*parser).callonDefaultClause1, expr: &seqExpr{ pos: position{line: 375, col: 4, offset: 9358}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 375, col: 4, offset: 9358}, name: "DefaultToken", }, &ruleRefExpr{ pos: position{line: 375, col: 17, offset: 9371}, name: "_", }, &labeledExpr{ pos: position{line: 375, col: 19, offset: 9373}, label: "e", expr: &ruleRefExpr{ pos: position{line: 375, col: 21, offset: 9375}, name: "Expr", }, }, }, }, }, }, { name: "ForeignClause", pos: position{line: 384, col: 1, offset: 9545}, expr: &actionExpr{ pos: position{line: 385, col: 4, offset: 9562}, run: (*parser).callonForeignClause1, expr: &seqExpr{ pos: position{line: 385, col: 4, offset: 9562}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 385, col: 4, offset: 9562}, name: "ReferencesToken", }, &ruleRefExpr{ pos: position{line: 385, col: 20, offset: 9578}, name: "_", }, &labeledExpr{ pos: position{line: 385, col: 22, offset: 9580}, label: "t", expr: &ruleRefExpr{ pos: position{line: 385, col: 24, offset: 9582}, name: "Identifier", }, }, &ruleRefExpr{ pos: position{line: 385, col: 35, offset: 9593}, name: "_", }, &litMatcher{ pos: position{line: 385, col: 37, offset: 9595}, val: "(", ignoreCase: false, }, &ruleRefExpr{ pos: position{line: 385, col: 41, offset: 9599}, name: "_", }, &labeledExpr{ pos: position{line: 385, col: 43, offset: 9601}, label: "f", expr: &ruleRefExpr{ pos: position{line: 385, col: 45, offset: 9603}, name: "Identifier", }, }, &ruleRefExpr{ pos: position{line: 385, col: 56, offset: 9614}, name: "_", }, &litMatcher{ pos: position{line: 385, col: 58, offset: 9616}, val: ")", ignoreCase: false, }, }, }, }, }, { name: "AutoincrementClause", pos: position{line: 395, col: 1, offset: 9831}, expr: &actionExpr{ pos: position{line: 396, col: 4, offset: 9854}, run: (*parser).callonAutoincrementClause1, expr: &ruleRefExpr{ pos: position{line: 396, col: 4, offset: 9854}, name: "AutoincrementToken", }, }, }, { name: "Expr", pos: position{line: 405, col: 1, offset: 10031}, expr: &ruleRefExpr{ pos: position{line: 406, col: 4, offset: 10039}, name: "LogicExpr", }, }, { name: "ExprWithDefault", pos: position{line: 408, col: 1, offset: 10050}, expr: &choiceExpr{ pos: position{line: 409, col: 4, offset: 10069}, alternatives: []interface{}{ &actionExpr{ pos: position{line: 409, col: 4, offset: 10069}, run: (*parser).callonExprWithDefault2, expr: &seqExpr{ pos: position{line: 409, col: 4, offset: 10069}, exprs: []interface{}{ &andExpr{ pos: position{line: 409, col: 4, offset: 10069}, expr: &ruleRefExpr{ pos: position{line: 409, col: 6, offset: 10071}, name: "DefaultLiteral", }, }, &labeledExpr{ pos: position{line: 409, col: 22, offset: 10087}, label: "d", expr: &ruleRefExpr{ pos: position{line: 409, col: 24, offset: 10089}, name: "DefaultLiteral", }, }, }, }, }, &ruleRefExpr{ pos: position{line: 410, col: 4, offset: 10125}, name: "Expr", }, }, }, }, { name: "LogicExpr", pos: position{line: 412, col: 1, offset: 10131}, expr: &ruleRefExpr{ pos: position{line: 413, col: 4, offset: 10144}, name: "LogicExpr4", }, }, { name: "LogicExpr4", pos: position{line: 415, col: 1, offset: 10156}, expr: &actionExpr{ pos: position{line: 416, col: 4, offset: 10170}, run: (*parser).callonLogicExpr41, expr: &seqExpr{ pos: position{line: 416, col: 4, offset: 10170}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 416, col: 4, offset: 10170}, label: "o", expr: &ruleRefExpr{ pos: position{line: 416, col: 6, offset: 10172}, name: "LogicExpr3", }, }, &labeledExpr{ pos: position{line: 417, col: 3, offset: 10185}, label: "os", expr: &zeroOrMoreExpr{ pos: position{line: 417, col: 6, offset: 10188}, expr: &actionExpr{ pos: position{line: 417, col: 8, offset: 10190}, run: (*parser).callonLogicExpr47, expr: &seqExpr{ pos: position{line: 417, col: 8, offset: 10190}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 417, col: 8, offset: 10190}, name: "_", }, &labeledExpr{ pos: position{line: 417, col: 10, offset: 10192}, label: "op", expr: &ruleRefExpr{ pos: position{line: 417, col: 13, offset: 10195}, name: "OrOperator", }, }, &ruleRefExpr{ pos: position{line: 417, col: 24, offset: 10206}, name: "_", }, &labeledExpr{ pos: position{line: 417, col: 26, offset: 10208}, label: "s", expr: &ruleRefExpr{ pos: position{line: 417, col: 28, offset: 10210}, name: "LogicExpr3", }, }, }, }, }, }, }, }, }, }, }, { name: "LogicExpr3", pos: position{line: 421, col: 1, offset: 10373}, expr: &actionExpr{ pos: position{line: 422, col: 4, offset: 10387}, run: (*parser).callonLogicExpr31, expr: &seqExpr{ pos: position{line: 422, col: 4, offset: 10387}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 422, col: 4, offset: 10387}, label: "o", expr: &ruleRefExpr{ pos: position{line: 422, col: 6, offset: 10389}, name: "LogicExpr2", }, }, &labeledExpr{ pos: position{line: 423, col: 3, offset: 10402}, label: "os", expr: &zeroOrMoreExpr{ pos: position{line: 423, col: 6, offset: 10405}, expr: &actionExpr{ pos: position{line: 423, col: 8, offset: 10407}, run: (*parser).callonLogicExpr37, expr: &seqExpr{ pos: position{line: 423, col: 8, offset: 10407}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 423, col: 8, offset: 10407}, name: "_", }, &labeledExpr{ pos: position{line: 423, col: 10, offset: 10409}, label: "op", expr: &ruleRefExpr{ pos: position{line: 423, col: 13, offset: 10412}, name: "AndOperator", }, }, &ruleRefExpr{ pos: position{line: 423, col: 25, offset: 10424}, name: "_", }, &labeledExpr{ pos: position{line: 423, col: 27, offset: 10426}, label: "s", expr: &ruleRefExpr{ pos: position{line: 423, col: 29, offset: 10428}, name: "LogicExpr2", }, }, }, }, }, }, }, }, }, }, }, { name: "LogicExpr2", pos: position{line: 427, col: 1, offset: 10591}, expr: &choiceExpr{ pos: position{line: 428, col: 4, offset: 10605}, alternatives: []interface{}{ &actionExpr{ pos: position{line: 428, col: 4, offset: 10605}, run: (*parser).callonLogicExpr22, expr: &seqExpr{ pos: position{line: 428, col: 4, offset: 10605}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 428, col: 4, offset: 10605}, label: "op", expr: &ruleRefExpr{ pos: position{line: 428, col: 7, offset: 10608}, name: "NotOperator", }, }, &ruleRefExpr{ pos: position{line: 428, col: 19, offset: 10620}, name: "_", }, &labeledExpr{ pos: position{line: 428, col: 21, offset: 10622}, label: "s", expr: &ruleRefExpr{ pos: position{line: 428, col: 23, offset: 10624}, name: "LogicExpr2", }, }, }, }, }, &ruleRefExpr{ pos: position{line: 430, col: 4, offset: 10709}, name: "LogicExpr1", }, }, }, }, { name: "LogicExpr1", pos: position{line: 432, col: 1, offset: 10721}, expr: &actionExpr{ pos: position{line: 433, col: 4, offset: 10735}, run: (*parser).callonLogicExpr11, expr: &seqExpr{ pos: position{line: 433, col: 4, offset: 10735}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 433, col: 4, offset: 10735}, label: "o", expr: &ruleRefExpr{ pos: position{line: 433, col: 6, offset: 10737}, name: "ArithmeticExpr", }, }, &labeledExpr{ pos: position{line: 433, col: 21, offset: 10752}, label: "os", expr: &zeroOrMoreExpr{ pos: position{line: 433, col: 24, offset: 10755}, expr: &actionExpr{ pos: position{line: 433, col: 26, offset: 10757}, run: (*parser).callonLogicExpr17, expr: &seqExpr{ pos: position{line: 433, col: 26, offset: 10757}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 433, col: 26, offset: 10757}, name: "_", }, &labeledExpr{ pos: position{line: 433, col: 28, offset: 10759}, label: "l", expr: &ruleRefExpr{ pos: position{line: 433, col: 30, offset: 10761}, name: "LogicExpr1Op", }, }, }, }, }, }, }, }, }, }, }, { name: "LogicExpr1Op", pos: position{line: 436, col: 1, offset: 10870}, expr: &choiceExpr{ pos: position{line: 437, col: 4, offset: 10886}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 437, col: 4, offset: 10886}, name: "LogicExpr1In", }, &ruleRefExpr{ pos: position{line: 438, col: 4, offset: 10902}, name: "LogicExpr1Is", }, &ruleRefExpr{ pos: position{line: 439, col: 4, offset: 10918}, name: "LogicExpr1Like", }, &ruleRefExpr{ pos: position{line: 440, col: 4, offset: 10936}, name: "LogicExpr1Cmp", }, }, }, }, { name: "LogicExpr1In", pos: position{line: 442, col: 1, offset: 10951}, expr: &actionExpr{ pos: position{line: 443, col: 4, offset: 10967}, run: (*parser).callonLogicExpr1In1, expr: &seqExpr{ pos: position{line: 443, col: 4, offset: 10967}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 443, col: 4, offset: 10967}, label: "n", expr: &zeroOrOneExpr{ pos: position{line: 443, col: 6, offset: 10969}, expr: &actionExpr{ pos: position{line: 443, col: 8, offset: 10971}, run: (*parser).callonLogicExpr1In5, expr: &seqExpr{ pos: position{line: 443, col: 8, offset: 10971}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 443, col: 8, offset: 10971}, label: "t", expr: &ruleRefExpr{ pos: position{line: 443, col: 10, offset: 10973}, name: "NotOperator", }, }, &ruleRefExpr{ pos: position{line: 443, col: 22, offset: 10985}, name: "_", }, }, }, }, }, }, &ruleRefExpr{ pos: position{line: 443, col: 45, offset: 11008}, name: "InToken", }, &ruleRefExpr{ pos: position{line: 443, col: 53, offset: 11016}, name: "_", }, &litMatcher{ pos: position{line: 443, col: 55, offset: 11018}, val: "(", ignoreCase: false, }, &ruleRefExpr{ pos: position{line: 443, col: 59, offset: 11022}, name: "_", }, &labeledExpr{ pos: position{line: 443, col: 61, offset: 11024}, label: "s", expr: &ruleRefExpr{ pos: position{line: 443, col: 63, offset: 11026}, name: "MultiExpr", }, }, &ruleRefExpr{ pos: position{line: 443, col: 73, offset: 11036}, name: "_", }, &litMatcher{ pos: position{line: 443, col: 75, offset: 11038}, val: ")", ignoreCase: false, }, }, }, }, }, { name: "LogicExpr1Is", pos: position{line: 455, col: 1, offset: 11279}, expr: &actionExpr{ pos: position{line: 456, col: 4, offset: 11295}, run: (*parser).callonLogicExpr1Is1, expr: &seqExpr{ pos: position{line: 456, col: 4, offset: 11295}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 456, col: 4, offset: 11295}, name: "IsToken", }, &labeledExpr{ pos: position{line: 456, col: 12, offset: 11303}, label: "n", expr: &zeroOrOneExpr{ pos: position{line: 456, col: 14, offset: 11305}, expr: &actionExpr{ pos: position{line: 456, col: 16, offset: 11307}, run: (*parser).callonLogicExpr1Is6, expr: &seqExpr{ pos: position{line: 456, col: 16, offset: 11307}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 456, col: 16, offset: 11307}, name: "_", }, &labeledExpr{ pos: position{line: 456, col: 18, offset: 11309}, label: "t", expr: &ruleRefExpr{ pos: position{line: 456, col: 20, offset: 11311}, name: "NotOperator", }, }, }, }, }, }, }, &ruleRefExpr{ pos: position{line: 456, col: 53, offset: 11344}, name: "_", }, &labeledExpr{ pos: position{line: 456, col: 55, offset: 11346}, label: "u", expr: &ruleRefExpr{ pos: position{line: 456, col: 57, offset: 11348}, name: "NullLiteral", }, }, }, }, }, }, { name: "LogicExpr1Like", pos: position{line: 468, col: 1, offset: 11608}, expr: &actionExpr{ pos: position{line: 469, col: 4, offset: 11626}, run: (*parser).callonLogicExpr1Like1, expr: &seqExpr{ pos: position{line: 469, col: 4, offset: 11626}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 469, col: 4, offset: 11626}, label: "n", expr: &zeroOrOneExpr{ pos: position{line: 469, col: 6, offset: 11628}, expr: &actionExpr{ pos: position{line: 469, col: 8, offset: 11630}, run: (*parser).callonLogicExpr1Like5, expr: &seqExpr{ pos: position{line: 469, col: 8, offset: 11630}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 469, col: 8, offset: 11630}, label: "t", expr: &ruleRefExpr{ pos: position{line: 469, col: 10, offset: 11632}, name: "NotOperator", }, }, &ruleRefExpr{ pos: position{line: 469, col: 22, offset: 11644}, name: "_", }, }, }, }, }, }, &ruleRefExpr{ pos: position{line: 469, col: 45, offset: 11667}, name: "LikeToken", }, &ruleRefExpr{ pos: position{line: 469, col: 55, offset: 11677}, name: "_", }, &labeledExpr{ pos: position{line: 469, col: 57, offset: 11679}, label: "s", expr: &ruleRefExpr{ pos: position{line: 469, col: 59, offset: 11681}, name: "Expr", }, }, &labeledExpr{ pos: position{line: 470, col: 2, offset: 11687}, label: "escape", expr: &zeroOrOneExpr{ pos: position{line: 470, col: 9, offset: 11694}, expr: &actionExpr{ pos: position{line: 470, col: 11, offset: 11696}, run: (*parser).callonLogicExpr1Like16, expr: &seqExpr{ pos: position{line: 470, col: 11, offset: 11696}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 470, col: 11, offset: 11696}, name: "_", }, &ruleRefExpr{ pos: position{line: 470, col: 13, offset: 11698}, name: "EscapeToken", }, &ruleRefExpr{ pos: position{line: 470, col: 25, offset: 11710}, name: "_", }, &labeledExpr{ pos: position{line: 470, col: 27, offset: 11712}, label: "e", expr: &ruleRefExpr{ pos: position{line: 470, col: 29, offset: 11714}, name: "Expr", }, }, }, }, }, }, }, }, }, }, }, { name: "LogicExpr1Cmp", pos: position{line: 485, col: 1, offset: 12045}, expr: &actionExpr{ pos: position{line: 486, col: 4, offset: 12062}, run: (*parser).callonLogicExpr1Cmp1, expr: &seqExpr{ pos: position{line: 486, col: 4, offset: 12062}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 486, col: 4, offset: 12062}, label: "op", expr: &ruleRefExpr{ pos: position{line: 486, col: 7, offset: 12065}, name: "CmpOperator", }, }, &ruleRefExpr{ pos: position{line: 486, col: 19, offset: 12077}, name: "_", }, &labeledExpr{ pos: position{line: 486, col: 21, offset: 12079}, label: "s", expr: &ruleRefExpr{ pos: position{line: 486, col: 23, offset: 12081}, name: "ArithmeticExpr", }, }, }, }, }, }, { name: "ArithmeticExpr", pos: position{line: 489, col: 1, offset: 12169}, expr: &ruleRefExpr{ pos: position{line: 490, col: 4, offset: 12187}, name: "ArithmeticExpr3", }, }, { name: "ArithmeticExpr3", pos: position{line: 492, col: 1, offset: 12204}, expr: &actionExpr{ pos: position{line: 493, col: 4, offset: 12223}, run: (*parser).callonArithmeticExpr31, expr: &seqExpr{ pos: position{line: 493, col: 4, offset: 12223}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 493, col: 4, offset: 12223}, label: "o", expr: &ruleRefExpr{ pos: position{line: 493, col: 6, offset: 12225}, name: "ArithmeticExpr2", }, }, &labeledExpr{ pos: position{line: 494, col: 3, offset: 12243}, label: "os", expr: &zeroOrMoreExpr{ pos: position{line: 494, col: 6, offset: 12246}, expr: &actionExpr{ pos: position{line: 494, col: 8, offset: 12248}, run: (*parser).callonArithmeticExpr37, expr: &seqExpr{ pos: position{line: 494, col: 8, offset: 12248}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 494, col: 8, offset: 12248}, name: "_", }, &labeledExpr{ pos: position{line: 494, col: 10, offset: 12250}, label: "op", expr: &ruleRefExpr{ pos: position{line: 494, col: 13, offset: 12253}, name: "ConcatOperator", }, }, &ruleRefExpr{ pos: position{line: 494, col: 28, offset: 12268}, name: "_", }, &labeledExpr{ pos: position{line: 494, col: 30, offset: 12270}, label: "s", expr: &ruleRefExpr{ pos: position{line: 494, col: 32, offset: 12272}, name: "ArithmeticExpr2", }, }, }, }, }, }, }, }, }, }, }, { name: "ArithmeticExpr2", pos: position{line: 498, col: 1, offset: 12440}, expr: &actionExpr{ pos: position{line: 499, col: 4, offset: 12459}, run: (*parser).callonArithmeticExpr21, expr: &seqExpr{ pos: position{line: 499, col: 4, offset: 12459}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 499, col: 4, offset: 12459}, label: "o", expr: &ruleRefExpr{ pos: position{line: 499, col: 6, offset: 12461}, name: "ArithmeticExpr1", }, }, &labeledExpr{ pos: position{line: 500, col: 3, offset: 12479}, label: "os", expr: &zeroOrMoreExpr{ pos: position{line: 500, col: 6, offset: 12482}, expr: &actionExpr{ pos: position{line: 500, col: 8, offset: 12484}, run: (*parser).callonArithmeticExpr27, expr: &seqExpr{ pos: position{line: 500, col: 8, offset: 12484}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 500, col: 8, offset: 12484}, name: "_", }, &labeledExpr{ pos: position{line: 500, col: 10, offset: 12486}, label: "op", expr: &ruleRefExpr{ pos: position{line: 500, col: 13, offset: 12489}, name: "AddSubOperator", }, }, &ruleRefExpr{ pos: position{line: 500, col: 28, offset: 12504}, name: "_", }, &labeledExpr{ pos: position{line: 500, col: 30, offset: 12506}, label: "s", expr: &ruleRefExpr{ pos: position{line: 500, col: 32, offset: 12508}, name: "ArithmeticExpr1", }, }, }, }, }, }, }, }, }, }, }, { name: "ArithmeticExpr1", pos: position{line: 504, col: 1, offset: 12676}, expr: &actionExpr{ pos: position{line: 505, col: 4, offset: 12695}, run: (*parser).callonArithmeticExpr11, expr: &seqExpr{ pos: position{line: 505, col: 4, offset: 12695}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 505, col: 4, offset: 12695}, label: "o", expr: &ruleRefExpr{ pos: position{line: 505, col: 6, offset: 12697}, name: "Operand", }, }, &labeledExpr{ pos: position{line: 506, col: 3, offset: 12707}, label: "os", expr: &zeroOrMoreExpr{ pos: position{line: 506, col: 6, offset: 12710}, expr: &actionExpr{ pos: position{line: 506, col: 8, offset: 12712}, run: (*parser).callonArithmeticExpr17, expr: &seqExpr{ pos: position{line: 506, col: 8, offset: 12712}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 506, col: 8, offset: 12712}, name: "_", }, &labeledExpr{ pos: position{line: 506, col: 10, offset: 12714}, label: "op", expr: &ruleRefExpr{ pos: position{line: 506, col: 13, offset: 12717}, name: "MulDivModOperator", }, }, &ruleRefExpr{ pos: position{line: 506, col: 31, offset: 12735}, name: "_", }, &labeledExpr{ pos: position{line: 506, col: 33, offset: 12737}, label: "s", expr: &ruleRefExpr{ pos: position{line: 506, col: 35, offset: 12739}, name: "Operand", }, }, }, }, }, }, }, }, }, }, }, { name: "MultiExpr", pos: position{line: 510, col: 1, offset: 12899}, expr: &actionExpr{ pos: position{line: 511, col: 4, offset: 12912}, run: (*parser).callonMultiExpr1, expr: &seqExpr{ pos: position{line: 511, col: 4, offset: 12912}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 511, col: 4, offset: 12912}, label: "x", expr: &ruleRefExpr{ pos: position{line: 511, col: 6, offset: 12914}, name: "Expr", }, }, &labeledExpr{ pos: position{line: 511, col: 11, offset: 12919}, label: "xs", expr: &zeroOrMoreExpr{ pos: position{line: 511, col: 14, offset: 12922}, expr: &actionExpr{ pos: position{line: 511, col: 16, offset: 12924}, run: (*parser).callonMultiExpr7, expr: &seqExpr{ pos: position{line: 511, col: 16, offset: 12924}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 511, col: 16, offset: 12924}, name: "_", }, &ruleRefExpr{ pos: position{line: 511, col: 18, offset: 12926}, name: "SeparatorToken", }, &ruleRefExpr{ pos: position{line: 511, col: 33, offset: 12941}, name: "_", }, &labeledExpr{ pos: position{line: 511, col: 35, offset: 12943}, label: "e", expr: &ruleRefExpr{ pos: position{line: 511, col: 37, offset: 12945}, name: "Expr", }, }, }, }, }, }, }, }, }, }, }, { name: "MultiExprWithDefault", pos: position{line: 514, col: 1, offset: 13033}, expr: &actionExpr{ pos: position{line: 515, col: 4, offset: 13057}, run: (*parser).callonMultiExprWithDefault1, expr: &seqExpr{ pos: position{line: 515, col: 4, offset: 13057}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 515, col: 4, offset: 13057}, label: "x", expr: &ruleRefExpr{ pos: position{line: 515, col: 6, offset: 13059}, name: "ExprWithDefault", }, }, &labeledExpr{ pos: position{line: 515, col: 22, offset: 13075}, label: "xs", expr: &zeroOrMoreExpr{ pos: position{line: 515, col: 25, offset: 13078}, expr: &actionExpr{ pos: position{line: 515, col: 27, offset: 13080}, run: (*parser).callonMultiExprWithDefault7, expr: &seqExpr{ pos: position{line: 515, col: 27, offset: 13080}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 515, col: 27, offset: 13080}, name: "_", }, &ruleRefExpr{ pos: position{line: 515, col: 29, offset: 13082}, name: "SeparatorToken", }, &ruleRefExpr{ pos: position{line: 515, col: 44, offset: 13097}, name: "_", }, &labeledExpr{ pos: position{line: 515, col: 46, offset: 13099}, label: "e", expr: &ruleRefExpr{ pos: position{line: 515, col: 48, offset: 13101}, name: "ExprWithDefault", }, }, }, }, }, }, }, }, }, }, }, { name: "Operand", pos: position{line: 518, col: 1, offset: 13200}, expr: &choiceExpr{ pos: position{line: 519, col: 4, offset: 13211}, alternatives: []interface{}{ &actionExpr{ pos: position{line: 519, col: 4, offset: 13211}, run: (*parser).callonOperand2, expr: &seqExpr{ pos: position{line: 519, col: 4, offset: 13211}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 519, col: 4, offset: 13211}, label: "op", expr: &ruleRefExpr{ pos: position{line: 519, col: 7, offset: 13214}, name: "UnaryOperator", }, }, &ruleRefExpr{ pos: position{line: 519, col: 21, offset: 13228}, name: "_", }, &labeledExpr{ pos: position{line: 519, col: 23, offset: 13230}, label: "s", expr: &ruleRefExpr{ pos: position{line: 519, col: 25, offset: 13232}, name: "Operand", }, }, }, }, }, &actionExpr{ pos: position{line: 521, col: 4, offset: 13315}, run: (*parser).callonOperand9, expr: &seqExpr{ pos: position{line: 521, col: 4, offset: 13315}, exprs: []interface{}{ &litMatcher{ pos: position{line: 521, col: 4, offset: 13315}, val: "(", ignoreCase: false, }, &ruleRefExpr{ pos: position{line: 521, col: 8, offset: 13319}, name: "_", }, &labeledExpr{ pos: position{line: 521, col: 10, offset: 13321}, label: "e", expr: &ruleRefExpr{ pos: position{line: 521, col: 12, offset: 13323}, name: "Expr", }, }, &ruleRefExpr{ pos: position{line: 521, col: 17, offset: 13328}, name: "_", }, &litMatcher{ pos: position{line: 521, col: 19, offset: 13330}, val: ")", ignoreCase: false, }, }, }, }, &actionExpr{ pos: position{line: 529, col: 4, offset: 13521}, run: (*parser).callonOperand17, expr: &seqExpr{ pos: position{line: 529, col: 4, offset: 13521}, exprs: []interface{}{ &andExpr{ pos: position{line: 529, col: 4, offset: 13521}, expr: &ruleRefExpr{ pos: position{line: 529, col: 6, offset: 13523}, name: "CastToken", }, }, &labeledExpr{ pos: position{line: 529, col: 17, offset: 13534}, label: "t", expr: &ruleRefExpr{ pos: position{line: 529, col: 19, offset: 13536}, name: "TypeCast", }, }, }, }, }, &ruleRefExpr{ pos: position{line: 530, col: 4, offset: 13566}, name: "FunctionCall", }, &ruleRefExpr{ pos: position{line: 531, col: 4, offset: 13582}, name: "Value", }, &ruleRefExpr{ pos: position{line: 532, col: 4, offset: 13591}, name: "Identifier", }, }, }, }, { name: "TypeCast", pos: position{line: 534, col: 1, offset: 13603}, expr: &actionExpr{ pos: position{line: 535, col: 4, offset: 13615}, run: (*parser).callonTypeCast1, expr: &seqExpr{ pos: position{line: 535, col: 4, offset: 13615}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 535, col: 4, offset: 13615}, name: "CastToken", }, &ruleRefExpr{ pos: position{line: 535, col: 14, offset: 13625}, name: "_", }, &litMatcher{ pos: position{line: 535, col: 16, offset: 13627}, val: "(", ignoreCase: false, }, &ruleRefExpr{ pos: position{line: 535, col: 20, offset: 13631}, name: "_", }, &labeledExpr{ pos: position{line: 535, col: 22, offset: 13633}, label: "o", expr: &ruleRefExpr{ pos: position{line: 535, col: 24, offset: 13635}, name: "Expr", }, }, &ruleRefExpr{ pos: position{line: 535, col: 29, offset: 13640}, name: "_", }, &ruleRefExpr{ pos: position{line: 535, col: 31, offset: 13642}, name: "AsToken", }, &ruleRefExpr{ pos: position{line: 535, col: 39, offset: 13650}, name: "_", }, &labeledExpr{ pos: position{line: 535, col: 41, offset: 13652}, label: "s", expr: &ruleRefExpr{ pos: position{line: 535, col: 43, offset: 13654}, name: "DataType", }, }, &ruleRefExpr{ pos: position{line: 535, col: 52, offset: 13663}, name: "_", }, &litMatcher{ pos: position{line: 535, col: 54, offset: 13665}, val: ")", ignoreCase: false, }, }, }, }, }, { name: "FunctionCall", pos: position{line: 545, col: 1, offset: 13874}, expr: &actionExpr{ pos: position{line: 546, col: 4, offset: 13890}, run: (*parser).callonFunctionCall1, expr: &seqExpr{ pos: position{line: 546, col: 4, offset: 13890}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 546, col: 4, offset: 13890}, label: "i", expr: &ruleRefExpr{ pos: position{line: 546, col: 6, offset: 13892}, name: "Identifier", }, }, &ruleRefExpr{ pos: position{line: 546, col: 17, offset: 13903}, name: "_", }, &litMatcher{ pos: position{line: 546, col: 19, offset: 13905}, val: "(", ignoreCase: false, }, &ruleRefExpr{ pos: position{line: 546, col: 23, offset: 13909}, name: "_", }, &labeledExpr{ pos: position{line: 546, col: 25, offset: 13911}, label: "r", expr: &zeroOrOneExpr{ pos: position{line: 546, col: 27, offset: 13913}, expr: &ruleRefExpr{ pos: position{line: 546, col: 27, offset: 13913}, name: "FunctionArgs", }, }, }, &ruleRefExpr{ pos: position{line: 546, col: 41, offset: 13927}, name: "_", }, &litMatcher{ pos: position{line: 546, col: 43, offset: 13929}, val: ")", ignoreCase: false, }, }, }, }, }, { name: "FunctionArgs", pos: position{line: 558, col: 1, offset: 14158}, expr: &choiceExpr{ pos: position{line: 559, col: 4, offset: 14174}, alternatives: []interface{}{ &actionExpr{ pos: position{line: 559, col: 4, offset: 14174}, run: (*parser).callonFunctionArgs2, expr: &labeledExpr{ pos: position{line: 559, col: 4, offset: 14174}, label: "a", expr: &ruleRefExpr{ pos: position{line: 559, col: 6, offset: 14176}, name: "AnyLiteral", }, }, }, &ruleRefExpr{ pos: position{line: 560, col: 4, offset: 14244}, name: "MultiExpr", }, }, }, }, { name: "Assignment", pos: position{line: 562, col: 1, offset: 14255}, expr: &actionExpr{ pos: position{line: 563, col: 4, offset: 14269}, run: (*parser).callonAssignment1, expr: &seqExpr{ pos: position{line: 563, col: 4, offset: 14269}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 563, col: 4, offset: 14269}, label: "i", expr: &ruleRefExpr{ pos: position{line: 563, col: 6, offset: 14271}, name: "Identifier", }, }, &ruleRefExpr{ pos: position{line: 563, col: 17, offset: 14282}, name: "_", }, &litMatcher{ pos: position{line: 563, col: 19, offset: 14284}, val: "=", ignoreCase: false, }, &ruleRefExpr{ pos: position{line: 563, col: 23, offset: 14288}, name: "_", }, &labeledExpr{ pos: position{line: 563, col: 25, offset: 14290}, label: "e", expr: &ruleRefExpr{ pos: position{line: 563, col: 27, offset: 14292}, name: "ExprWithDefault", }, }, }, }, }, }, { name: "UnaryOperator", pos: position{line: 574, col: 1, offset: 14528}, expr: &ruleRefExpr{ pos: position{line: 575, col: 4, offset: 14545}, name: "SignOperator", }, }, { name: "SignOperator", pos: position{line: 577, col: 1, offset: 14559}, expr: &actionExpr{ pos: position{line: 578, col: 4, offset: 14575}, run: (*parser).callonSignOperator1, expr: &ruleRefExpr{ pos: position{line: 578, col: 4, offset: 14575}, name: "Sign", }, }, }, { name: "NotOperator", pos: position{line: 594, col: 1, offset: 14880}, expr: &actionExpr{ pos: position{line: 595, col: 4, offset: 14895}, run: (*parser).callonNotOperator1, expr: &ruleRefExpr{ pos: position{line: 595, col: 4, offset: 14895}, name: "NotToken", }, }, }, { name: "AndOperator", pos: position{line: 603, col: 1, offset: 15036}, expr: &actionExpr{ pos: position{line: 604, col: 4, offset: 15051}, run: (*parser).callonAndOperator1, expr: &ruleRefExpr{ pos: position{line: 604, col: 4, offset: 15051}, name: "AndToken", }, }, }, { name: "OrOperator", pos: position{line: 612, col: 1, offset: 15192}, expr: &actionExpr{ pos: position{line: 613, col: 4, offset: 15206}, run: (*parser).callonOrOperator1, expr: &ruleRefExpr{ pos: position{line: 613, col: 4, offset: 15206}, name: "OrToken", }, }, }, { name: "CmpOperator", pos: position{line: 621, col: 1, offset: 15345}, expr: &actionExpr{ pos: position{line: 622, col: 4, offset: 15360}, run: (*parser).callonCmpOperator1, expr: &choiceExpr{ pos: position{line: 622, col: 6, offset: 15362}, alternatives: []interface{}{ &litMatcher{ pos: position{line: 622, col: 6, offset: 15362}, val: "<=", ignoreCase: false, }, &litMatcher{ pos: position{line: 622, col: 13, offset: 15369}, val: ">=", ignoreCase: false, }, &litMatcher{ pos: position{line: 622, col: 20, offset: 15376}, val: "<>", ignoreCase: false, }, &litMatcher{ pos: position{line: 622, col: 27, offset: 15383}, val: "!=", ignoreCase: false, }, &charClassMatcher{ pos: position{line: 622, col: 34, offset: 15390}, val: "[<>=]", chars: []rune{'<', '>', '='}, ignoreCase: false, inverted: false, }, }, }, }, }, { name: "ConcatOperator", pos: position{line: 648, col: 1, offset: 15969}, expr: &actionExpr{ pos: position{line: 649, col: 4, offset: 15987}, run: (*parser).callonConcatOperator1, expr: &litMatcher{ pos: position{line: 649, col: 4, offset: 15987}, val: "||", ignoreCase: false, }, }, }, { name: "AddSubOperator", pos: position{line: 657, col: 1, offset: 16127}, expr: &actionExpr{ pos: position{line: 658, col: 4, offset: 16145}, run: (*parser).callonAddSubOperator1, expr: &charClassMatcher{ pos: position{line: 658, col: 4, offset: 16145}, val: "[+-]", chars: []rune{'+', '-'}, ignoreCase: false, inverted: false, }, }, }, { name: "MulDivModOperator", pos: position{line: 674, col: 1, offset: 16479}, expr: &actionExpr{ pos: position{line: 675, col: 4, offset: 16500}, run: (*parser).callonMulDivModOperator1, expr: &charClassMatcher{ pos: position{line: 675, col: 4, offset: 16500}, val: "[*/%]", chars: []rune{'*', '/', '%'}, ignoreCase: false, inverted: false, }, }, }, { name: "DataType", pos: position{line: 694, col: 1, offset: 16900}, expr: &choiceExpr{ pos: position{line: 695, col: 4, offset: 16912}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 695, col: 4, offset: 16912}, name: "UIntType", }, &ruleRefExpr{ pos: position{line: 696, col: 4, offset: 16924}, name: "IntType", }, &ruleRefExpr{ pos: position{line: 697, col: 4, offset: 16935}, name: "UFixedType", }, &ruleRefExpr{ pos: position{line: 698, col: 4, offset: 16949}, name: "FixedType", }, &ruleRefExpr{ pos: position{line: 699, col: 4, offset: 16962}, name: "FixedBytesType", }, &ruleRefExpr{ pos: position{line: 700, col: 4, offset: 16980}, name: "DynamicBytesType", }, &ruleRefExpr{ pos: position{line: 701, col: 4, offset: 17000}, name: "BoolType", }, &ruleRefExpr{ pos: position{line: 702, col: 4, offset: 17012}, name: "AddressType", }, }, }, }, { name: "UIntType", pos: position{line: 704, col: 1, offset: 17025}, expr: &actionExpr{ pos: position{line: 705, col: 4, offset: 17037}, run: (*parser).callonUIntType1, expr: &seqExpr{ pos: position{line: 705, col: 4, offset: 17037}, exprs: []interface{}{ &litMatcher{ pos: position{line: 705, col: 4, offset: 17037}, val: "uint", ignoreCase: true, }, &labeledExpr{ pos: position{line: 705, col: 12, offset: 17045}, label: "s", expr: &ruleRefExpr{ pos: position{line: 705, col: 14, offset: 17047}, name: "NonZeroLeadingInteger", }, }, ¬Expr{ pos: position{line: 705, col: 36, offset: 17069}, expr: &ruleRefExpr{ pos: position{line: 705, col: 37, offset: 17070}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "IntType", pos: position{line: 727, col: 1, offset: 17587}, expr: &actionExpr{ pos: position{line: 728, col: 4, offset: 17598}, run: (*parser).callonIntType1, expr: &seqExpr{ pos: position{line: 728, col: 4, offset: 17598}, exprs: []interface{}{ &litMatcher{ pos: position{line: 728, col: 4, offset: 17598}, val: "int", ignoreCase: true, }, &labeledExpr{ pos: position{line: 728, col: 11, offset: 17605}, label: "s", expr: &ruleRefExpr{ pos: position{line: 728, col: 13, offset: 17607}, name: "NonZeroLeadingInteger", }, }, ¬Expr{ pos: position{line: 728, col: 35, offset: 17629}, expr: &ruleRefExpr{ pos: position{line: 728, col: 36, offset: 17630}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "UFixedType", pos: position{line: 750, col: 1, offset: 18147}, expr: &actionExpr{ pos: position{line: 751, col: 4, offset: 18161}, run: (*parser).callonUFixedType1, expr: &seqExpr{ pos: position{line: 751, col: 4, offset: 18161}, exprs: []interface{}{ &litMatcher{ pos: position{line: 751, col: 4, offset: 18161}, val: "ufixed", ignoreCase: true, }, &labeledExpr{ pos: position{line: 751, col: 14, offset: 18171}, label: "s", expr: &ruleRefExpr{ pos: position{line: 751, col: 16, offset: 18173}, name: "NonZeroLeadingInteger", }, }, &litMatcher{ pos: position{line: 751, col: 38, offset: 18195}, val: "x", ignoreCase: true, }, &labeledExpr{ pos: position{line: 751, col: 43, offset: 18200}, label: "t", expr: &ruleRefExpr{ pos: position{line: 751, col: 45, offset: 18202}, name: "NonZeroLeadingInteger", }, }, ¬Expr{ pos: position{line: 751, col: 67, offset: 18224}, expr: &ruleRefExpr{ pos: position{line: 751, col: 68, offset: 18225}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "FixedType", pos: position{line: 786, col: 1, offset: 19130}, expr: &actionExpr{ pos: position{line: 787, col: 4, offset: 19143}, run: (*parser).callonFixedType1, expr: &seqExpr{ pos: position{line: 787, col: 4, offset: 19143}, exprs: []interface{}{ &litMatcher{ pos: position{line: 787, col: 4, offset: 19143}, val: "fixed", ignoreCase: true, }, &labeledExpr{ pos: position{line: 787, col: 13, offset: 19152}, label: "s", expr: &ruleRefExpr{ pos: position{line: 787, col: 15, offset: 19154}, name: "NonZeroLeadingInteger", }, }, &litMatcher{ pos: position{line: 787, col: 37, offset: 19176}, val: "x", ignoreCase: true, }, &labeledExpr{ pos: position{line: 787, col: 42, offset: 19181}, label: "t", expr: &ruleRefExpr{ pos: position{line: 787, col: 44, offset: 19183}, name: "NonZeroLeadingInteger", }, }, ¬Expr{ pos: position{line: 787, col: 66, offset: 19205}, expr: &ruleRefExpr{ pos: position{line: 787, col: 67, offset: 19206}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "FixedBytesType", pos: position{line: 822, col: 1, offset: 20110}, expr: &choiceExpr{ pos: position{line: 823, col: 4, offset: 20128}, alternatives: []interface{}{ &actionExpr{ pos: position{line: 823, col: 4, offset: 20128}, run: (*parser).callonFixedBytesType2, expr: &seqExpr{ pos: position{line: 823, col: 4, offset: 20128}, exprs: []interface{}{ &litMatcher{ pos: position{line: 823, col: 4, offset: 20128}, val: "bytes", ignoreCase: true, }, &labeledExpr{ pos: position{line: 823, col: 13, offset: 20137}, label: "s", expr: &ruleRefExpr{ pos: position{line: 823, col: 15, offset: 20139}, name: "NonZeroLeadingInteger", }, }, ¬Expr{ pos: position{line: 823, col: 37, offset: 20161}, expr: &ruleRefExpr{ pos: position{line: 823, col: 38, offset: 20162}, name: "NormalIdentifierRest", }, }, }, }, }, &actionExpr{ pos: position{line: 843, col: 4, offset: 20672}, run: (*parser).callonFixedBytesType9, expr: &seqExpr{ pos: position{line: 843, col: 4, offset: 20672}, exprs: []interface{}{ &litMatcher{ pos: position{line: 843, col: 4, offset: 20672}, val: "byte", ignoreCase: true, }, ¬Expr{ pos: position{line: 843, col: 12, offset: 20680}, expr: &ruleRefExpr{ pos: position{line: 843, col: 13, offset: 20681}, name: "NormalIdentifierRest", }, }, }, }, }, }, }, }, { name: "DynamicBytesType", pos: position{line: 852, col: 1, offset: 20852}, expr: &actionExpr{ pos: position{line: 853, col: 4, offset: 20872}, run: (*parser).callonDynamicBytesType1, expr: &choiceExpr{ pos: position{line: 853, col: 6, offset: 20874}, alternatives: []interface{}{ &seqExpr{ pos: position{line: 853, col: 6, offset: 20874}, exprs: []interface{}{ &litMatcher{ pos: position{line: 853, col: 6, offset: 20874}, val: "bytes", ignoreCase: true, }, ¬Expr{ pos: position{line: 853, col: 15, offset: 20883}, expr: &ruleRefExpr{ pos: position{line: 853, col: 16, offset: 20884}, name: "NormalIdentifierRest", }, }, }, }, &seqExpr{ pos: position{line: 854, col: 5, offset: 20909}, exprs: []interface{}{ &litMatcher{ pos: position{line: 854, col: 5, offset: 20909}, val: "string", ignoreCase: true, }, ¬Expr{ pos: position{line: 854, col: 15, offset: 20919}, expr: &ruleRefExpr{ pos: position{line: 854, col: 16, offset: 20920}, name: "NormalIdentifierRest", }, }, }, }, &seqExpr{ pos: position{line: 855, col: 5, offset: 20945}, exprs: []interface{}{ &litMatcher{ pos: position{line: 855, col: 5, offset: 20945}, val: "text", ignoreCase: true, }, ¬Expr{ pos: position{line: 855, col: 13, offset: 20953}, expr: &ruleRefExpr{ pos: position{line: 855, col: 14, offset: 20954}, name: "NormalIdentifierRest", }, }, }, }, }, }, }, }, { name: "AddressType", pos: position{line: 864, col: 1, offset: 21115}, expr: &actionExpr{ pos: position{line: 865, col: 4, offset: 21130}, run: (*parser).callonAddressType1, expr: &seqExpr{ pos: position{line: 865, col: 4, offset: 21130}, exprs: []interface{}{ &litMatcher{ pos: position{line: 865, col: 4, offset: 21130}, val: "address", ignoreCase: true, }, ¬Expr{ pos: position{line: 865, col: 15, offset: 21141}, expr: &ruleRefExpr{ pos: position{line: 865, col: 16, offset: 21142}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "BoolType", pos: position{line: 873, col: 1, offset: 21295}, expr: &actionExpr{ pos: position{line: 874, col: 4, offset: 21307}, run: (*parser).callonBoolType1, expr: &choiceExpr{ pos: position{line: 874, col: 6, offset: 21309}, alternatives: []interface{}{ &seqExpr{ pos: position{line: 874, col: 6, offset: 21309}, exprs: []interface{}{ &litMatcher{ pos: position{line: 874, col: 6, offset: 21309}, val: "bool", ignoreCase: true, }, ¬Expr{ pos: position{line: 874, col: 14, offset: 21317}, expr: &ruleRefExpr{ pos: position{line: 874, col: 15, offset: 21318}, name: "NormalIdentifierRest", }, }, }, }, &seqExpr{ pos: position{line: 875, col: 5, offset: 21343}, exprs: []interface{}{ &litMatcher{ pos: position{line: 875, col: 5, offset: 21343}, val: "boolean", ignoreCase: true, }, ¬Expr{ pos: position{line: 875, col: 16, offset: 21354}, expr: &ruleRefExpr{ pos: position{line: 875, col: 17, offset: 21355}, name: "NormalIdentifierRest", }, }, }, }, }, }, }, }, { name: "Value", pos: position{line: 885, col: 1, offset: 21521}, expr: &choiceExpr{ pos: position{line: 886, col: 4, offset: 21530}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 886, col: 4, offset: 21530}, name: "NumberLiteral", }, &ruleRefExpr{ pos: position{line: 887, col: 4, offset: 21547}, name: "StringLiteral", }, &ruleRefExpr{ pos: position{line: 888, col: 4, offset: 21564}, name: "BoolLiteral", }, &ruleRefExpr{ pos: position{line: 889, col: 4, offset: 21579}, name: "NullLiteral", }, }, }, }, { name: "AnyLiteral", pos: position{line: 891, col: 1, offset: 21592}, expr: &actionExpr{ pos: position{line: 892, col: 4, offset: 21606}, run: (*parser).callonAnyLiteral1, expr: &ruleRefExpr{ pos: position{line: 892, col: 4, offset: 21606}, name: "AnyToken", }, }, }, { name: "DefaultLiteral", pos: position{line: 900, col: 1, offset: 21744}, expr: &actionExpr{ pos: position{line: 901, col: 4, offset: 21762}, run: (*parser).callonDefaultLiteral1, expr: &ruleRefExpr{ pos: position{line: 901, col: 4, offset: 21762}, name: "DefaultToken", }, }, }, { name: "BoolLiteral", pos: position{line: 909, col: 1, offset: 21908}, expr: &actionExpr{ pos: position{line: 910, col: 4, offset: 21923}, run: (*parser).callonBoolLiteral1, expr: &labeledExpr{ pos: position{line: 910, col: 4, offset: 21923}, label: "b", expr: &choiceExpr{ pos: position{line: 910, col: 8, offset: 21927}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 910, col: 8, offset: 21927}, name: "TrueToken", }, &ruleRefExpr{ pos: position{line: 910, col: 20, offset: 21939}, name: "FalseToken", }, }, }, }, }, }, { name: "NullLiteral", pos: position{line: 919, col: 1, offset: 22136}, expr: &actionExpr{ pos: position{line: 920, col: 4, offset: 22151}, run: (*parser).callonNullLiteral1, expr: &ruleRefExpr{ pos: position{line: 920, col: 4, offset: 22151}, name: "NullToken", }, }, }, { name: "NumberLiteral", pos: position{line: 928, col: 1, offset: 22291}, expr: &choiceExpr{ pos: position{line: 929, col: 4, offset: 22308}, alternatives: []interface{}{ &actionExpr{ pos: position{line: 929, col: 4, offset: 22308}, run: (*parser).callonNumberLiteral2, expr: &seqExpr{ pos: position{line: 929, col: 4, offset: 22308}, exprs: []interface{}{ &andExpr{ pos: position{line: 929, col: 4, offset: 22308}, expr: &seqExpr{ pos: position{line: 929, col: 6, offset: 22310}, exprs: []interface{}{ &litMatcher{ pos: position{line: 929, col: 6, offset: 22310}, val: "0", ignoreCase: false, }, &litMatcher{ pos: position{line: 929, col: 10, offset: 22314}, val: "x", ignoreCase: true, }, }, }, }, &labeledExpr{ pos: position{line: 929, col: 16, offset: 22320}, label: "h", expr: &ruleRefExpr{ pos: position{line: 929, col: 18, offset: 22322}, name: "Hex", }, }, }, }, }, &ruleRefExpr{ pos: position{line: 930, col: 4, offset: 22347}, name: "Decimal", }, }, }, }, { name: "Sign", pos: position{line: 932, col: 1, offset: 22356}, expr: &charClassMatcher{ pos: position{line: 933, col: 4, offset: 22364}, val: "[-+]", chars: []rune{'-', '+'}, ignoreCase: false, inverted: false, }, }, { name: "Integer", pos: position{line: 935, col: 1, offset: 22370}, expr: &oneOrMoreExpr{ pos: position{line: 936, col: 4, offset: 22381}, expr: &charClassMatcher{ pos: position{line: 936, col: 4, offset: 22381}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, inverted: false, }, }, }, { name: "IntegerLiteral", pos: position{line: 938, col: 1, offset: 22389}, expr: &actionExpr{ pos: position{line: 939, col: 4, offset: 22407}, run: (*parser).callonIntegerLiteral1, expr: &ruleRefExpr{ pos: position{line: 939, col: 4, offset: 22407}, name: "Integer", }, }, }, { name: "NonZeroLeadingInteger", pos: position{line: 961, col: 1, offset: 22920}, expr: &actionExpr{ pos: position{line: 962, col: 4, offset: 22945}, run: (*parser).callonNonZeroLeadingInteger1, expr: &choiceExpr{ pos: position{line: 962, col: 6, offset: 22947}, alternatives: []interface{}{ &litMatcher{ pos: position{line: 962, col: 6, offset: 22947}, val: "0", ignoreCase: false, }, &seqExpr{ pos: position{line: 962, col: 12, offset: 22953}, exprs: []interface{}{ &charClassMatcher{ pos: position{line: 962, col: 12, offset: 22953}, val: "[1-9]", ranges: []rune{'1', '9'}, ignoreCase: false, inverted: false, }, &zeroOrMoreExpr{ pos: position{line: 962, col: 17, offset: 22958}, expr: &charClassMatcher{ pos: position{line: 962, col: 17, offset: 22958}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, inverted: false, }, }, }, }, }, }, }, }, { name: "Fixnum", pos: position{line: 965, col: 1, offset: 22991}, expr: &actionExpr{ pos: position{line: 966, col: 4, offset: 23001}, run: (*parser).callonFixnum1, expr: &choiceExpr{ pos: position{line: 966, col: 6, offset: 23003}, alternatives: []interface{}{ &seqExpr{ pos: position{line: 966, col: 6, offset: 23003}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 966, col: 6, offset: 23003}, name: "Integer", }, &litMatcher{ pos: position{line: 966, col: 14, offset: 23011}, val: ".", ignoreCase: false, }, &ruleRefExpr{ pos: position{line: 966, col: 18, offset: 23015}, name: "Integer", }, }, }, &seqExpr{ pos: position{line: 967, col: 5, offset: 23027}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 967, col: 5, offset: 23027}, name: "Integer", }, &litMatcher{ pos: position{line: 967, col: 13, offset: 23035}, val: ".", ignoreCase: false, }, }, }, &ruleRefExpr{ pos: position{line: 968, col: 5, offset: 23043}, name: "Integer", }, &seqExpr{ pos: position{line: 969, col: 5, offset: 23055}, exprs: []interface{}{ &litMatcher{ pos: position{line: 969, col: 5, offset: 23055}, val: ".", ignoreCase: false, }, &ruleRefExpr{ pos: position{line: 969, col: 9, offset: 23059}, name: "Integer", }, }, }, }, }, }, }, { name: "Decimal", pos: position{line: 973, col: 1, offset: 23094}, expr: &actionExpr{ pos: position{line: 974, col: 4, offset: 23105}, run: (*parser).callonDecimal1, expr: &seqExpr{ pos: position{line: 974, col: 4, offset: 23105}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 974, col: 4, offset: 23105}, label: "m", expr: &ruleRefExpr{ pos: position{line: 974, col: 6, offset: 23107}, name: "Fixnum", }, }, &labeledExpr{ pos: position{line: 974, col: 13, offset: 23114}, label: "e", expr: &zeroOrOneExpr{ pos: position{line: 974, col: 15, offset: 23116}, expr: &seqExpr{ pos: position{line: 974, col: 17, offset: 23118}, exprs: []interface{}{ &litMatcher{ pos: position{line: 974, col: 17, offset: 23118}, val: "e", ignoreCase: true, }, &zeroOrOneExpr{ pos: position{line: 974, col: 22, offset: 23123}, expr: &ruleRefExpr{ pos: position{line: 974, col: 22, offset: 23123}, name: "Sign", }, }, &ruleRefExpr{ pos: position{line: 974, col: 28, offset: 23129}, name: "Integer", }, }, }, }, }, }, }, }, }, { name: "Hex", pos: position{line: 1011, col: 1, offset: 23995}, expr: &actionExpr{ pos: position{line: 1012, col: 4, offset: 24002}, run: (*parser).callonHex1, expr: &seqExpr{ pos: position{line: 1012, col: 4, offset: 24002}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1012, col: 4, offset: 24002}, val: "0x", ignoreCase: false, }, &oneOrMoreExpr{ pos: position{line: 1012, col: 9, offset: 24007}, expr: &charClassMatcher{ pos: position{line: 1012, col: 11, offset: 24009}, val: "[0-9A-Fa-f]", ranges: []rune{'0', '9', 'A', 'F', 'a', 'f'}, ignoreCase: false, inverted: false, }, }, ¬Expr{ pos: position{line: 1012, col: 26, offset: 24024}, expr: &ruleRefExpr{ pos: position{line: 1012, col: 27, offset: 24025}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "StringLiteral", pos: position{line: 1020, col: 1, offset: 24176}, expr: &choiceExpr{ pos: position{line: 1021, col: 4, offset: 24193}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 1021, col: 4, offset: 24193}, name: "HexString", }, &ruleRefExpr{ pos: position{line: 1022, col: 4, offset: 24206}, name: "NormalString", }, }, }, }, { name: "HexString", pos: position{line: 1024, col: 1, offset: 24220}, expr: &actionExpr{ pos: position{line: 1025, col: 4, offset: 24233}, run: (*parser).callonHexString1, expr: &seqExpr{ pos: position{line: 1025, col: 4, offset: 24233}, exprs: []interface{}{ &choiceExpr{ pos: position{line: 1025, col: 6, offset: 24235}, alternatives: []interface{}{ &litMatcher{ pos: position{line: 1025, col: 6, offset: 24235}, val: "hex", ignoreCase: true, }, &litMatcher{ pos: position{line: 1025, col: 15, offset: 24244}, val: "x", ignoreCase: true, }, }, }, &litMatcher{ pos: position{line: 1025, col: 22, offset: 24251}, val: "'", ignoreCase: false, }, &labeledExpr{ pos: position{line: 1025, col: 26, offset: 24255}, label: "s", expr: &zeroOrMoreExpr{ pos: position{line: 1025, col: 28, offset: 24257}, expr: &actionExpr{ pos: position{line: 1025, col: 29, offset: 24258}, run: (*parser).callonHexString9, expr: &seqExpr{ pos: position{line: 1025, col: 29, offset: 24258}, exprs: []interface{}{ &charClassMatcher{ pos: position{line: 1025, col: 29, offset: 24258}, val: "[0-9a-fA-F]", ranges: []rune{'0', '9', 'a', 'f', 'A', 'F'}, ignoreCase: false, inverted: false, }, &charClassMatcher{ pos: position{line: 1025, col: 40, offset: 24269}, val: "[0-9a-fA-F]", ranges: []rune{'0', '9', 'a', 'f', 'A', 'F'}, ignoreCase: false, inverted: false, }, }, }, }, }, }, &litMatcher{ pos: position{line: 1025, col: 78, offset: 24307}, val: "'", ignoreCase: false, }, }, }, }, }, { name: "NormalString", pos: position{line: 1034, col: 1, offset: 24490}, expr: &actionExpr{ pos: position{line: 1035, col: 4, offset: 24506}, run: (*parser).callonNormalString1, expr: &seqExpr{ pos: position{line: 1035, col: 4, offset: 24506}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1035, col: 4, offset: 24506}, val: "'", ignoreCase: false, }, &labeledExpr{ pos: position{line: 1035, col: 8, offset: 24510}, label: "s", expr: &zeroOrMoreExpr{ pos: position{line: 1035, col: 10, offset: 24512}, expr: &actionExpr{ pos: position{line: 1035, col: 12, offset: 24514}, run: (*parser).callonNormalString6, expr: &choiceExpr{ pos: position{line: 1035, col: 14, offset: 24516}, alternatives: []interface{}{ &charClassMatcher{ pos: position{line: 1035, col: 14, offset: 24516}, val: "[^'\\r\\n\\\\]", chars: []rune{'\'', '\r', '\n', '\\'}, ignoreCase: false, inverted: true, }, &seqExpr{ pos: position{line: 1035, col: 27, offset: 24529}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1035, col: 27, offset: 24529}, val: "\\", ignoreCase: false, }, &anyMatcher{ line: 1035, col: 32, offset: 24534, }, }, }, }, }, }, }, }, &litMatcher{ pos: position{line: 1035, col: 62, offset: 24564}, val: "'", ignoreCase: false, }, }, }, }, }, { name: "SelectToken", pos: position{line: 1060, col: 1, offset: 25137}, expr: &actionExpr{ pos: position{line: 1061, col: 4, offset: 25152}, run: (*parser).callonSelectToken1, expr: &seqExpr{ pos: position{line: 1061, col: 4, offset: 25152}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1061, col: 4, offset: 25152}, val: "select", ignoreCase: true, }, ¬Expr{ pos: position{line: 1061, col: 14, offset: 25162}, expr: &ruleRefExpr{ pos: position{line: 1061, col: 15, offset: 25163}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "FromToken", pos: position{line: 1064, col: 1, offset: 25208}, expr: &actionExpr{ pos: position{line: 1065, col: 4, offset: 25221}, run: (*parser).callonFromToken1, expr: &seqExpr{ pos: position{line: 1065, col: 4, offset: 25221}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1065, col: 4, offset: 25221}, val: "from", ignoreCase: true, }, ¬Expr{ pos: position{line: 1065, col: 12, offset: 25229}, expr: &ruleRefExpr{ pos: position{line: 1065, col: 13, offset: 25230}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "WhereToken", pos: position{line: 1068, col: 1, offset: 25275}, expr: &actionExpr{ pos: position{line: 1069, col: 4, offset: 25289}, run: (*parser).callonWhereToken1, expr: &seqExpr{ pos: position{line: 1069, col: 4, offset: 25289}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1069, col: 4, offset: 25289}, val: "where", ignoreCase: true, }, ¬Expr{ pos: position{line: 1069, col: 13, offset: 25298}, expr: &ruleRefExpr{ pos: position{line: 1069, col: 14, offset: 25299}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "OrderToken", pos: position{line: 1072, col: 1, offset: 25344}, expr: &actionExpr{ pos: position{line: 1073, col: 4, offset: 25358}, run: (*parser).callonOrderToken1, expr: &seqExpr{ pos: position{line: 1073, col: 4, offset: 25358}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1073, col: 4, offset: 25358}, val: "order", ignoreCase: true, }, ¬Expr{ pos: position{line: 1073, col: 13, offset: 25367}, expr: &ruleRefExpr{ pos: position{line: 1073, col: 14, offset: 25368}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "ByToken", pos: position{line: 1076, col: 1, offset: 25413}, expr: &actionExpr{ pos: position{line: 1077, col: 4, offset: 25424}, run: (*parser).callonByToken1, expr: &seqExpr{ pos: position{line: 1077, col: 4, offset: 25424}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1077, col: 4, offset: 25424}, val: "by", ignoreCase: true, }, ¬Expr{ pos: position{line: 1077, col: 10, offset: 25430}, expr: &ruleRefExpr{ pos: position{line: 1077, col: 11, offset: 25431}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "GroupToken", pos: position{line: 1080, col: 1, offset: 25476}, expr: &actionExpr{ pos: position{line: 1081, col: 4, offset: 25490}, run: (*parser).callonGroupToken1, expr: &seqExpr{ pos: position{line: 1081, col: 4, offset: 25490}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1081, col: 4, offset: 25490}, val: "group", ignoreCase: true, }, ¬Expr{ pos: position{line: 1081, col: 13, offset: 25499}, expr: &ruleRefExpr{ pos: position{line: 1081, col: 14, offset: 25500}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "LimitToken", pos: position{line: 1084, col: 1, offset: 25545}, expr: &actionExpr{ pos: position{line: 1085, col: 4, offset: 25559}, run: (*parser).callonLimitToken1, expr: &seqExpr{ pos: position{line: 1085, col: 4, offset: 25559}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1085, col: 4, offset: 25559}, val: "limit", ignoreCase: true, }, ¬Expr{ pos: position{line: 1085, col: 13, offset: 25568}, expr: &ruleRefExpr{ pos: position{line: 1085, col: 14, offset: 25569}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "OffsetToken", pos: position{line: 1088, col: 1, offset: 25614}, expr: &actionExpr{ pos: position{line: 1089, col: 4, offset: 25629}, run: (*parser).callonOffsetToken1, expr: &seqExpr{ pos: position{line: 1089, col: 4, offset: 25629}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1089, col: 4, offset: 25629}, val: "offset", ignoreCase: true, }, ¬Expr{ pos: position{line: 1089, col: 14, offset: 25639}, expr: &ruleRefExpr{ pos: position{line: 1089, col: 15, offset: 25640}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "UpdateToken", pos: position{line: 1092, col: 1, offset: 25685}, expr: &actionExpr{ pos: position{line: 1093, col: 4, offset: 25700}, run: (*parser).callonUpdateToken1, expr: &seqExpr{ pos: position{line: 1093, col: 4, offset: 25700}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1093, col: 4, offset: 25700}, val: "update", ignoreCase: true, }, ¬Expr{ pos: position{line: 1093, col: 14, offset: 25710}, expr: &ruleRefExpr{ pos: position{line: 1093, col: 15, offset: 25711}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "SetToken", pos: position{line: 1096, col: 1, offset: 25756}, expr: &actionExpr{ pos: position{line: 1097, col: 4, offset: 25768}, run: (*parser).callonSetToken1, expr: &seqExpr{ pos: position{line: 1097, col: 4, offset: 25768}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1097, col: 4, offset: 25768}, val: "set", ignoreCase: true, }, ¬Expr{ pos: position{line: 1097, col: 11, offset: 25775}, expr: &ruleRefExpr{ pos: position{line: 1097, col: 12, offset: 25776}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "DeleteToken", pos: position{line: 1100, col: 1, offset: 25821}, expr: &actionExpr{ pos: position{line: 1101, col: 4, offset: 25836}, run: (*parser).callonDeleteToken1, expr: &seqExpr{ pos: position{line: 1101, col: 4, offset: 25836}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1101, col: 4, offset: 25836}, val: "delete", ignoreCase: true, }, ¬Expr{ pos: position{line: 1101, col: 14, offset: 25846}, expr: &ruleRefExpr{ pos: position{line: 1101, col: 15, offset: 25847}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "InsertToken", pos: position{line: 1104, col: 1, offset: 25892}, expr: &actionExpr{ pos: position{line: 1105, col: 4, offset: 25907}, run: (*parser).callonInsertToken1, expr: &seqExpr{ pos: position{line: 1105, col: 4, offset: 25907}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1105, col: 4, offset: 25907}, val: "insert", ignoreCase: true, }, ¬Expr{ pos: position{line: 1105, col: 14, offset: 25917}, expr: &ruleRefExpr{ pos: position{line: 1105, col: 15, offset: 25918}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "IntoToken", pos: position{line: 1108, col: 1, offset: 25963}, expr: &actionExpr{ pos: position{line: 1109, col: 4, offset: 25976}, run: (*parser).callonIntoToken1, expr: &seqExpr{ pos: position{line: 1109, col: 4, offset: 25976}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1109, col: 4, offset: 25976}, val: "into", ignoreCase: true, }, ¬Expr{ pos: position{line: 1109, col: 12, offset: 25984}, expr: &ruleRefExpr{ pos: position{line: 1109, col: 13, offset: 25985}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "ValuesToken", pos: position{line: 1112, col: 1, offset: 26030}, expr: &actionExpr{ pos: position{line: 1113, col: 4, offset: 26045}, run: (*parser).callonValuesToken1, expr: &seqExpr{ pos: position{line: 1113, col: 4, offset: 26045}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1113, col: 4, offset: 26045}, val: "values", ignoreCase: true, }, ¬Expr{ pos: position{line: 1113, col: 14, offset: 26055}, expr: &ruleRefExpr{ pos: position{line: 1113, col: 15, offset: 26056}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "CreateToken", pos: position{line: 1116, col: 1, offset: 26101}, expr: &actionExpr{ pos: position{line: 1117, col: 4, offset: 26116}, run: (*parser).callonCreateToken1, expr: &seqExpr{ pos: position{line: 1117, col: 4, offset: 26116}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1117, col: 4, offset: 26116}, val: "create", ignoreCase: true, }, ¬Expr{ pos: position{line: 1117, col: 14, offset: 26126}, expr: &ruleRefExpr{ pos: position{line: 1117, col: 15, offset: 26127}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "TableToken", pos: position{line: 1120, col: 1, offset: 26172}, expr: &actionExpr{ pos: position{line: 1121, col: 4, offset: 26186}, run: (*parser).callonTableToken1, expr: &seqExpr{ pos: position{line: 1121, col: 4, offset: 26186}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1121, col: 4, offset: 26186}, val: "table", ignoreCase: true, }, ¬Expr{ pos: position{line: 1121, col: 13, offset: 26195}, expr: &ruleRefExpr{ pos: position{line: 1121, col: 14, offset: 26196}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "IndexToken", pos: position{line: 1124, col: 1, offset: 26241}, expr: &actionExpr{ pos: position{line: 1125, col: 4, offset: 26255}, run: (*parser).callonIndexToken1, expr: &seqExpr{ pos: position{line: 1125, col: 4, offset: 26255}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1125, col: 4, offset: 26255}, val: "index", ignoreCase: true, }, ¬Expr{ pos: position{line: 1125, col: 13, offset: 26264}, expr: &ruleRefExpr{ pos: position{line: 1125, col: 14, offset: 26265}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "UniqueToken", pos: position{line: 1128, col: 1, offset: 26310}, expr: &actionExpr{ pos: position{line: 1129, col: 4, offset: 26325}, run: (*parser).callonUniqueToken1, expr: &seqExpr{ pos: position{line: 1129, col: 4, offset: 26325}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1129, col: 4, offset: 26325}, val: "unique", ignoreCase: true, }, ¬Expr{ pos: position{line: 1129, col: 14, offset: 26335}, expr: &ruleRefExpr{ pos: position{line: 1129, col: 15, offset: 26336}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "DefaultToken", pos: position{line: 1132, col: 1, offset: 26381}, expr: &actionExpr{ pos: position{line: 1133, col: 4, offset: 26397}, run: (*parser).callonDefaultToken1, expr: &seqExpr{ pos: position{line: 1133, col: 4, offset: 26397}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1133, col: 4, offset: 26397}, val: "default", ignoreCase: true, }, ¬Expr{ pos: position{line: 1133, col: 15, offset: 26408}, expr: &ruleRefExpr{ pos: position{line: 1133, col: 16, offset: 26409}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "PrimaryToken", pos: position{line: 1136, col: 1, offset: 26454}, expr: &actionExpr{ pos: position{line: 1137, col: 4, offset: 26470}, run: (*parser).callonPrimaryToken1, expr: &seqExpr{ pos: position{line: 1137, col: 4, offset: 26470}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1137, col: 4, offset: 26470}, val: "primary", ignoreCase: true, }, ¬Expr{ pos: position{line: 1137, col: 15, offset: 26481}, expr: &ruleRefExpr{ pos: position{line: 1137, col: 16, offset: 26482}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "KeyToken", pos: position{line: 1140, col: 1, offset: 26527}, expr: &actionExpr{ pos: position{line: 1141, col: 4, offset: 26539}, run: (*parser).callonKeyToken1, expr: &seqExpr{ pos: position{line: 1141, col: 4, offset: 26539}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1141, col: 4, offset: 26539}, val: "key", ignoreCase: true, }, ¬Expr{ pos: position{line: 1141, col: 11, offset: 26546}, expr: &ruleRefExpr{ pos: position{line: 1141, col: 12, offset: 26547}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "ReferencesToken", pos: position{line: 1144, col: 1, offset: 26592}, expr: &actionExpr{ pos: position{line: 1145, col: 4, offset: 26611}, run: (*parser).callonReferencesToken1, expr: &seqExpr{ pos: position{line: 1145, col: 4, offset: 26611}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1145, col: 4, offset: 26611}, val: "references", ignoreCase: true, }, ¬Expr{ pos: position{line: 1145, col: 18, offset: 26625}, expr: &ruleRefExpr{ pos: position{line: 1145, col: 19, offset: 26626}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "AutoincrementToken", pos: position{line: 1148, col: 1, offset: 26671}, expr: &actionExpr{ pos: position{line: 1149, col: 4, offset: 26693}, run: (*parser).callonAutoincrementToken1, expr: &seqExpr{ pos: position{line: 1149, col: 4, offset: 26693}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1149, col: 4, offset: 26693}, val: "autoincrement", ignoreCase: true, }, ¬Expr{ pos: position{line: 1149, col: 21, offset: 26710}, expr: &ruleRefExpr{ pos: position{line: 1149, col: 22, offset: 26711}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "OnToken", pos: position{line: 1152, col: 1, offset: 26756}, expr: &actionExpr{ pos: position{line: 1153, col: 4, offset: 26767}, run: (*parser).callonOnToken1, expr: &seqExpr{ pos: position{line: 1153, col: 4, offset: 26767}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1153, col: 4, offset: 26767}, val: "on", ignoreCase: true, }, ¬Expr{ pos: position{line: 1153, col: 10, offset: 26773}, expr: &ruleRefExpr{ pos: position{line: 1153, col: 11, offset: 26774}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "TrueToken", pos: position{line: 1156, col: 1, offset: 26819}, expr: &actionExpr{ pos: position{line: 1157, col: 4, offset: 26832}, run: (*parser).callonTrueToken1, expr: &seqExpr{ pos: position{line: 1157, col: 4, offset: 26832}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1157, col: 4, offset: 26832}, val: "true", ignoreCase: true, }, ¬Expr{ pos: position{line: 1157, col: 12, offset: 26840}, expr: &ruleRefExpr{ pos: position{line: 1157, col: 13, offset: 26841}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "FalseToken", pos: position{line: 1160, col: 1, offset: 26886}, expr: &actionExpr{ pos: position{line: 1161, col: 4, offset: 26900}, run: (*parser).callonFalseToken1, expr: &seqExpr{ pos: position{line: 1161, col: 4, offset: 26900}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1161, col: 4, offset: 26900}, val: "false", ignoreCase: true, }, ¬Expr{ pos: position{line: 1161, col: 13, offset: 26909}, expr: &ruleRefExpr{ pos: position{line: 1161, col: 14, offset: 26910}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "NullToken", pos: position{line: 1164, col: 1, offset: 26955}, expr: &actionExpr{ pos: position{line: 1165, col: 4, offset: 26968}, run: (*parser).callonNullToken1, expr: &seqExpr{ pos: position{line: 1165, col: 4, offset: 26968}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1165, col: 4, offset: 26968}, val: "null", ignoreCase: true, }, ¬Expr{ pos: position{line: 1165, col: 12, offset: 26976}, expr: &ruleRefExpr{ pos: position{line: 1165, col: 13, offset: 26977}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "IsToken", pos: position{line: 1168, col: 1, offset: 27022}, expr: &actionExpr{ pos: position{line: 1169, col: 4, offset: 27033}, run: (*parser).callonIsToken1, expr: &seqExpr{ pos: position{line: 1169, col: 4, offset: 27033}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1169, col: 4, offset: 27033}, val: "is", ignoreCase: true, }, ¬Expr{ pos: position{line: 1169, col: 10, offset: 27039}, expr: &ruleRefExpr{ pos: position{line: 1169, col: 11, offset: 27040}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "NullsToken", pos: position{line: 1172, col: 1, offset: 27085}, expr: &actionExpr{ pos: position{line: 1173, col: 4, offset: 27099}, run: (*parser).callonNullsToken1, expr: &seqExpr{ pos: position{line: 1173, col: 4, offset: 27099}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1173, col: 4, offset: 27099}, val: "nulls", ignoreCase: true, }, ¬Expr{ pos: position{line: 1173, col: 13, offset: 27108}, expr: &ruleRefExpr{ pos: position{line: 1173, col: 14, offset: 27109}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "LastToken", pos: position{line: 1176, col: 1, offset: 27154}, expr: &actionExpr{ pos: position{line: 1177, col: 4, offset: 27167}, run: (*parser).callonLastToken1, expr: &seqExpr{ pos: position{line: 1177, col: 4, offset: 27167}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1177, col: 4, offset: 27167}, val: "last", ignoreCase: true, }, ¬Expr{ pos: position{line: 1177, col: 12, offset: 27175}, expr: &ruleRefExpr{ pos: position{line: 1177, col: 13, offset: 27176}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "FirstToken", pos: position{line: 1180, col: 1, offset: 27221}, expr: &actionExpr{ pos: position{line: 1181, col: 4, offset: 27235}, run: (*parser).callonFirstToken1, expr: &seqExpr{ pos: position{line: 1181, col: 4, offset: 27235}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1181, col: 4, offset: 27235}, val: "first", ignoreCase: true, }, ¬Expr{ pos: position{line: 1181, col: 13, offset: 27244}, expr: &ruleRefExpr{ pos: position{line: 1181, col: 14, offset: 27245}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "AndToken", pos: position{line: 1184, col: 1, offset: 27290}, expr: &actionExpr{ pos: position{line: 1185, col: 4, offset: 27302}, run: (*parser).callonAndToken1, expr: &seqExpr{ pos: position{line: 1185, col: 4, offset: 27302}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1185, col: 4, offset: 27302}, val: "and", ignoreCase: true, }, ¬Expr{ pos: position{line: 1185, col: 11, offset: 27309}, expr: &ruleRefExpr{ pos: position{line: 1185, col: 12, offset: 27310}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "OrToken", pos: position{line: 1188, col: 1, offset: 27355}, expr: &actionExpr{ pos: position{line: 1189, col: 4, offset: 27366}, run: (*parser).callonOrToken1, expr: &seqExpr{ pos: position{line: 1189, col: 4, offset: 27366}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1189, col: 4, offset: 27366}, val: "or", ignoreCase: true, }, ¬Expr{ pos: position{line: 1189, col: 10, offset: 27372}, expr: &ruleRefExpr{ pos: position{line: 1189, col: 11, offset: 27373}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "NotToken", pos: position{line: 1192, col: 1, offset: 27418}, expr: &actionExpr{ pos: position{line: 1193, col: 4, offset: 27430}, run: (*parser).callonNotToken1, expr: &seqExpr{ pos: position{line: 1193, col: 4, offset: 27430}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1193, col: 4, offset: 27430}, val: "not", ignoreCase: true, }, ¬Expr{ pos: position{line: 1193, col: 11, offset: 27437}, expr: &ruleRefExpr{ pos: position{line: 1193, col: 12, offset: 27438}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "InToken", pos: position{line: 1196, col: 1, offset: 27483}, expr: &actionExpr{ pos: position{line: 1197, col: 4, offset: 27494}, run: (*parser).callonInToken1, expr: &seqExpr{ pos: position{line: 1197, col: 4, offset: 27494}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1197, col: 4, offset: 27494}, val: "in", ignoreCase: true, }, ¬Expr{ pos: position{line: 1197, col: 10, offset: 27500}, expr: &ruleRefExpr{ pos: position{line: 1197, col: 11, offset: 27501}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "LikeToken", pos: position{line: 1200, col: 1, offset: 27546}, expr: &actionExpr{ pos: position{line: 1201, col: 4, offset: 27559}, run: (*parser).callonLikeToken1, expr: &seqExpr{ pos: position{line: 1201, col: 4, offset: 27559}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1201, col: 4, offset: 27559}, val: "like", ignoreCase: true, }, ¬Expr{ pos: position{line: 1201, col: 12, offset: 27567}, expr: &ruleRefExpr{ pos: position{line: 1201, col: 13, offset: 27568}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "EscapeToken", pos: position{line: 1204, col: 1, offset: 27613}, expr: &actionExpr{ pos: position{line: 1205, col: 4, offset: 27628}, run: (*parser).callonEscapeToken1, expr: &seqExpr{ pos: position{line: 1205, col: 4, offset: 27628}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1205, col: 4, offset: 27628}, val: "escape", ignoreCase: true, }, ¬Expr{ pos: position{line: 1205, col: 14, offset: 27638}, expr: &ruleRefExpr{ pos: position{line: 1205, col: 15, offset: 27639}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "AscToken", pos: position{line: 1208, col: 1, offset: 27684}, expr: &actionExpr{ pos: position{line: 1209, col: 4, offset: 27696}, run: (*parser).callonAscToken1, expr: &seqExpr{ pos: position{line: 1209, col: 4, offset: 27696}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1209, col: 4, offset: 27696}, val: "asc", ignoreCase: true, }, ¬Expr{ pos: position{line: 1209, col: 11, offset: 27703}, expr: &ruleRefExpr{ pos: position{line: 1209, col: 12, offset: 27704}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "DescToken", pos: position{line: 1212, col: 1, offset: 27749}, expr: &actionExpr{ pos: position{line: 1213, col: 4, offset: 27762}, run: (*parser).callonDescToken1, expr: &seqExpr{ pos: position{line: 1213, col: 4, offset: 27762}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1213, col: 4, offset: 27762}, val: "desc", ignoreCase: true, }, ¬Expr{ pos: position{line: 1213, col: 12, offset: 27770}, expr: &ruleRefExpr{ pos: position{line: 1213, col: 13, offset: 27771}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "CastToken", pos: position{line: 1216, col: 1, offset: 27816}, expr: &actionExpr{ pos: position{line: 1217, col: 4, offset: 27829}, run: (*parser).callonCastToken1, expr: &seqExpr{ pos: position{line: 1217, col: 4, offset: 27829}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1217, col: 4, offset: 27829}, val: "cast", ignoreCase: true, }, ¬Expr{ pos: position{line: 1217, col: 12, offset: 27837}, expr: &ruleRefExpr{ pos: position{line: 1217, col: 13, offset: 27838}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "AsToken", pos: position{line: 1220, col: 1, offset: 27883}, expr: &actionExpr{ pos: position{line: 1221, col: 4, offset: 27894}, run: (*parser).callonAsToken1, expr: &seqExpr{ pos: position{line: 1221, col: 4, offset: 27894}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1221, col: 4, offset: 27894}, val: "as", ignoreCase: true, }, ¬Expr{ pos: position{line: 1221, col: 10, offset: 27900}, expr: &ruleRefExpr{ pos: position{line: 1221, col: 11, offset: 27901}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "SeparatorToken", pos: position{line: 1224, col: 1, offset: 27946}, expr: &litMatcher{ pos: position{line: 1225, col: 4, offset: 27964}, val: ",", ignoreCase: false, }, }, { name: "AnyToken", pos: position{line: 1227, col: 1, offset: 27969}, expr: &litMatcher{ pos: position{line: 1228, col: 4, offset: 27981}, val: "*", ignoreCase: false, }, }, { name: "Identifier", pos: position{line: 1231, col: 1, offset: 28004}, expr: &choiceExpr{ pos: position{line: 1232, col: 4, offset: 28018}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 1232, col: 4, offset: 28018}, name: "NormalIdentifier", }, &ruleRefExpr{ pos: position{line: 1233, col: 4, offset: 28038}, name: "StringIdentifier", }, }, }, }, { name: "NormalIdentifier", pos: position{line: 1235, col: 1, offset: 28056}, expr: &actionExpr{ pos: position{line: 1236, col: 4, offset: 28076}, run: (*parser).callonNormalIdentifier1, expr: &seqExpr{ pos: position{line: 1236, col: 4, offset: 28076}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 1236, col: 4, offset: 28076}, name: "NormalIdentifierStart", }, &zeroOrMoreExpr{ pos: position{line: 1236, col: 26, offset: 28098}, expr: &ruleRefExpr{ pos: position{line: 1236, col: 26, offset: 28098}, name: "NormalIdentifierRest", }, }, }, }, }, }, { name: "NormalIdentifierStart", pos: position{line: 1245, col: 1, offset: 28285}, expr: &charClassMatcher{ pos: position{line: 1246, col: 4, offset: 28310}, val: "[a-zA-Z\\x80-\\xff]", ranges: []rune{'a', 'z', 'A', 'Z', '\u0080', 'ÿ'}, ignoreCase: false, inverted: false, }, }, { name: "NormalIdentifierRest", pos: position{line: 1248, col: 1, offset: 28329}, expr: &charClassMatcher{ pos: position{line: 1249, col: 4, offset: 28353}, val: "[a-zA-Z0-9_\\x80-\\xff]", chars: []rune{'_'}, ranges: []rune{'a', 'z', 'A', 'Z', '0', '9', '\u0080', 'ÿ'}, ignoreCase: false, inverted: false, }, }, { name: "StringIdentifier", pos: position{line: 1251, col: 1, offset: 28376}, expr: &actionExpr{ pos: position{line: 1252, col: 4, offset: 28396}, run: (*parser).callonStringIdentifier1, expr: &seqExpr{ pos: position{line: 1252, col: 4, offset: 28396}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1252, col: 4, offset: 28396}, val: "\"", ignoreCase: false, }, &labeledExpr{ pos: position{line: 1252, col: 9, offset: 28401}, label: "s", expr: &zeroOrMoreExpr{ pos: position{line: 1252, col: 11, offset: 28403}, expr: &actionExpr{ pos: position{line: 1252, col: 13, offset: 28405}, run: (*parser).callonStringIdentifier6, expr: &choiceExpr{ pos: position{line: 1252, col: 15, offset: 28407}, alternatives: []interface{}{ &charClassMatcher{ pos: position{line: 1252, col: 15, offset: 28407}, val: "[^\"\\r\\n\\\\]", chars: []rune{'"', '\r', '\n', '\\'}, ignoreCase: false, inverted: true, }, &seqExpr{ pos: position{line: 1252, col: 28, offset: 28420}, exprs: []interface{}{ &litMatcher{ pos: position{line: 1252, col: 28, offset: 28420}, val: "\\", ignoreCase: false, }, &anyMatcher{ line: 1252, col: 33, offset: 28425, }, }, }, }, }, }, }, }, &litMatcher{ pos: position{line: 1252, col: 63, offset: 28455}, val: "\"", ignoreCase: false, }, }, }, }, }, { name: "_", pos: position{line: 1277, col: 1, offset: 29040}, expr: &actionExpr{ pos: position{line: 1278, col: 4, offset: 29045}, run: (*parser).callon_1, expr: &zeroOrMoreExpr{ pos: position{line: 1278, col: 4, offset: 29045}, expr: &ruleRefExpr{ pos: position{line: 1278, col: 4, offset: 29045}, name: "Whitespace", }, }, }, }, { name: "Whitespace", pos: position{line: 1281, col: 1, offset: 29081}, expr: &choiceExpr{ pos: position{line: 1282, col: 4, offset: 29095}, alternatives: []interface{}{ &litMatcher{ pos: position{line: 1282, col: 4, offset: 29095}, val: "\t", ignoreCase: false, }, &litMatcher{ pos: position{line: 1283, col: 4, offset: 29116}, val: "\n", ignoreCase: false, }, &litMatcher{ pos: position{line: 1284, col: 4, offset: 29137}, val: "\v", ignoreCase: false, }, &litMatcher{ pos: position{line: 1285, col: 4, offset: 29158}, val: "\f", ignoreCase: false, }, &litMatcher{ pos: position{line: 1286, col: 4, offset: 29179}, val: "\r", ignoreCase: false, }, &litMatcher{ pos: position{line: 1287, col: 4, offset: 29200}, val: " ", ignoreCase: false, }, }, }, }, { name: "EOF", pos: position{line: 1289, col: 1, offset: 29222}, expr: ¬Expr{ pos: position{line: 1290, col: 4, offset: 29229}, expr: &anyMatcher{ line: 1290, col: 5, offset: 29230, }, }, }, }, } func (c *current) onS10(s interface{}) (interface{}, error) { return s, nil } func (p *parser) callonS10() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onS10(stack["s"]) } func (c *current) onS1(x, xs interface{}) (interface{}, error) { nodeSlice := prepend(x, assertSlice(xs)) stmtSlice := make([]ast.StmtNode, len(nodeSlice)) for idx := range nodeSlice { if nodeSlice[idx] != nil { stmtSlice[idx] = nodeSlice[idx].(ast.StmtNode) } else { stmtSlice[idx] = nil } } return stmtSlice, nil } func (p *parser) callonS1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onS1(stack["x"], stack["xs"]) } func (c *current) onSelectStmt10(s interface{}) (interface{}, error) { return s, nil } func (p *parser) callonSelectStmt10() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onSelectStmt10(stack["s"]) } func (c *current) onSelectStmt19(i interface{}) (interface{}, error) { return i, nil } func (p *parser) callonSelectStmt19() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onSelectStmt19(stack["i"]) } func (c *current) onSelectStmt28(w interface{}) (interface{}, error) { return w, nil } func (p *parser) callonSelectStmt28() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onSelectStmt28(stack["w"]) } func (c *current) onSelectStmt35(g interface{}) (interface{}, error) { return g, nil } func (p *parser) callonSelectStmt35() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onSelectStmt35(stack["g"]) } func (c *current) onSelectStmt42(or interface{}) (interface{}, error) { return or, nil } func (p *parser) callonSelectStmt42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onSelectStmt42(stack["or"]) } func (c *current) onSelectStmt49(l interface{}) (interface{}, error) { return l, nil } func (p *parser) callonSelectStmt49() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onSelectStmt49(stack["l"]) } func (c *current) onSelectStmt56(of interface{}) (interface{}, error) { return of, nil } func (p *parser) callonSelectStmt56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onSelectStmt56(stack["of"]) } func (c *current) onSelectStmt1(v, f, fs, table, where, group, order, limit, offset interface{}) (interface{}, error) { node := &ast.SelectStmtNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.SetVerb(v.([]byte)) node.Column = assertExprSlice(prepend(f, assertSlice(fs))) if table != nil { node.Table = table.(*ast.IdentifierNode) } if where != nil { node.Where = where.(*ast.WhereOptionNode) } groupSlice := assertSlice(group) node.Group = make([]*ast.GroupOptionNode, len(groupSlice)) for idx := range groupSlice { node.Group[idx] = groupSlice[idx].(*ast.GroupOptionNode) } orderSlice := assertSlice(order) node.Order = make([]*ast.OrderOptionNode, len(orderSlice)) for idx := range orderSlice { node.Order[idx] = orderSlice[idx].(*ast.OrderOptionNode) } if limit != nil { node.Limit = limit.(*ast.LimitOptionNode) } if offset != nil { node.Offset = offset.(*ast.OffsetOptionNode) } return node, nil } func (p *parser) callonSelectStmt1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onSelectStmt1(stack["v"], stack["f"], stack["fs"], stack["table"], stack["where"], stack["group"], stack["order"], stack["limit"], stack["offset"]) } func (c *current) onUpdateStmt15(s interface{}) (interface{}, error) { return s, nil } func (p *parser) callonUpdateStmt15() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onUpdateStmt15(stack["s"]) } func (c *current) onUpdateStmt24(w interface{}) (interface{}, error) { return w, nil } func (p *parser) callonUpdateStmt24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onUpdateStmt24(stack["w"]) } func (c *current) onUpdateStmt1(v, table, a, as, where interface{}) (interface{}, error) { node := &ast.UpdateStmtNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.SetVerb(v.([]byte)) node.Table = table.(*ast.IdentifierNode) assignSlice := prepend(a, assertSlice(as)) node.Assignment = make([]*ast.AssignOperatorNode, len(assignSlice)) for idx := range assignSlice { node.Assignment[idx] = assignSlice[idx].(*ast.AssignOperatorNode) } if where != nil { node.Where = where.(*ast.WhereOptionNode) } return node, nil } func (p *parser) callonUpdateStmt1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onUpdateStmt1(stack["v"], stack["table"], stack["a"], stack["as"], stack["where"]) } func (c *current) onDeleteStmt14(w interface{}) (interface{}, error) { return w, nil } func (p *parser) callonDeleteStmt14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onDeleteStmt14(stack["w"]) } func (c *current) onDeleteStmt1(v1, v2, v3, table, where interface{}) (interface{}, error) { node := &ast.DeleteStmtNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.SetVerb(bytes.Join([][]byte{ v1.([]byte), v2.([]byte), v3.([]byte)}, nil)) node.Table = table.(*ast.IdentifierNode) if where != nil { node.Where = where.(*ast.WhereOptionNode) } return node, nil } func (p *parser) callonDeleteStmt1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onDeleteStmt1(stack["v1"], stack["v2"], stack["v3"], stack["table"], stack["where"]) } func (c *current) onInsertStmt1(v1, v2, v3, table, insert interface{}) (interface{}, error) { node := &ast.InsertStmtNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.SetVerb(bytes.Join([][]byte{ v1.([]byte), v2.([]byte), v3.([]byte)}, nil)) node.Table = table.(*ast.IdentifierNode) switch i := insert.(type) { case *ast.InsertWithColumnOptionNode: node.Insert = i case *ast.InsertWithDefaultOptionNode: node.Insert = i default: panic(fmt.Sprintf("unknown insert type %T", insert)) } return node, nil } func (p *parser) callonInsertStmt1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onInsertStmt1(stack["v1"], stack["v2"], stack["v3"], stack["table"], stack["insert"]) } func (c *current) onInsertValue1(e interface{}) (interface{}, error) { return e, nil } func (p *parser) callonInsertValue1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onInsertValue1(stack["e"]) } func (c *current) onCreateTableStmt23(t interface{}) (interface{}, error) { return t, nil } func (p *parser) callonCreateTableStmt23() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onCreateTableStmt23(stack["t"]) } func (c *current) onCreateTableStmt17(s, ss interface{}) (interface{}, error) { return prepend(s, assertSlice(ss)), nil } func (p *parser) callonCreateTableStmt17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onCreateTableStmt17(stack["s"], stack["ss"]) } func (c *current) onCreateTableStmt1(v1, v2, v3, table, column interface{}) (interface{}, error) { node := &ast.CreateTableStmtNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.SetVerb(bytes.Join([][]byte{ v1.([]byte), v2.([]byte), v3.([]byte)}, nil)) node.Table = table.(*ast.IdentifierNode) columnSlice := assertSlice(column) node.Column = make([]*ast.ColumnSchemaNode, len(columnSlice)) for idx := range columnSlice { node.Column[idx] = columnSlice[idx].(*ast.ColumnSchemaNode) } return node, nil } func (p *parser) callonCreateTableStmt1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onCreateTableStmt1(stack["v1"], stack["v2"], stack["v3"], stack["table"], stack["column"]) } func (c *current) onColumnSchema10(s interface{}) (interface{}, error) { return s, nil } func (p *parser) callonColumnSchema10() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onColumnSchema10(stack["s"]) } func (c *current) onColumnSchema1(i, t, cs interface{}) (interface{}, error) { node := &ast.ColumnSchemaNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Column = i.(*ast.IdentifierNode) node.DataType = t.(ast.TypeNode) constraintSlice := assertSlice(cs) node.Constraint = make([]ast.Node, len(constraintSlice)) for idx, constraint := range constraintSlice { switch c := constraint.(type) { case *ast.PrimaryOptionNode: node.Constraint[idx] = c case *ast.NotNullOptionNode: node.Constraint[idx] = c case *ast.UniqueOptionNode: node.Constraint[idx] = c case *ast.DefaultOptionNode: node.Constraint[idx] = c case *ast.ForeignOptionNode: node.Constraint[idx] = c case *ast.AutoIncrementOptionNode: node.Constraint[idx] = c default: panic(fmt.Sprintf("unknown constraint type %T", c)) } } return node, nil } func (p *parser) callonColumnSchema1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onColumnSchema1(stack["i"], stack["t"], stack["cs"]) } func (c *current) onCreateIndexStmt7(u interface{}) (interface{}, error) { return u, nil } func (p *parser) callonCreateIndexStmt7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onCreateIndexStmt7(stack["u"]) } func (c *current) onCreateIndexStmt31(x interface{}) (interface{}, error) { return x, nil } func (p *parser) callonCreateIndexStmt31() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onCreateIndexStmt31(stack["x"]) } func (c *current) onCreateIndexStmt1(v1, unique, v2, v3, index, table, i, is interface{}) (interface{}, error) { node := &ast.CreateIndexStmtNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.SetVerb(bytes.Join([][]byte{ v1.([]byte), v2.([]byte), v3.([]byte)}, nil)) node.Index = index.(*ast.IdentifierNode) node.Table = table.(*ast.IdentifierNode) columnSlice := assertSlice(prepend(i, assertSlice(is))) node.Column = make([]*ast.IdentifierNode, len(columnSlice)) for idx := range columnSlice { node.Column[idx] = columnSlice[idx].(*ast.IdentifierNode) } if unique != nil { node.Unique = unique.(*ast.UniqueOptionNode) } return node, nil } func (p *parser) callonCreateIndexStmt1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onCreateIndexStmt1(stack["v1"], stack["unique"], stack["v2"], stack["v3"], stack["index"], stack["table"], stack["i"], stack["is"]) } func (c *current) onWhereClause1(e interface{}) (interface{}, error) { node := &ast.WhereOptionNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Condition = e.(ast.ExprNode) return node, nil } func (p *parser) callonWhereClause1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onWhereClause1(stack["e"]) } func (c *current) onOrderByClause11(s interface{}) (interface{}, error) { return s, nil } func (p *parser) callonOrderByClause11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOrderByClause11(stack["s"]) } func (c *current) onOrderByClause1(f, fs interface{}) (interface{}, error) { return prepend(f, assertSlice(fs)), nil } func (p *parser) callonOrderByClause1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOrderByClause1(stack["f"], stack["fs"]) } func (c *current) onOrderColumn7(t interface{}) (interface{}, error) { return t, nil } func (p *parser) callonOrderColumn7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOrderColumn7(stack["t"]) } func (c *current) onOrderColumn16(l interface{}) (interface{}, error) { return l, nil } func (p *parser) callonOrderColumn16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOrderColumn16(stack["l"]) } func (c *current) onOrderColumn1(i, s, n interface{}) (interface{}, error) { node := &ast.OrderOptionNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Expr = i.(ast.ExprNode) node.Desc = s != nil && bytes.EqualFold(s.([]byte), []byte("DESC")) node.NullsFirst = n != nil && bytes.EqualFold(n.([]byte), []byte("FIRST")) return node, nil } func (p *parser) callonOrderColumn1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOrderColumn1(stack["i"], stack["s"], stack["n"]) } func (c *current) onGroupByClause11(s interface{}) (interface{}, error) { return s, nil } func (p *parser) callonGroupByClause11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onGroupByClause11(stack["s"]) } func (c *current) onGroupByClause1(f, fs interface{}) (interface{}, error) { return prepend(f, assertSlice(fs)), nil } func (p *parser) callonGroupByClause1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onGroupByClause1(stack["f"], stack["fs"]) } func (c *current) onGroupColumn1(i interface{}) (interface{}, error) { node := &ast.GroupOptionNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Expr = i.(ast.ExprNode) return node, nil } func (p *parser) callonGroupColumn1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onGroupColumn1(stack["i"]) } func (c *current) onOffsetClause1(i interface{}) (interface{}, error) { node := &ast.OffsetOptionNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Value = i.(*ast.IntegerValueNode) return node, nil } func (p *parser) callonOffsetClause1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOffsetClause1(stack["i"]) } func (c *current) onLimitClause1(i interface{}) (interface{}, error) { node := &ast.LimitOptionNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Value = i.(*ast.IntegerValueNode) return node, nil } func (p *parser) callonLimitClause1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLimitClause1(stack["i"]) } func (c *current) onInsertWithColumnClause13(x interface{}) (interface{}, error) { return x, nil } func (p *parser) callonInsertWithColumnClause13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onInsertWithColumnClause13(stack["x"]) } func (c *current) onInsertWithColumnClause5(f, fs interface{}) (interface{}, error) { return prepend(f, assertSlice(fs)), nil } func (p *parser) callonInsertWithColumnClause5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onInsertWithColumnClause5(stack["f"], stack["fs"]) } func (c *current) onInsertWithColumnClause29(y interface{}) (interface{}, error) { return y, nil } func (p *parser) callonInsertWithColumnClause29() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onInsertWithColumnClause29(stack["y"]) } func (c *current) onInsertWithColumnClause1(cs, v, vs interface{}) (interface{}, error) { node := &ast.InsertWithColumnOptionNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) columnSlice := assertSlice(cs) node.Column = make([]*ast.IdentifierNode, len(columnSlice)) for idx := range columnSlice { node.Column[idx] = columnSlice[idx].(*ast.IdentifierNode) } valueSlice := assertSlice(vs) node.Value = make([][]ast.ExprNode, len(valueSlice)+1) node.Value[0] = v.([]ast.ExprNode) for idx := range valueSlice { node.Value[idx+1] = valueSlice[idx].([]ast.ExprNode) } return node, nil } func (p *parser) callonInsertWithColumnClause1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onInsertWithColumnClause1(stack["cs"], stack["v"], stack["vs"]) } func (c *current) onInsertWithDefaultClause1() (interface{}, error) { node := &ast.InsertWithDefaultOptionNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonInsertWithDefaultClause1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onInsertWithDefaultClause1() } func (c *current) onPrimaryKeyClause1() (interface{}, error) { node := &ast.PrimaryOptionNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonPrimaryKeyClause1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onPrimaryKeyClause1() } func (c *current) onNotNullClause1() (interface{}, error) { node := &ast.NotNullOptionNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonNotNullClause1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onNotNullClause1() } func (c *current) onUniqueClause1() (interface{}, error) { node := &ast.UniqueOptionNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonUniqueClause1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onUniqueClause1() } func (c *current) onDefaultClause1(e interface{}) (interface{}, error) { node := &ast.DefaultOptionNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Value = e.(ast.ExprNode) return node, nil } func (p *parser) callonDefaultClause1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onDefaultClause1(stack["e"]) } func (c *current) onForeignClause1(t, f interface{}) (interface{}, error) { node := &ast.ForeignOptionNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Table = t.(*ast.IdentifierNode) node.Column = f.(*ast.IdentifierNode) return node, nil } func (p *parser) callonForeignClause1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onForeignClause1(stack["t"], stack["f"]) } func (c *current) onAutoincrementClause1() (interface{}, error) { node := &ast.AutoIncrementOptionNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonAutoincrementClause1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onAutoincrementClause1() } func (c *current) onExprWithDefault2(d interface{}) (interface{}, error) { return d, nil } func (p *parser) callonExprWithDefault2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onExprWithDefault2(stack["d"]) } func (c *current) onLogicExpr47(op, s interface{}) (interface{}, error) { return opSetSubject(op.(ast.BinaryOperator), s.(ast.ExprNode)), nil } func (p *parser) callonLogicExpr47() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr47(stack["op"], stack["s"]) } func (c *current) onLogicExpr41(o, os interface{}) (interface{}, error) { return rightJoinOperators(o.(ast.ExprNode), assertExprSlice(os)), nil } func (p *parser) callonLogicExpr41() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr41(stack["o"], stack["os"]) } func (c *current) onLogicExpr37(op, s interface{}) (interface{}, error) { return opSetSubject(op.(ast.BinaryOperator), s.(ast.ExprNode)), nil } func (p *parser) callonLogicExpr37() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr37(stack["op"], stack["s"]) } func (c *current) onLogicExpr31(o, os interface{}) (interface{}, error) { return rightJoinOperators(o.(ast.ExprNode), assertExprSlice(os)), nil } func (p *parser) callonLogicExpr31() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr31(stack["o"], stack["os"]) } func (c *current) onLogicExpr22(op, s interface{}) (interface{}, error) { return opSetTarget(op.(ast.UnaryOperator), s.(ast.ExprNode)), nil } func (p *parser) callonLogicExpr22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr22(stack["op"], stack["s"]) } func (c *current) onLogicExpr17(l interface{}) (interface{}, error) { return l, nil } func (p *parser) callonLogicExpr17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr17(stack["l"]) } func (c *current) onLogicExpr11(o, os interface{}) (interface{}, error) { return rightJoinOperators(o.(ast.ExprNode), assertExprSlice(os)), nil } func (p *parser) callonLogicExpr11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr11(stack["o"], stack["os"]) } func (c *current) onLogicExpr1In5(t interface{}) (interface{}, error) { return t, nil } func (p *parser) callonLogicExpr1In5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr1In5(stack["t"]) } func (c *current) onLogicExpr1In1(n, s interface{}) (interface{}, error) { node := &ast.InOperatorNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Right = s.([]ast.ExprNode) if n != nil { return opSetTarget(n.(ast.UnaryOperator), node), nil } return node, nil } func (p *parser) callonLogicExpr1In1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr1In1(stack["n"], stack["s"]) } func (c *current) onLogicExpr1Is6(t interface{}) (interface{}, error) { return t, nil } func (p *parser) callonLogicExpr1Is6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr1Is6(stack["t"]) } func (c *current) onLogicExpr1Is1(n, u interface{}) (interface{}, error) { node := &ast.IsOperatorNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) opSetSubject(node, u.(*ast.NullValueNode)) if n != nil { return opSetTarget(n.(ast.UnaryOperator), node), nil } return node, nil } func (p *parser) callonLogicExpr1Is1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr1Is1(stack["n"], stack["u"]) } func (c *current) onLogicExpr1Like5(t interface{}) (interface{}, error) { return t, nil } func (p *parser) callonLogicExpr1Like5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr1Like5(stack["t"]) } func (c *current) onLogicExpr1Like16(e interface{}) (interface{}, error) { return e, nil } func (p *parser) callonLogicExpr1Like16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr1Like16(stack["e"]) } func (c *current) onLogicExpr1Like1(n, s, escape interface{}) (interface{}, error) { node := &ast.LikeOperatorNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) opSetSubject(node, s.(ast.ExprNode)) if escape != nil { node.Escape = escape.(ast.ExprNode) } if n != nil { return opSetTarget(n.(ast.UnaryOperator), node), nil } return node, nil } func (p *parser) callonLogicExpr1Like1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr1Like1(stack["n"], stack["s"], stack["escape"]) } func (c *current) onLogicExpr1Cmp1(op, s interface{}) (interface{}, error) { return opSetSubject(op.(ast.BinaryOperator), s.(ast.ExprNode)), nil } func (p *parser) callonLogicExpr1Cmp1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLogicExpr1Cmp1(stack["op"], stack["s"]) } func (c *current) onArithmeticExpr37(op, s interface{}) (interface{}, error) { return opSetSubject(op.(ast.BinaryOperator), s.(ast.ExprNode)), nil } func (p *parser) callonArithmeticExpr37() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onArithmeticExpr37(stack["op"], stack["s"]) } func (c *current) onArithmeticExpr31(o, os interface{}) (interface{}, error) { return rightJoinOperators(o.(ast.ExprNode), assertExprSlice(os)), nil } func (p *parser) callonArithmeticExpr31() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onArithmeticExpr31(stack["o"], stack["os"]) } func (c *current) onArithmeticExpr27(op, s interface{}) (interface{}, error) { return opSetSubject(op.(ast.BinaryOperator), s.(ast.ExprNode)), nil } func (p *parser) callonArithmeticExpr27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onArithmeticExpr27(stack["op"], stack["s"]) } func (c *current) onArithmeticExpr21(o, os interface{}) (interface{}, error) { return rightJoinOperators(o.(ast.ExprNode), assertExprSlice(os)), nil } func (p *parser) callonArithmeticExpr21() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onArithmeticExpr21(stack["o"], stack["os"]) } func (c *current) onArithmeticExpr17(op, s interface{}) (interface{}, error) { return opSetSubject(op.(ast.BinaryOperator), s.(ast.ExprNode)), nil } func (p *parser) callonArithmeticExpr17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onArithmeticExpr17(stack["op"], stack["s"]) } func (c *current) onArithmeticExpr11(o, os interface{}) (interface{}, error) { return rightJoinOperators(o.(ast.ExprNode), assertExprSlice(os)), nil } func (p *parser) callonArithmeticExpr11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onArithmeticExpr11(stack["o"], stack["os"]) } func (c *current) onMultiExpr7(e interface{}) (interface{}, error) { return e, nil } func (p *parser) callonMultiExpr7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onMultiExpr7(stack["e"]) } func (c *current) onMultiExpr1(x, xs interface{}) (interface{}, error) { return assertExprSlice(prepend(x, assertSlice(xs))), nil } func (p *parser) callonMultiExpr1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onMultiExpr1(stack["x"], stack["xs"]) } func (c *current) onMultiExprWithDefault7(e interface{}) (interface{}, error) { return e, nil } func (p *parser) callonMultiExprWithDefault7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onMultiExprWithDefault7(stack["e"]) } func (c *current) onMultiExprWithDefault1(x, xs interface{}) (interface{}, error) { return assertExprSlice(prepend(x, assertSlice(xs))), nil } func (p *parser) callonMultiExprWithDefault1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onMultiExprWithDefault1(stack["x"], stack["xs"]) } func (c *current) onOperand2(op, s interface{}) (interface{}, error) { return opSetTarget(op.(ast.UnaryOperator), s.(ast.ExprNode)), nil } func (p *parser) callonOperand2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOperand2(stack["op"], stack["s"]) } func (c *current) onOperand9(e interface{}) (interface{}, error) { node := &ast.ParenOperatorNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) opSetTarget(node, e.(ast.ExprNode)) return node, nil } func (p *parser) callonOperand9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOperand9(stack["e"]) } func (c *current) onOperand17(t interface{}) (interface{}, error) { return t, nil } func (p *parser) callonOperand17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOperand17(stack["t"]) } func (c *current) onTypeCast1(o, s interface{}) (interface{}, error) { node := &ast.CastOperatorNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.SourceExpr = o.(ast.ExprNode) node.TargetType = s.(ast.TypeNode) return node, nil } func (p *parser) callonTypeCast1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onTypeCast1(stack["o"], stack["s"]) } func (c *current) onFunctionCall1(i, r interface{}) (interface{}, error) { node := &ast.FunctionOperatorNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Name = i.(*ast.IdentifierNode) if r != nil { node.Args = r.([]ast.ExprNode) } return node, nil } func (p *parser) callonFunctionCall1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onFunctionCall1(stack["i"], stack["r"]) } func (c *current) onFunctionArgs2(a interface{}) (interface{}, error) { return []ast.ExprNode{a.(*ast.AnyValueNode)}, nil } func (p *parser) callonFunctionArgs2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onFunctionArgs2(stack["a"]) } func (c *current) onAssignment1(i, e interface{}) (interface{}, error) { node := &ast.AssignOperatorNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Column = i.(*ast.IdentifierNode) node.Expr = e.(ast.ExprNode) return node, nil } func (p *parser) callonAssignment1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onAssignment1(stack["i"], stack["e"]) } func (c *current) onSignOperator1() (interface{}, error) { var node ast.UnaryOperator switch string(c.text) { case "+": node = &ast.PosOperatorNode{} case "-": node = &ast.NegOperatorNode{} default: panic(fmt.Sprintf("unknown sign %s", c.text)) } node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonSignOperator1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onSignOperator1() } func (c *current) onNotOperator1() (interface{}, error) { node := &ast.NotOperatorNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonNotOperator1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onNotOperator1() } func (c *current) onAndOperator1() (interface{}, error) { node := &ast.AndOperatorNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonAndOperator1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onAndOperator1() } func (c *current) onOrOperator1() (interface{}, error) { node := &ast.OrOperatorNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonOrOperator1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOrOperator1() } func (c *current) onCmpOperator1() (interface{}, error) { var node ast.BinaryOperator switch string(c.text) { case "<=": node = &ast.LessOrEqualOperatorNode{} case ">=": node = &ast.GreaterOrEqualOperatorNode{} case "<>": node = &ast.NotEqualOperatorNode{} case "!=": node = &ast.NotEqualOperatorNode{} case "<": node = &ast.LessOperatorNode{} case ">": node = &ast.GreaterOperatorNode{} case "=": node = &ast.EqualOperatorNode{} default: panic(fmt.Sprintf("unknown comparison operator %s", c.text)) } node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonCmpOperator1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onCmpOperator1() } func (c *current) onConcatOperator1() (interface{}, error) { node := &ast.ConcatOperatorNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonConcatOperator1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onConcatOperator1() } func (c *current) onAddSubOperator1() (interface{}, error) { var node ast.BinaryOperator switch string(c.text) { case "+": node = &ast.AddOperatorNode{} case "-": node = &ast.SubOperatorNode{} default: panic(fmt.Sprintf("unknown addition or subtraction operator %s", c.text)) } node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonAddSubOperator1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onAddSubOperator1() } func (c *current) onMulDivModOperator1() (interface{}, error) { var node ast.BinaryOperator switch string(c.text) { case "*": node = &ast.MulOperatorNode{} case "/": node = &ast.DivOperatorNode{} case "%": node = &ast.ModOperatorNode{} default: panic(fmt.Sprintf("unknown multiplication, division, modulo operator: %s", c.text)) } node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonMulDivModOperator1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onMulDivModOperator1() } func (c *current) onUIntType1(s interface{}) (interface{}, error) { node := &ast.IntTypeNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Unsigned = true size, code := toUint(s.([]byte)) if code != se.ErrorCodeNil { err := se.Error{ Position: uint32(c.pos.offset), Length: uint32(len(c.text)), Category: se.ErrorCategoryGrammar, Code: code, Prefix: "UIntType", Message: fmt.Sprintf("cannot parse %s as uint32: %v", s, code), } return node, err } node.Size = size return node, nil } func (p *parser) callonUIntType1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onUIntType1(stack["s"]) } func (c *current) onIntType1(s interface{}) (interface{}, error) { node := &ast.IntTypeNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Unsigned = false size, code := toUint(s.([]byte)) if code != se.ErrorCodeNil { err := se.Error{ Position: uint32(c.pos.offset), Length: uint32(len(c.text)), Category: se.ErrorCategoryGrammar, Code: code, Prefix: "IntType", Message: fmt.Sprintf("cannot parse %s as uint32: %v", s, code), } return node, err } node.Size = size return node, nil } func (p *parser) callonIntType1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onIntType1(stack["s"]) } func (c *current) onUFixedType1(s, t interface{}) (interface{}, error) { node := &ast.FixedTypeNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Unsigned = true size, code := toUint(s.([]byte)) if code != se.ErrorCodeNil { err := se.Error{ Position: uint32(c.pos.offset), Length: uint32(len(c.text)), Category: se.ErrorCategoryGrammar, Code: code, Prefix: "UFixedType", Message: fmt.Sprintf("cannot parse %s as uint32: %v", s, code), } return node, err } fractionalDigits, code := toUint(t.([]byte)) if code != se.ErrorCodeNil { err := se.Error{ Position: uint32(c.pos.offset), Length: uint32(len(c.text)), Category: se.ErrorCategoryGrammar, Code: code, Prefix: "UFixedType", Message: fmt.Sprintf("cannot parse %s as uint32: %v", t, code), } return node, err } node.Size = size node.FractionalDigits = fractionalDigits return node, nil } func (p *parser) callonUFixedType1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onUFixedType1(stack["s"], stack["t"]) } func (c *current) onFixedType1(s, t interface{}) (interface{}, error) { node := &ast.FixedTypeNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Unsigned = false size, code := toUint(s.([]byte)) if code != se.ErrorCodeNil { err := se.Error{ Position: uint32(c.pos.offset), Length: uint32(len(c.text)), Category: se.ErrorCategoryGrammar, Code: code, Prefix: "FixedType", Message: fmt.Sprintf("cannot parse %s as uint32: %v", s, code), } return node, err } fractionalDigits, code := toUint(t.([]byte)) if code != se.ErrorCodeNil { err := se.Error{ Position: uint32(c.pos.offset), Length: uint32(len(c.text)), Category: se.ErrorCategoryGrammar, Code: code, Prefix: "FixedType", Message: fmt.Sprintf("cannot parse %s as uint32: %v", t, code), } return node, err } node.Size = size node.FractionalDigits = fractionalDigits return node, nil } func (p *parser) callonFixedType1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onFixedType1(stack["s"], stack["t"]) } func (c *current) onFixedBytesType2(s interface{}) (interface{}, error) { node := &ast.FixedBytesTypeNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) size, code := toUint(s.([]byte)) if code != se.ErrorCodeNil { err := se.Error{ Position: uint32(c.pos.offset), Length: uint32(len(c.text)), Category: se.ErrorCategoryGrammar, Code: code, Prefix: "FixedBytesType", Message: fmt.Sprintf("cannot parse %s as uint32: %v", s, code), } return node, err } node.Size = size return node, nil } func (p *parser) callonFixedBytesType2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onFixedBytesType2(stack["s"]) } func (c *current) onFixedBytesType9() (interface{}, error) { node := &ast.FixedBytesTypeNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Size = 1 return node, nil } func (p *parser) callonFixedBytesType9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onFixedBytesType9() } func (c *current) onDynamicBytesType1() (interface{}, error) { node := &ast.DynamicBytesTypeNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonDynamicBytesType1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onDynamicBytesType1() } func (c *current) onAddressType1() (interface{}, error) { node := &ast.AddressTypeNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonAddressType1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onAddressType1() } func (c *current) onBoolType1() (interface{}, error) { node := &ast.BoolTypeNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonBoolType1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onBoolType1() } func (c *current) onAnyLiteral1() (interface{}, error) { node := &ast.AnyValueNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonAnyLiteral1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onAnyLiteral1() } func (c *current) onDefaultLiteral1() (interface{}, error) { node := &ast.DefaultValueNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonDefaultLiteral1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onDefaultLiteral1() } func (c *current) onBoolLiteral1(b interface{}) (interface{}, error) { node := &ast.BoolValueNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.V = bytes.EqualFold(b.([]byte), []byte("TRUE")) return node, nil } func (p *parser) callonBoolLiteral1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onBoolLiteral1(stack["b"]) } func (c *current) onNullLiteral1() (interface{}, error) { node := &ast.NullValueNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonNullLiteral1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onNullLiteral1() } func (c *current) onNumberLiteral2(h interface{}) (interface{}, error) { return h, nil } func (p *parser) callonNumberLiteral2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onNumberLiteral2(stack["h"]) } func (c *current) onIntegerLiteral1() (interface{}, error) { node := &ast.IntegerValueNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.IsAddress = false v, code := toDecimal(c.text) if code != se.ErrorCodeNil { err := se.Error{ Position: uint32(c.pos.offset), Length: uint32(len(c.text)), Category: se.ErrorCategoryGrammar, Code: code, Prefix: "IntegerLiteral", Message: fmt.Sprintf("cannot parse %s as decimal: %v", c.text, code), } return node, err } node.V = v return node, nil } func (p *parser) callonIntegerLiteral1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onIntegerLiteral1() } func (c *current) onNonZeroLeadingInteger1() (interface{}, error) { return c.text, nil } func (p *parser) callonNonZeroLeadingInteger1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onNonZeroLeadingInteger1() } func (c *current) onFixnum1() (interface{}, error) { return c.text, nil } func (p *parser) callonFixnum1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onFixnum1() } func (c *current) onDecimal1(m, e interface{}) (interface{}, error) { var node ast.ExprNode var err error integer := bytes.IndexByte(m.([]byte), '.') == -1 && e == nil v, code := toDecimal(c.text) if code != se.ErrorCodeNil { err = se.Error{ Position: uint32(c.pos.offset), Length: uint32(len(c.text)), Category: se.ErrorCategoryGrammar, Code: code, Prefix: "Decimal", Message: fmt.Sprintf("cannot parse %s as decimal: %v", c.text, code), } } if integer { realNode := &ast.IntegerValueNode{} realNode.SetPosition(uint32(c.pos.offset)) realNode.SetLength(uint32(len(c.text))) realNode.IsAddress = false if err == nil { realNode.V = v } node = realNode } else { realNode := &ast.DecimalValueNode{} realNode.SetPosition(uint32(c.pos.offset)) realNode.SetLength(uint32(len(c.text))) if err == nil { realNode.V = v } node = realNode } return node, err } func (p *parser) callonDecimal1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onDecimal1(stack["m"], stack["e"]) } func (c *current) onHex1() (interface{}, error) { node := hexToInteger(c.text) node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) return node, nil } func (p *parser) callonHex1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onHex1() } func (c *current) onHexString9() (interface{}, error) { return c.text, nil } func (p *parser) callonHexString9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onHexString9() } func (c *current) onHexString1(s interface{}) (interface{}, error) { node := &ast.BytesValueNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.V = hexToBytes(joinBytes(assertSlice(s))) return node, nil } func (p *parser) callonHexString1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onHexString1(stack["s"]) } func (c *current) onNormalString6() (interface{}, error) { return c.text, nil } func (p *parser) callonNormalString6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onNormalString6() } func (c *current) onNormalString1(s interface{}) (interface{}, error) { node := &ast.BytesValueNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) bs := joinBytes(assertSlice(s)) v, bad, code := resolveString(bs) if code != se.ErrorCodeNil { msg := fmt.Sprintf("cannot resolve escape sequence '%s': %v", sanitizeBadEscape(bad), code) err := se.Error{ Position: uint32(c.pos.offset), Length: uint32(len(c.text)), Category: se.ErrorCategoryGrammar, Code: code, Prefix: "NormalString", Message: msg, } return node, err } node.V = v return node, nil } func (p *parser) callonNormalString1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onNormalString1(stack["s"]) } func (c *current) onSelectToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonSelectToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onSelectToken1() } func (c *current) onFromToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonFromToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onFromToken1() } func (c *current) onWhereToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonWhereToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onWhereToken1() } func (c *current) onOrderToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonOrderToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOrderToken1() } func (c *current) onByToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonByToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onByToken1() } func (c *current) onGroupToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonGroupToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onGroupToken1() } func (c *current) onLimitToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonLimitToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLimitToken1() } func (c *current) onOffsetToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonOffsetToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOffsetToken1() } func (c *current) onUpdateToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonUpdateToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onUpdateToken1() } func (c *current) onSetToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonSetToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onSetToken1() } func (c *current) onDeleteToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonDeleteToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onDeleteToken1() } func (c *current) onInsertToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonInsertToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onInsertToken1() } func (c *current) onIntoToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonIntoToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onIntoToken1() } func (c *current) onValuesToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonValuesToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onValuesToken1() } func (c *current) onCreateToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonCreateToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onCreateToken1() } func (c *current) onTableToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonTableToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onTableToken1() } func (c *current) onIndexToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonIndexToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onIndexToken1() } func (c *current) onUniqueToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonUniqueToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onUniqueToken1() } func (c *current) onDefaultToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonDefaultToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onDefaultToken1() } func (c *current) onPrimaryToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonPrimaryToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onPrimaryToken1() } func (c *current) onKeyToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonKeyToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onKeyToken1() } func (c *current) onReferencesToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonReferencesToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onReferencesToken1() } func (c *current) onAutoincrementToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonAutoincrementToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onAutoincrementToken1() } func (c *current) onOnToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonOnToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOnToken1() } func (c *current) onTrueToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonTrueToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onTrueToken1() } func (c *current) onFalseToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonFalseToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onFalseToken1() } func (c *current) onNullToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonNullToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onNullToken1() } func (c *current) onIsToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonIsToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onIsToken1() } func (c *current) onNullsToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonNullsToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onNullsToken1() } func (c *current) onLastToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonLastToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLastToken1() } func (c *current) onFirstToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonFirstToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onFirstToken1() } func (c *current) onAndToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonAndToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onAndToken1() } func (c *current) onOrToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonOrToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOrToken1() } func (c *current) onNotToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonNotToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onNotToken1() } func (c *current) onInToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonInToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onInToken1() } func (c *current) onLikeToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonLikeToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLikeToken1() } func (c *current) onEscapeToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonEscapeToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onEscapeToken1() } func (c *current) onAscToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonAscToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onAscToken1() } func (c *current) onDescToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonDescToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onDescToken1() } func (c *current) onCastToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonCastToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onCastToken1() } func (c *current) onAsToken1() (interface{}, error) { return c.text, nil } func (p *parser) callonAsToken1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onAsToken1() } func (c *current) onNormalIdentifier1() (interface{}, error) { node := &ast.IdentifierNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) node.Name = decodeString(c.text) return node, nil } func (p *parser) callonNormalIdentifier1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onNormalIdentifier1() } func (c *current) onStringIdentifier6() (interface{}, error) { return c.text, nil } func (p *parser) callonStringIdentifier6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onStringIdentifier6() } func (c *current) onStringIdentifier1(s interface{}) (interface{}, error) { node := &ast.IdentifierNode{} node.SetPosition(uint32(c.pos.offset)) node.SetLength(uint32(len(c.text))) bs := joinBytes(assertSlice(s)) name, bad, code := resolveString(bs) if code != se.ErrorCodeNil { msg := fmt.Sprintf("cannot resolve escape sequence '%s': %v", sanitizeBadEscape(bad), code) err := se.Error{ Position: uint32(c.pos.offset), Length: uint32(len(c.text)), Category: se.ErrorCategoryGrammar, Code: code, Prefix: "StringIdentifier", Message: msg, } return node, err } node.Name = name return node, nil } func (p *parser) callonStringIdentifier1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onStringIdentifier1(stack["s"]) } func (c *current) on_1() (interface{}, error) { return c.text, nil } func (p *parser) callon_1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.on_1() } var ( // errNoRule is returned when the grammar to parse has no rule. errNoRule = errors.New("grammar has no rule") // errInvalidEntrypoint is returned when the specified entrypoint rule // does not exit. errInvalidEntrypoint = errors.New("invalid entrypoint") // errInvalidEncoding is returned when the source is not properly // utf8-encoded. errInvalidEncoding = errors.New("invalid encoding") // errMaxExprCnt is used to signal that the maximum number of // expressions have been parsed. errMaxExprCnt = errors.New("max number of expresssions parsed") ) // Option is a function that can set an option on the parser. It returns // the previous setting as an Option. type Option func(*parser) Option // MaxExpressions creates an Option to stop parsing after the provided // number of expressions have been parsed, if the value is 0 then the parser will // parse for as many steps as needed (possibly an infinite number). // // The default for maxExprCnt is 0. func MaxExpressions(maxExprCnt uint64) Option { return func(p *parser) Option { oldMaxExprCnt := p.maxExprCnt p.maxExprCnt = maxExprCnt return MaxExpressions(oldMaxExprCnt) } } // Entrypoint creates an Option to set the rule name to use as entrypoint. // The rule name must have been specified in the -alternate-entrypoints // if generating the parser with the -optimize-grammar flag, otherwise // it may have been optimized out. Passing an empty string sets the // entrypoint to the first rule in the grammar. // // The default is to start parsing at the first rule in the grammar. func Entrypoint(ruleName string) Option { return func(p *parser) Option { oldEntrypoint := p.entrypoint p.entrypoint = ruleName if ruleName == "" { p.entrypoint = g.rules[0].name } return Entrypoint(oldEntrypoint) } } // Statistics adds a user provided Stats struct to the parser to allow // the user to process the results after the parsing has finished. // Also the key for the "no match" counter is set. // // Example usage: // // input := "input" // stats := Stats{} // _, err := Parse("input-file", []byte(input), Statistics(&stats, "no match")) // if err != nil { // log.Panicln(err) // } // b, err := json.MarshalIndent(stats.ChoiceAltCnt, "", " ") // if err != nil { // log.Panicln(err) // } // fmt.Println(string(b)) // func Statistics(stats *Stats, choiceNoMatch string) Option { return func(p *parser) Option { oldStats := p.Stats p.Stats = stats oldChoiceNoMatch := p.choiceNoMatch p.choiceNoMatch = choiceNoMatch if p.Stats.ChoiceAltCnt == nil { p.Stats.ChoiceAltCnt = make(map[string]map[string]int) } return Statistics(oldStats, oldChoiceNoMatch) } } // Debug creates an Option to set the debug flag to b. When set to true, // debugging information is printed to stdout while parsing. // // The default is false. func Debug(b bool) Option { return func(p *parser) Option { old := p.debug p.debug = b return Debug(old) } } // Memoize creates an Option to set the memoize flag to b. When set to true, // the parser will cache all results so each expression is evaluated only // once. This guarantees linear parsing time even for pathological cases, // at the expense of more memory and slower times for typical cases. // // The default is false. func Memoize(b bool) Option { return func(p *parser) Option { old := p.memoize p.memoize = b return Memoize(old) } } // AllowInvalidUTF8 creates an Option to allow invalid UTF-8 bytes. // Every invalid UTF-8 byte is treated as a utf8.RuneError (U+FFFD) // by character class matchers and is matched by the any matcher. // The returned matched value, c.text and c.offset are NOT affected. // // The default is false. func AllowInvalidUTF8(b bool) Option { return func(p *parser) Option { old := p.allowInvalidUTF8 p.allowInvalidUTF8 = b return AllowInvalidUTF8(old) } } // Recover creates an Option to set the recover flag to b. When set to // true, this causes the parser to recover from panics and convert it // to an error. Setting it to false can be useful while debugging to // access the full stack trace. // // The default is true. func Recover(b bool) Option { return func(p *parser) Option { old := p.recover p.recover = b return Recover(old) } } // GlobalStore creates an Option to set a key to a certain value in // the globalStore. func GlobalStore(key string, value interface{}) Option { return func(p *parser) Option { old := p.cur.globalStore[key] p.cur.globalStore[key] = value return GlobalStore(key, old) } } // InitState creates an Option to set a key to a certain value in // the global "state" store. func InitState(key string, value interface{}) Option { return func(p *parser) Option { old := p.cur.state[key] p.cur.state[key] = value return InitState(key, old) } } // ParseFile parses the file identified by filename. func ParseFile(filename string, opts ...Option) (i interface{}, err error) { f, err := os.Open(filename) if err != nil { return nil, err } defer func() { if closeErr := f.Close(); closeErr != nil { err = closeErr } }() return ParseReader(filename, f, opts...) } // ParseReader parses the data from r using filename as information in the // error messages. func ParseReader(filename string, r io.Reader, opts ...Option) (interface{}, error) { b, err := ioutil.ReadAll(r) if err != nil { return nil, err } return Parse(filename, b, opts...) } // Parse parses the data from b using filename as information in the // error messages. func Parse(filename string, b []byte, opts ...Option) (interface{}, error) { return newParser(filename, b, opts...).parse(g) } // position records a position in the text. type position struct { line, col, offset int } func (p position) String() string { return fmt.Sprintf("%d:%d [%d]", p.line, p.col, p.offset) } // savepoint stores all state required to go back to this point in the // parser. type savepoint struct { position rn rune w int } type current struct { pos position // start position of the match text []byte // raw text of the match // state is a store for arbitrary key,value pairs that the user wants to be // tied to the backtracking of the parser. // This is always rolled back if a parsing rule fails. state storeDict // globalStore is a general store for the user to store arbitrary key-value // pairs that they need to manage and that they do not want tied to the // backtracking of the parser. This is only modified by the user and never // rolled back by the parser. It is always up to the user to keep this in a // consistent state. globalStore storeDict } type storeDict map[string]interface{} // the AST types... type grammar struct { pos position rules []*rule } type rule struct { pos position name string displayName string expr interface{} } type choiceExpr struct { pos position alternatives []interface{} } type actionExpr struct { pos position expr interface{} run func(*parser) (interface{}, error) } type recoveryExpr struct { pos position expr interface{} recoverExpr interface{} failureLabel []string } type seqExpr struct { pos position exprs []interface{} } type throwExpr struct { pos position label string } type labeledExpr struct { pos position label string expr interface{} } type expr struct { pos position expr interface{} } type andExpr expr type notExpr expr type zeroOrOneExpr expr type zeroOrMoreExpr expr type oneOrMoreExpr expr type ruleRefExpr struct { pos position name string } type stateCodeExpr struct { pos position run func(*parser) error } type andCodeExpr struct { pos position run func(*parser) (bool, error) } type notCodeExpr struct { pos position run func(*parser) (bool, error) } type litMatcher struct { pos position val string ignoreCase bool } type charClassMatcher struct { pos position val string basicLatinChars [128]bool chars []rune ranges []rune classes []*unicode.RangeTable ignoreCase bool inverted bool } type anyMatcher position // errList cumulates the errors found by the parser. type errList []error func (e *errList) add(err error) { *e = append(*e, err) } func (e errList) err() error { if len(e) == 0 { return nil } e.dedupe() return e } func (e *errList) dedupe() { var cleaned []error set := make(map[string]bool) for _, err := range *e { if msg := err.Error(); !set[msg] { set[msg] = true cleaned = append(cleaned, err) } } *e = cleaned } func (e errList) Error() string { switch len(e) { case 0: return "" case 1: return e[0].Error() default: var buf bytes.Buffer for i, err := range e { if i > 0 { buf.WriteRune('\n') } buf.WriteString(err.Error()) } return buf.String() } } // parserError wraps an error with a prefix indicating the rule in which // the error occurred. The original error is stored in the Inner field. type parserError struct { Inner error pos position prefix string expected []string } // Error returns the error message. func (p *parserError) Error() string { return p.prefix + ": " + p.Inner.Error() } // newParser creates a parser with the specified input source and options. func newParser(filename string, b []byte, opts ...Option) *parser { stats := Stats{ ChoiceAltCnt: make(map[string]map[string]int), } p := &parser{ filename: filename, errs: new(errList), data: b, pt: savepoint{position: position{line: 1}}, recover: true, cur: current{ state: make(storeDict), globalStore: make(storeDict), }, maxFailPos: position{col: 1, line: 1}, maxFailExpected: make([]string, 0, 20), Stats: &stats, // start rule is rule [0] unless an alternate entrypoint is specified entrypoint: g.rules[0].name, } p.setOptions(opts) if p.maxExprCnt == 0 { p.maxExprCnt = math.MaxUint64 } return p } // setOptions applies the options to the parser. func (p *parser) setOptions(opts []Option) { for _, opt := range opts { opt(p) } } type resultTuple struct { v interface{} b bool end savepoint } const choiceNoMatch = -1 // Stats stores some statistics, gathered during parsing type Stats struct { // ExprCnt counts the number of expressions processed during parsing // This value is compared to the maximum number of expressions allowed // (set by the MaxExpressions option). ExprCnt uint64 // ChoiceAltCnt is used to count for each ordered choice expression, // which alternative is used how may times. // These numbers allow to optimize the order of the ordered choice expression // to increase the performance of the parser // // The outer key of ChoiceAltCnt is composed of the name of the rule as well // as the line and the column of the ordered choice. // The inner key of ChoiceAltCnt is the number (one-based) of the matching alternative. // For each alternative the number of matches are counted. If an ordered choice does not // match, a special counter is incremented. The name of this counter is set with // the parser option Statistics. // For an alternative to be included in ChoiceAltCnt, it has to match at least once. ChoiceAltCnt map[string]map[string]int } type parser struct { filename string pt savepoint cur current data []byte errs *errList depth int recover bool debug bool memoize bool // memoization table for the packrat algorithm: // map[offset in source] map[expression or rule] {value, match} memo map[int]map[interface{}]resultTuple // rules table, maps the rule identifier to the rule node rules map[string]*rule // variables stack, map of label to value vstack []map[string]interface{} // rule stack, allows identification of the current rule in errors rstack []*rule // parse fail maxFailPos position maxFailExpected []string maxFailInvertExpected bool // max number of expressions to be parsed maxExprCnt uint64 // entrypoint for the parser entrypoint string allowInvalidUTF8 bool *Stats choiceNoMatch string // recovery expression stack, keeps track of the currently available recovery expression, these are traversed in reverse recoveryStack []map[string]interface{} } // push a variable set on the vstack. func (p *parser) pushV() { if cap(p.vstack) == len(p.vstack) { // create new empty slot in the stack p.vstack = append(p.vstack, nil) } else { // slice to 1 more p.vstack = p.vstack[:len(p.vstack)+1] } // get the last args set m := p.vstack[len(p.vstack)-1] if m != nil && len(m) == 0 { // empty map, all good return } m = make(map[string]interface{}) p.vstack[len(p.vstack)-1] = m } // pop a variable set from the vstack. func (p *parser) popV() { // if the map is not empty, clear it m := p.vstack[len(p.vstack)-1] if len(m) > 0 { // GC that map p.vstack[len(p.vstack)-1] = nil } p.vstack = p.vstack[:len(p.vstack)-1] } // push a recovery expression with its labels to the recoveryStack func (p *parser) pushRecovery(labels []string, expr interface{}) { if cap(p.recoveryStack) == len(p.recoveryStack) { // create new empty slot in the stack p.recoveryStack = append(p.recoveryStack, nil) } else { // slice to 1 more p.recoveryStack = p.recoveryStack[:len(p.recoveryStack)+1] } m := make(map[string]interface{}, len(labels)) for _, fl := range labels { m[fl] = expr } p.recoveryStack[len(p.recoveryStack)-1] = m } // pop a recovery expression from the recoveryStack func (p *parser) popRecovery() { // GC that map p.recoveryStack[len(p.recoveryStack)-1] = nil p.recoveryStack = p.recoveryStack[:len(p.recoveryStack)-1] } func (p *parser) print(prefix, s string) string { if !p.debug { return s } fmt.Printf("%s %d:%d:%d: %s [%#U]\n", prefix, p.pt.line, p.pt.col, p.pt.offset, s, p.pt.rn) return s } func (p *parser) in(s string) string { p.depth++ return p.print(strings.Repeat(" ", p.depth)+">", s) } func (p *parser) out(s string) string { p.depth-- return p.print(strings.Repeat(" ", p.depth)+"<", s) } func (p *parser) addErr(err error) { p.addErrAt(err, p.pt.position, []string{}) } func (p *parser) addErrAt(err error, pos position, expected []string) { var buf bytes.Buffer if p.filename != "" { buf.WriteString(p.filename) } if buf.Len() > 0 { buf.WriteString(":") } buf.WriteString(fmt.Sprintf("%d:%d (%d)", pos.line, pos.col, pos.offset)) if len(p.rstack) > 0 { if buf.Len() > 0 { buf.WriteString(": ") } rule := p.rstack[len(p.rstack)-1] if rule.displayName != "" { buf.WriteString("rule " + rule.displayName) } else { buf.WriteString("rule " + rule.name) } } pe := &parserError{Inner: err, pos: pos, prefix: buf.String(), expected: expected} p.errs.add(pe) } func (p *parser) failAt(fail bool, pos position, want string) { // process fail if parsing fails and not inverted or parsing succeeds and invert is set if fail == p.maxFailInvertExpected { if pos.offset < p.maxFailPos.offset { return } if pos.offset > p.maxFailPos.offset { p.maxFailPos = pos p.maxFailExpected = p.maxFailExpected[:0] } if p.maxFailInvertExpected { want = "!" + want } p.maxFailExpected = append(p.maxFailExpected, want) } } // read advances the parser to the next rune. func (p *parser) read() { p.pt.offset += p.pt.w rn, n := utf8.DecodeRune(p.data[p.pt.offset:]) p.pt.rn = rn p.pt.w = n p.pt.col++ if rn == '\n' { p.pt.line++ p.pt.col = 0 } if rn == utf8.RuneError && n == 1 { // see utf8.DecodeRune if !p.allowInvalidUTF8 { p.addErr(errInvalidEncoding) } } } // restore parser position to the savepoint pt. func (p *parser) restore(pt savepoint) { if p.debug { defer p.out(p.in("restore")) } if pt.offset == p.pt.offset { return } p.pt = pt } // Cloner is implemented by any value that has a Clone method, which returns a // copy of the value. This is mainly used for types which are not passed by // value (e.g map, slice, chan) or structs that contain such types. // // This is used in conjunction with the global state feature to create proper // copies of the state to allow the parser to properly restore the state in // the case of backtracking. type Cloner interface { Clone() interface{} } // clone and return parser current state. func (p *parser) cloneState() storeDict { if p.debug { defer p.out(p.in("cloneState")) } state := make(storeDict, len(p.cur.state)) for k, v := range p.cur.state { if c, ok := v.(Cloner); ok { state[k] = c.Clone() } else { state[k] = v } } return state } // restore parser current state to the state storeDict. // every restoreState should applied only one time for every cloned state func (p *parser) restoreState(state storeDict) { if p.debug { defer p.out(p.in("restoreState")) } p.cur.state = state } // get the slice of bytes from the savepoint start to the current position. func (p *parser) sliceFrom(start savepoint) []byte { return p.data[start.position.offset:p.pt.position.offset] } func (p *parser) getMemoized(node interface{}) (resultTuple, bool) { if len(p.memo) == 0 { return resultTuple{}, false } m := p.memo[p.pt.offset] if len(m) == 0 { return resultTuple{}, false } res, ok := m[node] return res, ok } func (p *parser) setMemoized(pt savepoint, node interface{}, tuple resultTuple) { if p.memo == nil { p.memo = make(map[int]map[interface{}]resultTuple) } m := p.memo[pt.offset] if m == nil { m = make(map[interface{}]resultTuple) p.memo[pt.offset] = m } m[node] = tuple } func (p *parser) buildRulesTable(g *grammar) { p.rules = make(map[string]*rule, len(g.rules)) for _, r := range g.rules { p.rules[r.name] = r } } func (p *parser) parse(g *grammar) (val interface{}, err error) { if len(g.rules) == 0 { p.addErr(errNoRule) return nil, p.errs.err() } // TODO : not super critical but this could be generated p.buildRulesTable(g) if p.recover { // panic can be used in action code to stop parsing immediately // and return the panic as an error. defer func() { if e := recover(); e != nil { if p.debug { defer p.out(p.in("panic handler")) } val = nil switch e := e.(type) { case error: p.addErr(e) default: p.addErr(fmt.Errorf("%v", e)) } err = p.errs.err() } }() } startRule, ok := p.rules[p.entrypoint] if !ok { p.addErr(errInvalidEntrypoint) return nil, p.errs.err() } p.read() // advance to first rune val, ok = p.parseRule(startRule) if !ok { if len(*p.errs) == 0 { // If parsing fails, but no errors have been recorded, the expected values // for the farthest parser position are returned as error. maxFailExpectedMap := make(map[string]struct{}, len(p.maxFailExpected)) for _, v := range p.maxFailExpected { maxFailExpectedMap[v] = struct{}{} } expected := make([]string, 0, len(maxFailExpectedMap)) eof := false if _, ok := maxFailExpectedMap["!."]; ok { delete(maxFailExpectedMap, "!.") eof = true } for k := range maxFailExpectedMap { expected = append(expected, k) } sort.Strings(expected) if eof { expected = append(expected, "EOF") } p.addErrAt(errors.New("no match found, expected: "+listJoin(expected, ", ", "or")), p.maxFailPos, expected) } return nil, p.errs.err() } return val, p.errs.err() } func listJoin(list []string, sep string, lastSep string) string { switch len(list) { case 0: return "" case 1: return list[0] default: return fmt.Sprintf("%s %s %s", strings.Join(list[:len(list)-1], sep), lastSep, list[len(list)-1]) } } func (p *parser) parseRule(rule *rule) (interface{}, bool) { if p.debug { defer p.out(p.in("parseRule " + rule.name)) } if p.memoize { res, ok := p.getMemoized(rule) if ok { p.restore(res.end) return res.v, res.b } } start := p.pt p.rstack = append(p.rstack, rule) p.pushV() val, ok := p.parseExpr(rule.expr) p.popV() p.rstack = p.rstack[:len(p.rstack)-1] if ok && p.debug { p.print(strings.Repeat(" ", p.depth)+"MATCH", string(p.sliceFrom(start))) } if p.memoize { p.setMemoized(start, rule, resultTuple{val, ok, p.pt}) } return val, ok } func (p *parser) parseExpr(expr interface{}) (interface{}, bool) { var pt savepoint if p.memoize { res, ok := p.getMemoized(expr) if ok { p.restore(res.end) return res.v, res.b } pt = p.pt } p.ExprCnt++ if p.ExprCnt > p.maxExprCnt { panic(errMaxExprCnt) } var val interface{} var ok bool switch expr := expr.(type) { case *actionExpr: val, ok = p.parseActionExpr(expr) case *andCodeExpr: val, ok = p.parseAndCodeExpr(expr) case *andExpr: val, ok = p.parseAndExpr(expr) case *anyMatcher: val, ok = p.parseAnyMatcher(expr) case *charClassMatcher: val, ok = p.parseCharClassMatcher(expr) case *choiceExpr: val, ok = p.parseChoiceExpr(expr) case *labeledExpr: val, ok = p.parseLabeledExpr(expr) case *litMatcher: val, ok = p.parseLitMatcher(expr) case *notCodeExpr: val, ok = p.parseNotCodeExpr(expr) case *notExpr: val, ok = p.parseNotExpr(expr) case *oneOrMoreExpr: val, ok = p.parseOneOrMoreExpr(expr) case *recoveryExpr: val, ok = p.parseRecoveryExpr(expr) case *ruleRefExpr: val, ok = p.parseRuleRefExpr(expr) case *seqExpr: val, ok = p.parseSeqExpr(expr) case *stateCodeExpr: val, ok = p.parseStateCodeExpr(expr) case *throwExpr: val, ok = p.parseThrowExpr(expr) case *zeroOrMoreExpr: val, ok = p.parseZeroOrMoreExpr(expr) case *zeroOrOneExpr: val, ok = p.parseZeroOrOneExpr(expr) default: panic(fmt.Sprintf("unknown expression type %T", expr)) } if p.memoize { p.setMemoized(pt, expr, resultTuple{val, ok, p.pt}) } return val, ok } func (p *parser) parseActionExpr(act *actionExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseActionExpr")) } start := p.pt val, ok := p.parseExpr(act.expr) if ok { p.cur.pos = start.position p.cur.text = p.sliceFrom(start) state := p.cloneState() actVal, err := act.run(p) if err != nil { p.addErrAt(err, start.position, []string{}) } p.restoreState(state) val = actVal } if ok && p.debug { p.print(strings.Repeat(" ", p.depth)+"MATCH", string(p.sliceFrom(start))) } return val, ok } func (p *parser) parseAndCodeExpr(and *andCodeExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseAndCodeExpr")) } state := p.cloneState() ok, err := and.run(p) if err != nil { p.addErr(err) } p.restoreState(state) return nil, ok } func (p *parser) parseAndExpr(and *andExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseAndExpr")) } pt := p.pt state := p.cloneState() p.pushV() _, ok := p.parseExpr(and.expr) p.popV() p.restoreState(state) p.restore(pt) return nil, ok } func (p *parser) parseAnyMatcher(any *anyMatcher) (interface{}, bool) { if p.debug { defer p.out(p.in("parseAnyMatcher")) } if p.pt.rn == utf8.RuneError && p.pt.w == 0 { // EOF - see utf8.DecodeRune p.failAt(false, p.pt.position, ".") return nil, false } start := p.pt p.read() p.failAt(true, start.position, ".") return p.sliceFrom(start), true } func (p *parser) parseCharClassMatcher(chr *charClassMatcher) (interface{}, bool) { if p.debug { defer p.out(p.in("parseCharClassMatcher")) } cur := p.pt.rn start := p.pt // can't match EOF if cur == utf8.RuneError && p.pt.w == 0 { // see utf8.DecodeRune p.failAt(false, start.position, chr.val) return nil, false } if chr.ignoreCase { cur = unicode.ToLower(cur) } // try to match in the list of available chars for _, rn := range chr.chars { if rn == cur { if chr.inverted { p.failAt(false, start.position, chr.val) return nil, false } p.read() p.failAt(true, start.position, chr.val) return p.sliceFrom(start), true } } // try to match in the list of ranges for i := 0; i < len(chr.ranges); i += 2 { if cur >= chr.ranges[i] && cur <= chr.ranges[i+1] { if chr.inverted { p.failAt(false, start.position, chr.val) return nil, false } p.read() p.failAt(true, start.position, chr.val) return p.sliceFrom(start), true } } // try to match in the list of Unicode classes for _, cl := range chr.classes { if unicode.Is(cl, cur) { if chr.inverted { p.failAt(false, start.position, chr.val) return nil, false } p.read() p.failAt(true, start.position, chr.val) return p.sliceFrom(start), true } } if chr.inverted { p.read() p.failAt(true, start.position, chr.val) return p.sliceFrom(start), true } p.failAt(false, start.position, chr.val) return nil, false } func (p *parser) incChoiceAltCnt(ch *choiceExpr, altI int) { choiceIdent := fmt.Sprintf("%s %d:%d", p.rstack[len(p.rstack)-1].name, ch.pos.line, ch.pos.col) m := p.ChoiceAltCnt[choiceIdent] if m == nil { m = make(map[string]int) p.ChoiceAltCnt[choiceIdent] = m } // We increment altI by 1, so the keys do not start at 0 alt := strconv.Itoa(altI + 1) if altI == choiceNoMatch { alt = p.choiceNoMatch } m[alt]++ } func (p *parser) parseChoiceExpr(ch *choiceExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseChoiceExpr")) } for altI, alt := range ch.alternatives { // dummy assignment to prevent compile error if optimized _ = altI state := p.cloneState() p.pushV() val, ok := p.parseExpr(alt) p.popV() if ok { p.incChoiceAltCnt(ch, altI) return val, ok } p.restoreState(state) } p.incChoiceAltCnt(ch, choiceNoMatch) return nil, false } func (p *parser) parseLabeledExpr(lab *labeledExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseLabeledExpr")) } p.pushV() val, ok := p.parseExpr(lab.expr) p.popV() if ok && lab.label != "" { m := p.vstack[len(p.vstack)-1] m[lab.label] = val } return val, ok } func (p *parser) parseLitMatcher(lit *litMatcher) (interface{}, bool) { if p.debug { defer p.out(p.in("parseLitMatcher")) } ignoreCase := "" if lit.ignoreCase { ignoreCase = "i" } val := fmt.Sprintf("%q%s", lit.val, ignoreCase) start := p.pt for _, want := range lit.val { cur := p.pt.rn if lit.ignoreCase { cur = unicode.ToLower(cur) } if cur != want { p.failAt(false, start.position, val) p.restore(start) return nil, false } p.read() } p.failAt(true, start.position, val) return p.sliceFrom(start), true } func (p *parser) parseNotCodeExpr(not *notCodeExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseNotCodeExpr")) } state := p.cloneState() ok, err := not.run(p) if err != nil { p.addErr(err) } p.restoreState(state) return nil, !ok } func (p *parser) parseNotExpr(not *notExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseNotExpr")) } pt := p.pt state := p.cloneState() p.pushV() p.maxFailInvertExpected = !p.maxFailInvertExpected _, ok := p.parseExpr(not.expr) p.maxFailInvertExpected = !p.maxFailInvertExpected p.popV() p.restoreState(state) p.restore(pt) return nil, !ok } func (p *parser) parseOneOrMoreExpr(expr *oneOrMoreExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseOneOrMoreExpr")) } var vals []interface{} for { p.pushV() val, ok := p.parseExpr(expr.expr) p.popV() if !ok { if len(vals) == 0 { // did not match once, no match return nil, false } return vals, true } vals = append(vals, val) } } func (p *parser) parseRecoveryExpr(recover *recoveryExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseRecoveryExpr (" + strings.Join(recover.failureLabel, ",") + ")")) } p.pushRecovery(recover.failureLabel, recover.recoverExpr) val, ok := p.parseExpr(recover.expr) p.popRecovery() return val, ok } func (p *parser) parseRuleRefExpr(ref *ruleRefExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseRuleRefExpr " + ref.name)) } if ref.name == "" { panic(fmt.Sprintf("%s: invalid rule: missing name", ref.pos)) } rule := p.rules[ref.name] if rule == nil { p.addErr(fmt.Errorf("undefined rule: %s", ref.name)) return nil, false } return p.parseRule(rule) } func (p *parser) parseSeqExpr(seq *seqExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseSeqExpr")) } vals := make([]interface{}, 0, len(seq.exprs)) pt := p.pt state := p.cloneState() for _, expr := range seq.exprs { val, ok := p.parseExpr(expr) if !ok { p.restoreState(state) p.restore(pt) return nil, false } vals = append(vals, val) } return vals, true } func (p *parser) parseStateCodeExpr(state *stateCodeExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseStateCodeExpr")) } err := state.run(p) if err != nil { p.addErr(err) } return nil, true } func (p *parser) parseThrowExpr(expr *throwExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseThrowExpr")) } for i := len(p.recoveryStack) - 1; i >= 0; i-- { if recoverExpr, ok := p.recoveryStack[i][expr.label]; ok { if val, ok := p.parseExpr(recoverExpr); ok { return val, ok } } } return nil, false } func (p *parser) parseZeroOrMoreExpr(expr *zeroOrMoreExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseZeroOrMoreExpr")) } var vals []interface{} for { p.pushV() val, ok := p.parseExpr(expr.expr) p.popV() if !ok { return vals, true } vals = append(vals, val) } } func (p *parser) parseZeroOrOneExpr(expr *zeroOrOneExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseZeroOrOneExpr")) } p.pushV() val, _ := p.parseExpr(expr.expr) p.popV() // whether it matched or not, consider it a match return val, true }