// 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: "Integer",
},
},
},
},
},
},
{
name: "LimitClause",
pos: position{line: 300, col: 1, offset: 7597},
expr: &actionExpr{
pos: position{line: 301, col: 4, offset: 7612},
run: (*parser).callonLimitClause1,
expr: &seqExpr{
pos: position{line: 301, col: 4, offset: 7612},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 301, col: 4, offset: 7612},
name: "LimitToken",
},
&ruleRefExpr{
pos: position{line: 301, col: 15, offset: 7623},
name: "_",
},
&labeledExpr{
pos: position{line: 301, col: 17, offset: 7625},
label: "i",
expr: &ruleRefExpr{
pos: position{line: 301, col: 19, offset: 7627},
name: "Integer",
},
},
},
},
},
},
{
name: "InsertWithColumnClause",
pos: position{line: 310, col: 1, offset: 7807},
expr: &actionExpr{
pos: position{line: 311, col: 4, offset: 7833},
run: (*parser).callonInsertWithColumnClause1,
expr: &seqExpr{
pos: position{line: 311, col: 4, offset: 7833},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 311, col: 4, offset: 7833},
label: "cs",
expr: &zeroOrOneExpr{
pos: position{line: 311, col: 7, offset: 7836},
expr: &actionExpr{
pos: position{line: 311, col: 9, offset: 7838},
run: (*parser).callonInsertWithColumnClause5,
expr: &seqExpr{
pos: position{line: 311, col: 9, offset: 7838},
exprs: []interface{}{
&litMatcher{
pos: position{line: 311, col: 9, offset: 7838},
val: "(",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 312, col: 4, offset: 7845},
name: "_",
},
&labeledExpr{
pos: position{line: 312, col: 6, offset: 7847},
label: "f",
expr: &ruleRefExpr{
pos: position{line: 312, col: 8, offset: 7849},
name: "Identifier",
},
},
&labeledExpr{
pos: position{line: 313, col: 4, offset: 7863},
label: "fs",
expr: &zeroOrMoreExpr{
pos: position{line: 313, col: 7, offset: 7866},
expr: &actionExpr{
pos: position{line: 313, col: 9, offset: 7868},
run: (*parser).callonInsertWithColumnClause13,
expr: &seqExpr{
pos: position{line: 313, col: 9, offset: 7868},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 313, col: 9, offset: 7868},
name: "_",
},
&ruleRefExpr{
pos: position{line: 313, col: 11, offset: 7870},
name: "SeparatorToken",
},
&ruleRefExpr{
pos: position{line: 313, col: 26, offset: 7885},
name: "_",
},
&labeledExpr{
pos: position{line: 313, col: 28, offset: 7887},
label: "x",
expr: &ruleRefExpr{
pos: position{line: 313, col: 30, offset: 7889},
name: "Identifier",
},
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 314, col: 4, offset: 7924},
name: "_",
},
&litMatcher{
pos: position{line: 314, col: 6, offset: 7926},
val: ")",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 315, col: 4, offset: 7933},
name: "_",
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 317, col: 3, offset: 7986},
name: "ValuesToken",
},
&ruleRefExpr{
pos: position{line: 318, col: 2, offset: 7999},
name: "_",
},
&labeledExpr{
pos: position{line: 318, col: 4, offset: 8001},
label: "v",
expr: &ruleRefExpr{
pos: position{line: 318, col: 6, offset: 8003},
name: "InsertValue",
},
},
&labeledExpr{
pos: position{line: 319, col: 2, offset: 8016},
label: "vs",
expr: &zeroOrMoreExpr{
pos: position{line: 319, col: 5, offset: 8019},
expr: &actionExpr{
pos: position{line: 319, col: 7, offset: 8021},
run: (*parser).callonInsertWithColumnClause29,
expr: &seqExpr{
pos: position{line: 319, col: 7, offset: 8021},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 319, col: 7, offset: 8021},
name: "_",
},
&ruleRefExpr{
pos: position{line: 319, col: 9, offset: 8023},
name: "SeparatorToken",
},
&ruleRefExpr{
pos: position{line: 319, col: 24, offset: 8038},
name: "_",
},
&labeledExpr{
pos: position{line: 319, col: 26, offset: 8040},
label: "y",
expr: &ruleRefExpr{
pos: position{line: 319, col: 28, offset: 8042},
name: "InsertValue",
},
},
},
},
},
},
},
},
},
},
},
{
name: "InsertWithDefaultClause",
pos: position{line: 338, col: 1, offset: 8618},
expr: &actionExpr{
pos: position{line: 339, col: 4, offset: 8645},
run: (*parser).callonInsertWithDefaultClause1,
expr: &seqExpr{
pos: position{line: 339, col: 4, offset: 8645},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 339, col: 4, offset: 8645},
name: "DefaultToken",
},
&ruleRefExpr{
pos: position{line: 339, col: 17, offset: 8658},
name: "_",
},
&ruleRefExpr{
pos: position{line: 339, col: 19, offset: 8660},
name: "ValuesToken",
},
},
},
},
},
{
name: "PrimaryKeyClause",
pos: position{line: 347, col: 1, offset: 8816},
expr: &actionExpr{
pos: position{line: 348, col: 4, offset: 8836},
run: (*parser).callonPrimaryKeyClause1,
expr: &seqExpr{
pos: position{line: 348, col: 4, offset: 8836},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 348, col: 4, offset: 8836},
name: "PrimaryToken",
},
&ruleRefExpr{
pos: position{line: 348, col: 17, offset: 8849},
name: "_",
},
&ruleRefExpr{
pos: position{line: 348, col: 19, offset: 8851},
name: "KeyToken",
},
},
},
},
},
{
name: "NotNullClause",
pos: position{line: 356, col: 1, offset: 8994},
expr: &actionExpr{
pos: position{line: 357, col: 4, offset: 9011},
run: (*parser).callonNotNullClause1,
expr: &seqExpr{
pos: position{line: 357, col: 4, offset: 9011},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 357, col: 4, offset: 9011},
name: "NotToken",
},
&ruleRefExpr{
pos: position{line: 357, col: 13, offset: 9020},
name: "_",
},
&ruleRefExpr{
pos: position{line: 357, col: 15, offset: 9022},
name: "NullToken",
},
},
},
},
},
{
name: "UniqueClause",
pos: position{line: 365, col: 1, offset: 9166},
expr: &actionExpr{
pos: position{line: 366, col: 4, offset: 9182},
run: (*parser).callonUniqueClause1,
expr: &ruleRefExpr{
pos: position{line: 366, col: 4, offset: 9182},
name: "UniqueToken",
},
},
},
{
name: "DefaultClause",
pos: position{line: 374, col: 1, offset: 9327},
expr: &actionExpr{
pos: position{line: 375, col: 4, offset: 9344},
run: (*parser).callonDefaultClause1,
expr: &seqExpr{
pos: position{line: 375, col: 4, offset: 9344},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 375, col: 4, offset: 9344},
name: "DefaultToken",
},
&ruleRefExpr{
pos: position{line: 375, col: 17, offset: 9357},
name: "_",
},
&labeledExpr{
pos: position{line: 375, col: 19, offset: 9359},
label: "e",
expr: &ruleRefExpr{
pos: position{line: 375, col: 21, offset: 9361},
name: "Expr",
},
},
},
},
},
},
{
name: "ForeignClause",
pos: position{line: 384, col: 1, offset: 9531},
expr: &actionExpr{
pos: position{line: 385, col: 4, offset: 9548},
run: (*parser).callonForeignClause1,
expr: &seqExpr{
pos: position{line: 385, col: 4, offset: 9548},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 385, col: 4, offset: 9548},
name: "ReferencesToken",
},
&ruleRefExpr{
pos: position{line: 385, col: 20, offset: 9564},
name: "_",
},
&labeledExpr{
pos: position{line: 385, col: 22, offset: 9566},
label: "t",
expr: &ruleRefExpr{
pos: position{line: 385, col: 24, offset: 9568},
name: "Identifier",
},
},
&ruleRefExpr{
pos: position{line: 385, col: 35, offset: 9579},
name: "_",
},
&litMatcher{
pos: position{line: 385, col: 37, offset: 9581},
val: "(",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 385, col: 41, offset: 9585},
name: "_",
},
&labeledExpr{
pos: position{line: 385, col: 43, offset: 9587},
label: "f",
expr: &ruleRefExpr{
pos: position{line: 385, col: 45, offset: 9589},
name: "Identifier",
},
},
&ruleRefExpr{
pos: position{line: 385, col: 56, offset: 9600},
name: "_",
},
&litMatcher{
pos: position{line: 385, col: 58, offset: 9602},
val: ")",
ignoreCase: false,
},
},
},
},
},
{
name: "AutoincrementClause",
pos: position{line: 395, col: 1, offset: 9817},
expr: &actionExpr{
pos: position{line: 396, col: 4, offset: 9840},
run: (*parser).callonAutoincrementClause1,
expr: &ruleRefExpr{
pos: position{line: 396, col: 4, offset: 9840},
name: "AutoincrementToken",
},
},
},
{
name: "Expr",
pos: position{line: 405, col: 1, offset: 10017},
expr: &ruleRefExpr{
pos: position{line: 406, col: 4, offset: 10025},
name: "LogicExpr",
},
},
{
name: "ExprWithDefault",
pos: position{line: 408, col: 1, offset: 10036},
expr: &choiceExpr{
pos: position{line: 409, col: 4, offset: 10055},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 409, col: 4, offset: 10055},
run: (*parser).callonExprWithDefault2,
expr: &seqExpr{
pos: position{line: 409, col: 4, offset: 10055},
exprs: []interface{}{
&andExpr{
pos: position{line: 409, col: 4, offset: 10055},
expr: &ruleRefExpr{
pos: position{line: 409, col: 6, offset: 10057},
name: "DefaultLiteral",
},
},
&labeledExpr{
pos: position{line: 409, col: 22, offset: 10073},
label: "d",
expr: &ruleRefExpr{
pos: position{line: 409, col: 24, offset: 10075},
name: "DefaultLiteral",
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 410, col: 4, offset: 10111},
name: "Expr",
},
},
},
},
{
name: "LogicExpr",
pos: position{line: 412, col: 1, offset: 10117},
expr: &ruleRefExpr{
pos: position{line: 413, col: 4, offset: 10130},
name: "LogicExpr4",
},
},
{
name: "LogicExpr4",
pos: position{line: 415, col: 1, offset: 10142},
expr: &actionExpr{
pos: position{line: 416, col: 4, offset: 10156},
run: (*parser).callonLogicExpr41,
expr: &seqExpr{
pos: position{line: 416, col: 4, offset: 10156},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 416, col: 4, offset: 10156},
label: "o",
expr: &ruleRefExpr{
pos: position{line: 416, col: 6, offset: 10158},
name: "LogicExpr3",
},
},
&labeledExpr{
pos: position{line: 417, col: 3, offset: 10171},
label: "os",
expr: &zeroOrMoreExpr{
pos: position{line: 417, col: 6, offset: 10174},
expr: &actionExpr{
pos: position{line: 417, col: 8, offset: 10176},
run: (*parser).callonLogicExpr47,
expr: &seqExpr{
pos: position{line: 417, col: 8, offset: 10176},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 417, col: 8, offset: 10176},
name: "_",
},
&labeledExpr{
pos: position{line: 417, col: 10, offset: 10178},
label: "op",
expr: &ruleRefExpr{
pos: position{line: 417, col: 13, offset: 10181},
name: "OrOperator",
},
},
&ruleRefExpr{
pos: position{line: 417, col: 24, offset: 10192},
name: "_",
},
&labeledExpr{
pos: position{line: 417, col: 26, offset: 10194},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 417, col: 28, offset: 10196},
name: "LogicExpr3",
},
},
},
},
},
},
},
},
},
},
},
{
name: "LogicExpr3",
pos: position{line: 421, col: 1, offset: 10359},
expr: &actionExpr{
pos: position{line: 422, col: 4, offset: 10373},
run: (*parser).callonLogicExpr31,
expr: &seqExpr{
pos: position{line: 422, col: 4, offset: 10373},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 422, col: 4, offset: 10373},
label: "o",
expr: &ruleRefExpr{
pos: position{line: 422, col: 6, offset: 10375},
name: "LogicExpr2",
},
},
&labeledExpr{
pos: position{line: 423, col: 3, offset: 10388},
label: "os",
expr: &zeroOrMoreExpr{
pos: position{line: 423, col: 6, offset: 10391},
expr: &actionExpr{
pos: position{line: 423, col: 8, offset: 10393},
run: (*parser).callonLogicExpr37,
expr: &seqExpr{
pos: position{line: 423, col: 8, offset: 10393},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 423, col: 8, offset: 10393},
name: "_",
},
&labeledExpr{
pos: position{line: 423, col: 10, offset: 10395},
label: "op",
expr: &ruleRefExpr{
pos: position{line: 423, col: 13, offset: 10398},
name: "AndOperator",
},
},
&ruleRefExpr{
pos: position{line: 423, col: 25, offset: 10410},
name: "_",
},
&labeledExpr{
pos: position{line: 423, col: 27, offset: 10412},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 423, col: 29, offset: 10414},
name: "LogicExpr2",
},
},
},
},
},
},
},
},
},
},
},
{
name: "LogicExpr2",
pos: position{line: 427, col: 1, offset: 10577},
expr: &choiceExpr{
pos: position{line: 428, col: 4, offset: 10591},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 428, col: 4, offset: 10591},
run: (*parser).callonLogicExpr22,
expr: &seqExpr{
pos: position{line: 428, col: 4, offset: 10591},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 428, col: 4, offset: 10591},
label: "op",
expr: &ruleRefExpr{
pos: position{line: 428, col: 7, offset: 10594},
name: "NotOperator",
},
},
&ruleRefExpr{
pos: position{line: 428, col: 19, offset: 10606},
name: "_",
},
&labeledExpr{
pos: position{line: 428, col: 21, offset: 10608},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 428, col: 23, offset: 10610},
name: "LogicExpr2",
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 430, col: 4, offset: 10695},
name: "LogicExpr1",
},
},
},
},
{
name: "LogicExpr1",
pos: position{line: 432, col: 1, offset: 10707},
expr: &actionExpr{
pos: position{line: 433, col: 4, offset: 10721},
run: (*parser).callonLogicExpr11,
expr: &seqExpr{
pos: position{line: 433, col: 4, offset: 10721},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 433, col: 4, offset: 10721},
label: "o",
expr: &ruleRefExpr{
pos: position{line: 433, col: 6, offset: 10723},
name: "ArithmeticExpr",
},
},
&labeledExpr{
pos: position{line: 433, col: 21, offset: 10738},
label: "os",
expr: &zeroOrMoreExpr{
pos: position{line: 433, col: 24, offset: 10741},
expr: &actionExpr{
pos: position{line: 433, col: 26, offset: 10743},
run: (*parser).callonLogicExpr17,
expr: &seqExpr{
pos: position{line: 433, col: 26, offset: 10743},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 433, col: 26, offset: 10743},
name: "_",
},
&labeledExpr{
pos: position{line: 433, col: 28, offset: 10745},
label: "l",
expr: &ruleRefExpr{
pos: position{line: 433, col: 30, offset: 10747},
name: "LogicExpr1Op",
},
},
},
},
},
},
},
},
},
},
},
{
name: "LogicExpr1Op",
pos: position{line: 436, col: 1, offset: 10856},
expr: &choiceExpr{
pos: position{line: 437, col: 4, offset: 10872},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 437, col: 4, offset: 10872},
name: "LogicExpr1In",
},
&ruleRefExpr{
pos: position{line: 438, col: 4, offset: 10888},
name: "LogicExpr1Is",
},
&ruleRefExpr{
pos: position{line: 439, col: 4, offset: 10904},
name: "LogicExpr1Like",
},
&ruleRefExpr{
pos: position{line: 440, col: 4, offset: 10922},
name: "LogicExpr1Cmp",
},
},
},
},
{
name: "LogicExpr1In",
pos: position{line: 442, col: 1, offset: 10937},
expr: &actionExpr{
pos: position{line: 443, col: 4, offset: 10953},
run: (*parser).callonLogicExpr1In1,
expr: &seqExpr{
pos: position{line: 443, col: 4, offset: 10953},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 443, col: 4, offset: 10953},
label: "n",
expr: &zeroOrOneExpr{
pos: position{line: 443, col: 6, offset: 10955},
expr: &actionExpr{
pos: position{line: 443, col: 8, offset: 10957},
run: (*parser).callonLogicExpr1In5,
expr: &seqExpr{
pos: position{line: 443, col: 8, offset: 10957},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 443, col: 8, offset: 10957},
label: "t",
expr: &ruleRefExpr{
pos: position{line: 443, col: 10, offset: 10959},
name: "NotOperator",
},
},
&ruleRefExpr{
pos: position{line: 443, col: 22, offset: 10971},
name: "_",
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 443, col: 45, offset: 10994},
name: "InToken",
},
&ruleRefExpr{
pos: position{line: 443, col: 53, offset: 11002},
name: "_",
},
&litMatcher{
pos: position{line: 443, col: 55, offset: 11004},
val: "(",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 443, col: 59, offset: 11008},
name: "_",
},
&labeledExpr{
pos: position{line: 443, col: 61, offset: 11010},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 443, col: 63, offset: 11012},
name: "MultiExpr",
},
},
&ruleRefExpr{
pos: position{line: 443, col: 73, offset: 11022},
name: "_",
},
&litMatcher{
pos: position{line: 443, col: 75, offset: 11024},
val: ")",
ignoreCase: false,
},
},
},
},
},
{
name: "LogicExpr1Is",
pos: position{line: 455, col: 1, offset: 11265},
expr: &actionExpr{
pos: position{line: 456, col: 4, offset: 11281},
run: (*parser).callonLogicExpr1Is1,
expr: &seqExpr{
pos: position{line: 456, col: 4, offset: 11281},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 456, col: 4, offset: 11281},
name: "IsToken",
},
&labeledExpr{
pos: position{line: 456, col: 12, offset: 11289},
label: "n",
expr: &zeroOrOneExpr{
pos: position{line: 456, col: 14, offset: 11291},
expr: &actionExpr{
pos: position{line: 456, col: 16, offset: 11293},
run: (*parser).callonLogicExpr1Is6,
expr: &seqExpr{
pos: position{line: 456, col: 16, offset: 11293},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 456, col: 16, offset: 11293},
name: "_",
},
&labeledExpr{
pos: position{line: 456, col: 18, offset: 11295},
label: "t",
expr: &ruleRefExpr{
pos: position{line: 456, col: 20, offset: 11297},
name: "NotOperator",
},
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 456, col: 53, offset: 11330},
name: "_",
},
&labeledExpr{
pos: position{line: 456, col: 55, offset: 11332},
label: "u",
expr: &ruleRefExpr{
pos: position{line: 456, col: 57, offset: 11334},
name: "NullLiteral",
},
},
},
},
},
},
{
name: "LogicExpr1Like",
pos: position{line: 468, col: 1, offset: 11594},
expr: &actionExpr{
pos: position{line: 469, col: 4, offset: 11612},
run: (*parser).callonLogicExpr1Like1,
expr: &seqExpr{
pos: position{line: 469, col: 4, offset: 11612},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 469, col: 4, offset: 11612},
label: "n",
expr: &zeroOrOneExpr{
pos: position{line: 469, col: 6, offset: 11614},
expr: &actionExpr{
pos: position{line: 469, col: 8, offset: 11616},
run: (*parser).callonLogicExpr1Like5,
expr: &seqExpr{
pos: position{line: 469, col: 8, offset: 11616},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 469, col: 8, offset: 11616},
label: "t",
expr: &ruleRefExpr{
pos: position{line: 469, col: 10, offset: 11618},
name: "NotOperator",
},
},
&ruleRefExpr{
pos: position{line: 469, col: 22, offset: 11630},
name: "_",
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 469, col: 45, offset: 11653},
name: "LikeToken",
},
&ruleRefExpr{
pos: position{line: 469, col: 55, offset: 11663},
name: "_",
},
&labeledExpr{
pos: position{line: 469, col: 57, offset: 11665},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 469, col: 59, offset: 11667},
name: "Expr",
},
},
&labeledExpr{
pos: position{line: 470, col: 2, offset: 11673},
label: "escape",
expr: &zeroOrOneExpr{
pos: position{line: 470, col: 9, offset: 11680},
expr: &actionExpr{
pos: position{line: 470, col: 11, offset: 11682},
run: (*parser).callonLogicExpr1Like16,
expr: &seqExpr{
pos: position{line: 470, col: 11, offset: 11682},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 470, col: 11, offset: 11682},
name: "_",
},
&ruleRefExpr{
pos: position{line: 470, col: 13, offset: 11684},
name: "EscapeToken",
},
&ruleRefExpr{
pos: position{line: 470, col: 25, offset: 11696},
name: "_",
},
&labeledExpr{
pos: position{line: 470, col: 27, offset: 11698},
label: "e",
expr: &ruleRefExpr{
pos: position{line: 470, col: 29, offset: 11700},
name: "Expr",
},
},
},
},
},
},
},
},
},
},
},
{
name: "LogicExpr1Cmp",
pos: position{line: 485, col: 1, offset: 12031},
expr: &actionExpr{
pos: position{line: 486, col: 4, offset: 12048},
run: (*parser).callonLogicExpr1Cmp1,
expr: &seqExpr{
pos: position{line: 486, col: 4, offset: 12048},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 486, col: 4, offset: 12048},
label: "op",
expr: &ruleRefExpr{
pos: position{line: 486, col: 7, offset: 12051},
name: "CmpOperator",
},
},
&ruleRefExpr{
pos: position{line: 486, col: 19, offset: 12063},
name: "_",
},
&labeledExpr{
pos: position{line: 486, col: 21, offset: 12065},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 486, col: 23, offset: 12067},
name: "ArithmeticExpr",
},
},
},
},
},
},
{
name: "ArithmeticExpr",
pos: position{line: 489, col: 1, offset: 12155},
expr: &ruleRefExpr{
pos: position{line: 490, col: 4, offset: 12173},
name: "ArithmeticExpr3",
},
},
{
name: "ArithmeticExpr3",
pos: position{line: 492, col: 1, offset: 12190},
expr: &actionExpr{
pos: position{line: 493, col: 4, offset: 12209},
run: (*parser).callonArithmeticExpr31,
expr: &seqExpr{
pos: position{line: 493, col: 4, offset: 12209},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 493, col: 4, offset: 12209},
label: "o",
expr: &ruleRefExpr{
pos: position{line: 493, col: 6, offset: 12211},
name: "ArithmeticExpr2",
},
},
&labeledExpr{
pos: position{line: 494, col: 3, offset: 12229},
label: "os",
expr: &zeroOrMoreExpr{
pos: position{line: 494, col: 6, offset: 12232},
expr: &actionExpr{
pos: position{line: 494, col: 8, offset: 12234},
run: (*parser).callonArithmeticExpr37,
expr: &seqExpr{
pos: position{line: 494, col: 8, offset: 12234},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 494, col: 8, offset: 12234},
name: "_",
},
&labeledExpr{
pos: position{line: 494, col: 10, offset: 12236},
label: "op",
expr: &ruleRefExpr{
pos: position{line: 494, col: 13, offset: 12239},
name: "ConcatOperator",
},
},
&ruleRefExpr{
pos: position{line: 494, col: 28, offset: 12254},
name: "_",
},
&labeledExpr{
pos: position{line: 494, col: 30, offset: 12256},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 494, col: 32, offset: 12258},
name: "ArithmeticExpr2",
},
},
},
},
},
},
},
},
},
},
},
{
name: "ArithmeticExpr2",
pos: position{line: 498, col: 1, offset: 12426},
expr: &actionExpr{
pos: position{line: 499, col: 4, offset: 12445},
run: (*parser).callonArithmeticExpr21,
expr: &seqExpr{
pos: position{line: 499, col: 4, offset: 12445},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 499, col: 4, offset: 12445},
label: "o",
expr: &ruleRefExpr{
pos: position{line: 499, col: 6, offset: 12447},
name: "ArithmeticExpr1",
},
},
&labeledExpr{
pos: position{line: 500, col: 3, offset: 12465},
label: "os",
expr: &zeroOrMoreExpr{
pos: position{line: 500, col: 6, offset: 12468},
expr: &actionExpr{
pos: position{line: 500, col: 8, offset: 12470},
run: (*parser).callonArithmeticExpr27,
expr: &seqExpr{
pos: position{line: 500, col: 8, offset: 12470},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 500, col: 8, offset: 12470},
name: "_",
},
&labeledExpr{
pos: position{line: 500, col: 10, offset: 12472},
label: "op",
expr: &ruleRefExpr{
pos: position{line: 500, col: 13, offset: 12475},
name: "AddSubOperator",
},
},
&ruleRefExpr{
pos: position{line: 500, col: 28, offset: 12490},
name: "_",
},
&labeledExpr{
pos: position{line: 500, col: 30, offset: 12492},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 500, col: 32, offset: 12494},
name: "ArithmeticExpr1",
},
},
},
},
},
},
},
},
},
},
},
{
name: "ArithmeticExpr1",
pos: position{line: 504, col: 1, offset: 12662},
expr: &actionExpr{
pos: position{line: 505, col: 4, offset: 12681},
run: (*parser).callonArithmeticExpr11,
expr: &seqExpr{
pos: position{line: 505, col: 4, offset: 12681},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 505, col: 4, offset: 12681},
label: "o",
expr: &ruleRefExpr{
pos: position{line: 505, col: 6, offset: 12683},
name: "Operand",
},
},
&labeledExpr{
pos: position{line: 506, col: 3, offset: 12693},
label: "os",
expr: &zeroOrMoreExpr{
pos: position{line: 506, col: 6, offset: 12696},
expr: &actionExpr{
pos: position{line: 506, col: 8, offset: 12698},
run: (*parser).callonArithmeticExpr17,
expr: &seqExpr{
pos: position{line: 506, col: 8, offset: 12698},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 506, col: 8, offset: 12698},
name: "_",
},
&labeledExpr{
pos: position{line: 506, col: 10, offset: 12700},
label: "op",
expr: &ruleRefExpr{
pos: position{line: 506, col: 13, offset: 12703},
name: "MulDivModOperator",
},
},
&ruleRefExpr{
pos: position{line: 506, col: 31, offset: 12721},
name: "_",
},
&labeledExpr{
pos: position{line: 506, col: 33, offset: 12723},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 506, col: 35, offset: 12725},
name: "Operand",
},
},
},
},
},
},
},
},
},
},
},
{
name: "MultiExpr",
pos: position{line: 510, col: 1, offset: 12885},
expr: &actionExpr{
pos: position{line: 511, col: 4, offset: 12898},
run: (*parser).callonMultiExpr1,
expr: &seqExpr{
pos: position{line: 511, col: 4, offset: 12898},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 511, col: 4, offset: 12898},
label: "x",
expr: &ruleRefExpr{
pos: position{line: 511, col: 6, offset: 12900},
name: "Expr",
},
},
&labeledExpr{
pos: position{line: 511, col: 11, offset: 12905},
label: "xs",
expr: &zeroOrMoreExpr{
pos: position{line: 511, col: 14, offset: 12908},
expr: &actionExpr{
pos: position{line: 511, col: 16, offset: 12910},
run: (*parser).callonMultiExpr7,
expr: &seqExpr{
pos: position{line: 511, col: 16, offset: 12910},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 511, col: 16, offset: 12910},
name: "_",
},
&ruleRefExpr{
pos: position{line: 511, col: 18, offset: 12912},
name: "SeparatorToken",
},
&ruleRefExpr{
pos: position{line: 511, col: 33, offset: 12927},
name: "_",
},
&labeledExpr{
pos: position{line: 511, col: 35, offset: 12929},
label: "e",
expr: &ruleRefExpr{
pos: position{line: 511, col: 37, offset: 12931},
name: "Expr",
},
},
},
},
},
},
},
},
},
},
},
{
name: "MultiExprWithDefault",
pos: position{line: 514, col: 1, offset: 13019},
expr: &actionExpr{
pos: position{line: 515, col: 4, offset: 13043},
run: (*parser).callonMultiExprWithDefault1,
expr: &seqExpr{
pos: position{line: 515, col: 4, offset: 13043},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 515, col: 4, offset: 13043},
label: "x",
expr: &ruleRefExpr{
pos: position{line: 515, col: 6, offset: 13045},
name: "ExprWithDefault",
},
},
&labeledExpr{
pos: position{line: 515, col: 22, offset: 13061},
label: "xs",
expr: &zeroOrMoreExpr{
pos: position{line: 515, col: 25, offset: 13064},
expr: &actionExpr{
pos: position{line: 515, col: 27, offset: 13066},
run: (*parser).callonMultiExprWithDefault7,
expr: &seqExpr{
pos: position{line: 515, col: 27, offset: 13066},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 515, col: 27, offset: 13066},
name: "_",
},
&ruleRefExpr{
pos: position{line: 515, col: 29, offset: 13068},
name: "SeparatorToken",
},
&ruleRefExpr{
pos: position{line: 515, col: 44, offset: 13083},
name: "_",
},
&labeledExpr{
pos: position{line: 515, col: 46, offset: 13085},
label: "e",
expr: &ruleRefExpr{
pos: position{line: 515, col: 48, offset: 13087},
name: "ExprWithDefault",
},
},
},
},
},
},
},
},
},
},
},
{
name: "Operand",
pos: position{line: 518, col: 1, offset: 13186},
expr: &choiceExpr{
pos: position{line: 519, col: 4, offset: 13197},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 519, col: 4, offset: 13197},
run: (*parser).callonOperand2,
expr: &seqExpr{
pos: position{line: 519, col: 4, offset: 13197},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 519, col: 4, offset: 13197},
label: "op",
expr: &ruleRefExpr{
pos: position{line: 519, col: 7, offset: 13200},
name: "UnaryOperator",
},
},
&ruleRefExpr{
pos: position{line: 519, col: 21, offset: 13214},
name: "_",
},
&labeledExpr{
pos: position{line: 519, col: 23, offset: 13216},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 519, col: 25, offset: 13218},
name: "Operand",
},
},
},
},
},
&actionExpr{
pos: position{line: 521, col: 4, offset: 13301},
run: (*parser).callonOperand9,
expr: &seqExpr{
pos: position{line: 521, col: 4, offset: 13301},
exprs: []interface{}{
&litMatcher{
pos: position{line: 521, col: 4, offset: 13301},
val: "(",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 521, col: 8, offset: 13305},
name: "_",
},
&labeledExpr{
pos: position{line: 521, col: 10, offset: 13307},
label: "e",
expr: &ruleRefExpr{
pos: position{line: 521, col: 12, offset: 13309},
name: "Expr",
},
},
&ruleRefExpr{
pos: position{line: 521, col: 17, offset: 13314},
name: "_",
},
&litMatcher{
pos: position{line: 521, col: 19, offset: 13316},
val: ")",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 529, col: 4, offset: 13507},
run: (*parser).callonOperand17,
expr: &seqExpr{
pos: position{line: 529, col: 4, offset: 13507},
exprs: []interface{}{
&andExpr{
pos: position{line: 529, col: 4, offset: 13507},
expr: &ruleRefExpr{
pos: position{line: 529, col: 6, offset: 13509},
name: "CastToken",
},
},
&labeledExpr{
pos: position{line: 529, col: 17, offset: 13520},
label: "t",
expr: &ruleRefExpr{
pos: position{line: 529, col: 19, offset: 13522},
name: "TypeCast",
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 530, col: 4, offset: 13552},
name: "FunctionCall",
},
&ruleRefExpr{
pos: position{line: 531, col: 4, offset: 13568},
name: "Value",
},
&ruleRefExpr{
pos: position{line: 532, col: 4, offset: 13577},
name: "Identifier",
},
},
},
},
{
name: "TypeCast",
pos: position{line: 534, col: 1, offset: 13589},
expr: &actionExpr{
pos: position{line: 535, col: 4, offset: 13601},
run: (*parser).callonTypeCast1,
expr: &seqExpr{
pos: position{line: 535, col: 4, offset: 13601},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 535, col: 4, offset: 13601},
name: "CastToken",
},
&ruleRefExpr{
pos: position{line: 535, col: 14, offset: 13611},
name: "_",
},
&litMatcher{
pos: position{line: 535, col: 16, offset: 13613},
val: "(",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 535, col: 20, offset: 13617},
name: "_",
},
&labeledExpr{
pos: position{line: 535, col: 22, offset: 13619},
label: "o",
expr: &ruleRefExpr{
pos: position{line: 535, col: 24, offset: 13621},
name: "Expr",
},
},
&ruleRefExpr{
pos: position{line: 535, col: 29, offset: 13626},
name: "_",
},
&ruleRefExpr{
pos: position{line: 535, col: 31, offset: 13628},
name: "AsToken",
},
&ruleRefExpr{
pos: position{line: 535, col: 39, offset: 13636},
name: "_",
},
&labeledExpr{
pos: position{line: 535, col: 41, offset: 13638},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 535, col: 43, offset: 13640},
name: "DataType",
},
},
&ruleRefExpr{
pos: position{line: 535, col: 52, offset: 13649},
name: "_",
},
&litMatcher{
pos: position{line: 535, col: 54, offset: 13651},
val: ")",
ignoreCase: false,
},
},
},
},
},
{
name: "FunctionCall",
pos: position{line: 545, col: 1, offset: 13860},
expr: &actionExpr{
pos: position{line: 546, col: 4, offset: 13876},
run: (*parser).callonFunctionCall1,
expr: &seqExpr{
pos: position{line: 546, col: 4, offset: 13876},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 546, col: 4, offset: 13876},
label: "i",
expr: &ruleRefExpr{
pos: position{line: 546, col: 6, offset: 13878},
name: "Identifier",
},
},
&ruleRefExpr{
pos: position{line: 546, col: 17, offset: 13889},
name: "_",
},
&litMatcher{
pos: position{line: 546, col: 19, offset: 13891},
val: "(",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 546, col: 23, offset: 13895},
name: "_",
},
&labeledExpr{
pos: position{line: 546, col: 25, offset: 13897},
label: "r",
expr: &zeroOrOneExpr{
pos: position{line: 546, col: 27, offset: 13899},
expr: &ruleRefExpr{
pos: position{line: 546, col: 27, offset: 13899},
name: "FunctionArgs",
},
},
},
&ruleRefExpr{
pos: position{line: 546, col: 41, offset: 13913},
name: "_",
},
&litMatcher{
pos: position{line: 546, col: 43, offset: 13915},
val: ")",
ignoreCase: false,
},
},
},
},
},
{
name: "FunctionArgs",
pos: position{line: 558, col: 1, offset: 14144},
expr: &choiceExpr{
pos: position{line: 559, col: 4, offset: 14160},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 559, col: 4, offset: 14160},
run: (*parser).callonFunctionArgs2,
expr: &labeledExpr{
pos: position{line: 559, col: 4, offset: 14160},
label: "a",
expr: &ruleRefExpr{
pos: position{line: 559, col: 6, offset: 14162},
name: "AnyLiteral",
},
},
},
&ruleRefExpr{
pos: position{line: 560, col: 4, offset: 14230},
name: "MultiExpr",
},
},
},
},
{
name: "Assignment",
pos: position{line: 562, col: 1, offset: 14241},
expr: &actionExpr{
pos: position{line: 563, col: 4, offset: 14255},
run: (*parser).callonAssignment1,
expr: &seqExpr{
pos: position{line: 563, col: 4, offset: 14255},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 563, col: 4, offset: 14255},
label: "i",
expr: &ruleRefExpr{
pos: position{line: 563, col: 6, offset: 14257},
name: "Identifier",
},
},
&ruleRefExpr{
pos: position{line: 563, col: 17, offset: 14268},
name: "_",
},
&litMatcher{
pos: position{line: 563, col: 19, offset: 14270},
val: "=",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 563, col: 23, offset: 14274},
name: "_",
},
&labeledExpr{
pos: position{line: 563, col: 25, offset: 14276},
label: "e",
expr: &ruleRefExpr{
pos: position{line: 563, col: 27, offset: 14278},
name: "ExprWithDefault",
},
},
},
},
},
},
{
name: "UnaryOperator",
pos: position{line: 574, col: 1, offset: 14514},
expr: &ruleRefExpr{
pos: position{line: 575, col: 4, offset: 14531},
name: "SignOperator",
},
},
{
name: "SignOperator",
pos: position{line: 577, col: 1, offset: 14545},
expr: &actionExpr{
pos: position{line: 578, col: 4, offset: 14561},
run: (*parser).callonSignOperator1,
expr: &ruleRefExpr{
pos: position{line: 578, col: 4, offset: 14561},
name: "Sign",
},
},
},
{
name: "NotOperator",
pos: position{line: 594, col: 1, offset: 14866},
expr: &actionExpr{
pos: position{line: 595, col: 4, offset: 14881},
run: (*parser).callonNotOperator1,
expr: &ruleRefExpr{
pos: position{line: 595, col: 4, offset: 14881},
name: "NotToken",
},
},
},
{
name: "AndOperator",
pos: position{line: 603, col: 1, offset: 15022},
expr: &actionExpr{
pos: position{line: 604, col: 4, offset: 15037},
run: (*parser).callonAndOperator1,
expr: &ruleRefExpr{
pos: position{line: 604, col: 4, offset: 15037},
name: "AndToken",
},
},
},
{
name: "OrOperator",
pos: position{line: 612, col: 1, offset: 15178},
expr: &actionExpr{
pos: position{line: 613, col: 4, offset: 15192},
run: (*parser).callonOrOperator1,
expr: &ruleRefExpr{
pos: position{line: 613, col: 4, offset: 15192},
name: "OrToken",
},
},
},
{
name: "CmpOperator",
pos: position{line: 621, col: 1, offset: 15331},
expr: &actionExpr{
pos: position{line: 622, col: 4, offset: 15346},
run: (*parser).callonCmpOperator1,
expr: &choiceExpr{
pos: position{line: 622, col: 6, offset: 15348},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 622, col: 6, offset: 15348},
val: "<=",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 622, col: 13, offset: 15355},
val: ">=",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 622, col: 20, offset: 15362},
val: "<>",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 622, col: 27, offset: 15369},
val: "!=",
ignoreCase: false,
},
&charClassMatcher{
pos: position{line: 622, col: 34, offset: 15376},
val: "[<>=]",
chars: []rune{'<', '>', '='},
ignoreCase: false,
inverted: false,
},
},
},
},
},
{
name: "ConcatOperator",
pos: position{line: 648, col: 1, offset: 15955},
expr: &actionExpr{
pos: position{line: 649, col: 4, offset: 15973},
run: (*parser).callonConcatOperator1,
expr: &litMatcher{
pos: position{line: 649, col: 4, offset: 15973},
val: "||",
ignoreCase: false,
},
},
},
{
name: "AddSubOperator",
pos: position{line: 657, col: 1, offset: 16113},
expr: &actionExpr{
pos: position{line: 658, col: 4, offset: 16131},
run: (*parser).callonAddSubOperator1,
expr: &charClassMatcher{
pos: position{line: 658, col: 4, offset: 16131},
val: "[+-]",
chars: []rune{'+', '-'},
ignoreCase: false,
inverted: false,
},
},
},
{
name: "MulDivModOperator",
pos: position{line: 674, col: 1, offset: 16465},
expr: &actionExpr{
pos: position{line: 675, col: 4, offset: 16486},
run: (*parser).callonMulDivModOperator1,
expr: &charClassMatcher{
pos: position{line: 675, col: 4, offset: 16486},
val: "[*/%]",
chars: []rune{'*', '/', '%'},
ignoreCase: false,
inverted: false,
},
},
},
{
name: "DataType",
pos: position{line: 694, col: 1, offset: 16886},
expr: &choiceExpr{
pos: position{line: 695, col: 4, offset: 16898},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 695, col: 4, offset: 16898},
name: "UIntType",
},
&ruleRefExpr{
pos: position{line: 696, col: 4, offset: 16910},
name: "IntType",
},
&ruleRefExpr{
pos: position{line: 697, col: 4, offset: 16921},
name: "UFixedType",
},
&ruleRefExpr{
pos: position{line: 698, col: 4, offset: 16935},
name: "FixedType",
},
&ruleRefExpr{
pos: position{line: 699, col: 4, offset: 16948},
name: "FixedBytesType",
},
&ruleRefExpr{
pos: position{line: 700, col: 4, offset: 16966},
name: "DynamicBytesType",
},
&ruleRefExpr{
pos: position{line: 701, col: 4, offset: 16986},
name: "BoolType",
},
&ruleRefExpr{
pos: position{line: 702, col: 4, offset: 16998},
name: "AddressType",
},
},
},
},
{
name: "UIntType",
pos: position{line: 704, col: 1, offset: 17011},
expr: &actionExpr{
pos: position{line: 705, col: 4, offset: 17023},
run: (*parser).callonUIntType1,
expr: &seqExpr{
pos: position{line: 705, col: 4, offset: 17023},
exprs: []interface{}{
&litMatcher{
pos: position{line: 705, col: 4, offset: 17023},
val: "uint",
ignoreCase: true,
},
&labeledExpr{
pos: position{line: 705, col: 12, offset: 17031},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 705, col: 14, offset: 17033},
name: "NonZeroLeadingInteger",
},
},
¬Expr{
pos: position{line: 705, col: 36, offset: 17055},
expr: &ruleRefExpr{
pos: position{line: 705, col: 37, offset: 17056},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "IntType",
pos: position{line: 727, col: 1, offset: 17573},
expr: &actionExpr{
pos: position{line: 728, col: 4, offset: 17584},
run: (*parser).callonIntType1,
expr: &seqExpr{
pos: position{line: 728, col: 4, offset: 17584},
exprs: []interface{}{
&litMatcher{
pos: position{line: 728, col: 4, offset: 17584},
val: "int",
ignoreCase: true,
},
&labeledExpr{
pos: position{line: 728, col: 11, offset: 17591},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 728, col: 13, offset: 17593},
name: "NonZeroLeadingInteger",
},
},
¬Expr{
pos: position{line: 728, col: 35, offset: 17615},
expr: &ruleRefExpr{
pos: position{line: 728, col: 36, offset: 17616},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "UFixedType",
pos: position{line: 750, col: 1, offset: 18133},
expr: &actionExpr{
pos: position{line: 751, col: 4, offset: 18147},
run: (*parser).callonUFixedType1,
expr: &seqExpr{
pos: position{line: 751, col: 4, offset: 18147},
exprs: []interface{}{
&litMatcher{
pos: position{line: 751, col: 4, offset: 18147},
val: "ufixed",
ignoreCase: true,
},
&labeledExpr{
pos: position{line: 751, col: 14, offset: 18157},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 751, col: 16, offset: 18159},
name: "NonZeroLeadingInteger",
},
},
&litMatcher{
pos: position{line: 751, col: 38, offset: 18181},
val: "x",
ignoreCase: true,
},
&labeledExpr{
pos: position{line: 751, col: 43, offset: 18186},
label: "t",
expr: &ruleRefExpr{
pos: position{line: 751, col: 45, offset: 18188},
name: "NonZeroLeadingInteger",
},
},
¬Expr{
pos: position{line: 751, col: 67, offset: 18210},
expr: &ruleRefExpr{
pos: position{line: 751, col: 68, offset: 18211},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "FixedType",
pos: position{line: 786, col: 1, offset: 19116},
expr: &actionExpr{
pos: position{line: 787, col: 4, offset: 19129},
run: (*parser).callonFixedType1,
expr: &seqExpr{
pos: position{line: 787, col: 4, offset: 19129},
exprs: []interface{}{
&litMatcher{
pos: position{line: 787, col: 4, offset: 19129},
val: "fixed",
ignoreCase: true,
},
&labeledExpr{
pos: position{line: 787, col: 13, offset: 19138},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 787, col: 15, offset: 19140},
name: "NonZeroLeadingInteger",
},
},
&litMatcher{
pos: position{line: 787, col: 37, offset: 19162},
val: "x",
ignoreCase: true,
},
&labeledExpr{
pos: position{line: 787, col: 42, offset: 19167},
label: "t",
expr: &ruleRefExpr{
pos: position{line: 787, col: 44, offset: 19169},
name: "NonZeroLeadingInteger",
},
},
¬Expr{
pos: position{line: 787, col: 66, offset: 19191},
expr: &ruleRefExpr{
pos: position{line: 787, col: 67, offset: 19192},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "FixedBytesType",
pos: position{line: 822, col: 1, offset: 20096},
expr: &choiceExpr{
pos: position{line: 823, col: 4, offset: 20114},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 823, col: 4, offset: 20114},
run: (*parser).callonFixedBytesType2,
expr: &seqExpr{
pos: position{line: 823, col: 4, offset: 20114},
exprs: []interface{}{
&litMatcher{
pos: position{line: 823, col: 4, offset: 20114},
val: "bytes",
ignoreCase: true,
},
&labeledExpr{
pos: position{line: 823, col: 13, offset: 20123},
label: "s",
expr: &ruleRefExpr{
pos: position{line: 823, col: 15, offset: 20125},
name: "NonZeroLeadingInteger",
},
},
¬Expr{
pos: position{line: 823, col: 37, offset: 20147},
expr: &ruleRefExpr{
pos: position{line: 823, col: 38, offset: 20148},
name: "NormalIdentifierRest",
},
},
},
},
},
&actionExpr{
pos: position{line: 843, col: 4, offset: 20658},
run: (*parser).callonFixedBytesType9,
expr: &seqExpr{
pos: position{line: 843, col: 4, offset: 20658},
exprs: []interface{}{
&litMatcher{
pos: position{line: 843, col: 4, offset: 20658},
val: "byte",
ignoreCase: true,
},
¬Expr{
pos: position{line: 843, col: 12, offset: 20666},
expr: &ruleRefExpr{
pos: position{line: 843, col: 13, offset: 20667},
name: "NormalIdentifierRest",
},
},
},
},
},
},
},
},
{
name: "DynamicBytesType",
pos: position{line: 852, col: 1, offset: 20838},
expr: &actionExpr{
pos: position{line: 853, col: 4, offset: 20858},
run: (*parser).callonDynamicBytesType1,
expr: &choiceExpr{
pos: position{line: 853, col: 6, offset: 20860},
alternatives: []interface{}{
&seqExpr{
pos: position{line: 853, col: 6, offset: 20860},
exprs: []interface{}{
&litMatcher{
pos: position{line: 853, col: 6, offset: 20860},
val: "bytes",
ignoreCase: true,
},
¬Expr{
pos: position{line: 853, col: 15, offset: 20869},
expr: &ruleRefExpr{
pos: position{line: 853, col: 16, offset: 20870},
name: "NormalIdentifierRest",
},
},
},
},
&seqExpr{
pos: position{line: 854, col: 5, offset: 20895},
exprs: []interface{}{
&litMatcher{
pos: position{line: 854, col: 5, offset: 20895},
val: "string",
ignoreCase: true,
},
¬Expr{
pos: position{line: 854, col: 15, offset: 20905},
expr: &ruleRefExpr{
pos: position{line: 854, col: 16, offset: 20906},
name: "NormalIdentifierRest",
},
},
},
},
&seqExpr{
pos: position{line: 855, col: 5, offset: 20931},
exprs: []interface{}{
&litMatcher{
pos: position{line: 855, col: 5, offset: 20931},
val: "text",
ignoreCase: true,
},
¬Expr{
pos: position{line: 855, col: 13, offset: 20939},
expr: &ruleRefExpr{
pos: position{line: 855, col: 14, offset: 20940},
name: "NormalIdentifierRest",
},
},
},
},
},
},
},
},
{
name: "AddressType",
pos: position{line: 864, col: 1, offset: 21101},
expr: &actionExpr{
pos: position{line: 865, col: 4, offset: 21116},
run: (*parser).callonAddressType1,
expr: &seqExpr{
pos: position{line: 865, col: 4, offset: 21116},
exprs: []interface{}{
&litMatcher{
pos: position{line: 865, col: 4, offset: 21116},
val: "address",
ignoreCase: true,
},
¬Expr{
pos: position{line: 865, col: 15, offset: 21127},
expr: &ruleRefExpr{
pos: position{line: 865, col: 16, offset: 21128},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "BoolType",
pos: position{line: 873, col: 1, offset: 21281},
expr: &actionExpr{
pos: position{line: 874, col: 4, offset: 21293},
run: (*parser).callonBoolType1,
expr: &choiceExpr{
pos: position{line: 874, col: 6, offset: 21295},
alternatives: []interface{}{
&seqExpr{
pos: position{line: 874, col: 6, offset: 21295},
exprs: []interface{}{
&litMatcher{
pos: position{line: 874, col: 6, offset: 21295},
val: "bool",
ignoreCase: true,
},
¬Expr{
pos: position{line: 874, col: 14, offset: 21303},
expr: &ruleRefExpr{
pos: position{line: 874, col: 15, offset: 21304},
name: "NormalIdentifierRest",
},
},
},
},
&seqExpr{
pos: position{line: 875, col: 5, offset: 21329},
exprs: []interface{}{
&litMatcher{
pos: position{line: 875, col: 5, offset: 21329},
val: "boolean",
ignoreCase: true,
},
¬Expr{
pos: position{line: 875, col: 16, offset: 21340},
expr: &ruleRefExpr{
pos: position{line: 875, col: 17, offset: 21341},
name: "NormalIdentifierRest",
},
},
},
},
},
},
},
},
{
name: "Value",
pos: position{line: 885, col: 1, offset: 21507},
expr: &choiceExpr{
pos: position{line: 886, col: 4, offset: 21516},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 886, col: 4, offset: 21516},
name: "NumberLiteral",
},
&ruleRefExpr{
pos: position{line: 887, col: 4, offset: 21533},
name: "StringLiteral",
},
&ruleRefExpr{
pos: position{line: 888, col: 4, offset: 21550},
name: "BoolLiteral",
},
&ruleRefExpr{
pos: position{line: 889, col: 4, offset: 21565},
name: "NullLiteral",
},
},
},
},
{
name: "AnyLiteral",
pos: position{line: 891, col: 1, offset: 21578},
expr: &actionExpr{
pos: position{line: 892, col: 4, offset: 21592},
run: (*parser).callonAnyLiteral1,
expr: &ruleRefExpr{
pos: position{line: 892, col: 4, offset: 21592},
name: "AnyToken",
},
},
},
{
name: "DefaultLiteral",
pos: position{line: 900, col: 1, offset: 21730},
expr: &actionExpr{
pos: position{line: 901, col: 4, offset: 21748},
run: (*parser).callonDefaultLiteral1,
expr: &ruleRefExpr{
pos: position{line: 901, col: 4, offset: 21748},
name: "DefaultToken",
},
},
},
{
name: "BoolLiteral",
pos: position{line: 909, col: 1, offset: 21894},
expr: &actionExpr{
pos: position{line: 910, col: 4, offset: 21909},
run: (*parser).callonBoolLiteral1,
expr: &labeledExpr{
pos: position{line: 910, col: 4, offset: 21909},
label: "b",
expr: &choiceExpr{
pos: position{line: 910, col: 8, offset: 21913},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 910, col: 8, offset: 21913},
name: "TrueToken",
},
&ruleRefExpr{
pos: position{line: 910, col: 20, offset: 21925},
name: "FalseToken",
},
},
},
},
},
},
{
name: "NullLiteral",
pos: position{line: 919, col: 1, offset: 22122},
expr: &actionExpr{
pos: position{line: 920, col: 4, offset: 22137},
run: (*parser).callonNullLiteral1,
expr: &ruleRefExpr{
pos: position{line: 920, col: 4, offset: 22137},
name: "NullToken",
},
},
},
{
name: "NumberLiteral",
pos: position{line: 928, col: 1, offset: 22277},
expr: &choiceExpr{
pos: position{line: 929, col: 4, offset: 22294},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 929, col: 4, offset: 22294},
run: (*parser).callonNumberLiteral2,
expr: &seqExpr{
pos: position{line: 929, col: 4, offset: 22294},
exprs: []interface{}{
&andExpr{
pos: position{line: 929, col: 4, offset: 22294},
expr: &seqExpr{
pos: position{line: 929, col: 6, offset: 22296},
exprs: []interface{}{
&litMatcher{
pos: position{line: 929, col: 6, offset: 22296},
val: "0",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 929, col: 10, offset: 22300},
val: "x",
ignoreCase: true,
},
},
},
},
&labeledExpr{
pos: position{line: 929, col: 16, offset: 22306},
label: "h",
expr: &ruleRefExpr{
pos: position{line: 929, col: 18, offset: 22308},
name: "Hex",
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 930, col: 4, offset: 22333},
name: "Decimal",
},
},
},
},
{
name: "Sign",
pos: position{line: 932, col: 1, offset: 22342},
expr: &charClassMatcher{
pos: position{line: 933, col: 4, offset: 22350},
val: "[-+]",
chars: []rune{'-', '+'},
ignoreCase: false,
inverted: false,
},
},
{
name: "Integer",
pos: position{line: 935, col: 1, offset: 22356},
expr: &actionExpr{
pos: position{line: 936, col: 4, offset: 22367},
run: (*parser).callonInteger1,
expr: &oneOrMoreExpr{
pos: position{line: 936, col: 4, offset: 22367},
expr: &charClassMatcher{
pos: position{line: 936, col: 4, offset: 22367},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
},
{
name: "NonZeroLeadingInteger",
pos: position{line: 958, col: 1, offset: 22872},
expr: &actionExpr{
pos: position{line: 959, col: 4, offset: 22897},
run: (*parser).callonNonZeroLeadingInteger1,
expr: &choiceExpr{
pos: position{line: 959, col: 6, offset: 22899},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 959, col: 6, offset: 22899},
val: "0",
ignoreCase: false,
},
&seqExpr{
pos: position{line: 959, col: 12, offset: 22905},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 959, col: 12, offset: 22905},
val: "[1-9]",
ranges: []rune{'1', '9'},
ignoreCase: false,
inverted: false,
},
&zeroOrMoreExpr{
pos: position{line: 959, col: 17, offset: 22910},
expr: &charClassMatcher{
pos: position{line: 959, col: 17, offset: 22910},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
},
},
{
name: "Fixnum",
pos: position{line: 962, col: 1, offset: 22943},
expr: &choiceExpr{
pos: position{line: 963, col: 4, offset: 22953},
alternatives: []interface{}{
&seqExpr{
pos: position{line: 963, col: 4, offset: 22953},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 963, col: 4, offset: 22953},
name: "Integer",
},
&litMatcher{
pos: position{line: 963, col: 12, offset: 22961},
val: ".",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 963, col: 16, offset: 22965},
name: "Integer",
},
},
},
&seqExpr{
pos: position{line: 964, col: 4, offset: 22976},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 964, col: 4, offset: 22976},
name: "Integer",
},
&zeroOrOneExpr{
pos: position{line: 964, col: 12, offset: 22984},
expr: &litMatcher{
pos: position{line: 964, col: 12, offset: 22984},
val: ".",
ignoreCase: false,
},
},
},
},
&seqExpr{
pos: position{line: 965, col: 4, offset: 22992},
exprs: []interface{}{
&litMatcher{
pos: position{line: 965, col: 4, offset: 22992},
val: ".",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 965, col: 8, offset: 22996},
name: "Integer",
},
},
},
},
},
},
{
name: "Decimal",
pos: position{line: 967, col: 1, offset: 23005},
expr: &actionExpr{
pos: position{line: 968, col: 4, offset: 23016},
run: (*parser).callonDecimal1,
expr: &seqExpr{
pos: position{line: 968, col: 4, offset: 23016},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 968, col: 4, offset: 23016},
name: "Fixnum",
},
&zeroOrOneExpr{
pos: position{line: 968, col: 11, offset: 23023},
expr: &seqExpr{
pos: position{line: 968, col: 13, offset: 23025},
exprs: []interface{}{
&litMatcher{
pos: position{line: 968, col: 13, offset: 23025},
val: "e",
ignoreCase: true,
},
&zeroOrOneExpr{
pos: position{line: 968, col: 18, offset: 23030},
expr: &ruleRefExpr{
pos: position{line: 968, col: 18, offset: 23030},
name: "Sign",
},
},
&ruleRefExpr{
pos: position{line: 968, col: 24, offset: 23036},
name: "Integer",
},
},
},
},
},
},
},
},
{
name: "Hex",
pos: position{line: 989, col: 1, offset: 23521},
expr: &actionExpr{
pos: position{line: 990, col: 4, offset: 23528},
run: (*parser).callonHex1,
expr: &seqExpr{
pos: position{line: 990, col: 4, offset: 23528},
exprs: []interface{}{
&litMatcher{
pos: position{line: 990, col: 4, offset: 23528},
val: "0x",
ignoreCase: false,
},
&oneOrMoreExpr{
pos: position{line: 990, col: 9, offset: 23533},
expr: &charClassMatcher{
pos: position{line: 990, col: 11, offset: 23535},
val: "[0-9A-Fa-f]",
ranges: []rune{'0', '9', 'A', 'F', 'a', 'f'},
ignoreCase: false,
inverted: false,
},
},
¬Expr{
pos: position{line: 990, col: 26, offset: 23550},
expr: &ruleRefExpr{
pos: position{line: 990, col: 27, offset: 23551},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "StringLiteral",
pos: position{line: 998, col: 1, offset: 23702},
expr: &choiceExpr{
pos: position{line: 999, col: 4, offset: 23719},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 999, col: 4, offset: 23719},
name: "HexString",
},
&ruleRefExpr{
pos: position{line: 1000, col: 4, offset: 23732},
name: "NormalString",
},
},
},
},
{
name: "HexString",
pos: position{line: 1002, col: 1, offset: 23746},
expr: &actionExpr{
pos: position{line: 1003, col: 4, offset: 23759},
run: (*parser).callonHexString1,
expr: &seqExpr{
pos: position{line: 1003, col: 4, offset: 23759},
exprs: []interface{}{
&choiceExpr{
pos: position{line: 1003, col: 6, offset: 23761},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 1003, col: 6, offset: 23761},
val: "hex",
ignoreCase: true,
},
&litMatcher{
pos: position{line: 1003, col: 15, offset: 23770},
val: "x",
ignoreCase: true,
},
},
},
&litMatcher{
pos: position{line: 1003, col: 22, offset: 23777},
val: "'",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1003, col: 26, offset: 23781},
label: "s",
expr: &zeroOrMoreExpr{
pos: position{line: 1003, col: 28, offset: 23783},
expr: &actionExpr{
pos: position{line: 1003, col: 29, offset: 23784},
run: (*parser).callonHexString9,
expr: &seqExpr{
pos: position{line: 1003, col: 29, offset: 23784},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 1003, col: 29, offset: 23784},
val: "[0-9a-fA-F]",
ranges: []rune{'0', '9', 'a', 'f', 'A', 'F'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 1003, col: 40, offset: 23795},
val: "[0-9a-fA-F]",
ranges: []rune{'0', '9', 'a', 'f', 'A', 'F'},
ignoreCase: false,
inverted: false,
},
},
},
},
},
},
&litMatcher{
pos: position{line: 1003, col: 78, offset: 23833},
val: "'",
ignoreCase: false,
},
},
},
},
},
{
name: "NormalString",
pos: position{line: 1012, col: 1, offset: 24016},
expr: &actionExpr{
pos: position{line: 1013, col: 4, offset: 24032},
run: (*parser).callonNormalString1,
expr: &seqExpr{
pos: position{line: 1013, col: 4, offset: 24032},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1013, col: 4, offset: 24032},
val: "'",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1013, col: 8, offset: 24036},
label: "s",
expr: &zeroOrMoreExpr{
pos: position{line: 1013, col: 10, offset: 24038},
expr: &actionExpr{
pos: position{line: 1013, col: 12, offset: 24040},
run: (*parser).callonNormalString6,
expr: &choiceExpr{
pos: position{line: 1013, col: 14, offset: 24042},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 1013, col: 14, offset: 24042},
val: "[^'\\r\\n\\\\]",
chars: []rune{'\'', '\r', '\n', '\\'},
ignoreCase: false,
inverted: true,
},
&seqExpr{
pos: position{line: 1013, col: 27, offset: 24055},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1013, col: 27, offset: 24055},
val: "\\",
ignoreCase: false,
},
&anyMatcher{
line: 1013, col: 32, offset: 24060,
},
},
},
},
},
},
},
},
&litMatcher{
pos: position{line: 1013, col: 62, offset: 24090},
val: "'",
ignoreCase: false,
},
},
},
},
},
{
name: "SelectToken",
pos: position{line: 1038, col: 1, offset: 24663},
expr: &actionExpr{
pos: position{line: 1039, col: 4, offset: 24678},
run: (*parser).callonSelectToken1,
expr: &seqExpr{
pos: position{line: 1039, col: 4, offset: 24678},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1039, col: 4, offset: 24678},
val: "select",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1039, col: 14, offset: 24688},
expr: &ruleRefExpr{
pos: position{line: 1039, col: 15, offset: 24689},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "FromToken",
pos: position{line: 1042, col: 1, offset: 24734},
expr: &actionExpr{
pos: position{line: 1043, col: 4, offset: 24747},
run: (*parser).callonFromToken1,
expr: &seqExpr{
pos: position{line: 1043, col: 4, offset: 24747},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1043, col: 4, offset: 24747},
val: "from",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1043, col: 12, offset: 24755},
expr: &ruleRefExpr{
pos: position{line: 1043, col: 13, offset: 24756},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "WhereToken",
pos: position{line: 1046, col: 1, offset: 24801},
expr: &actionExpr{
pos: position{line: 1047, col: 4, offset: 24815},
run: (*parser).callonWhereToken1,
expr: &seqExpr{
pos: position{line: 1047, col: 4, offset: 24815},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1047, col: 4, offset: 24815},
val: "where",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1047, col: 13, offset: 24824},
expr: &ruleRefExpr{
pos: position{line: 1047, col: 14, offset: 24825},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "OrderToken",
pos: position{line: 1050, col: 1, offset: 24870},
expr: &actionExpr{
pos: position{line: 1051, col: 4, offset: 24884},
run: (*parser).callonOrderToken1,
expr: &seqExpr{
pos: position{line: 1051, col: 4, offset: 24884},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1051, col: 4, offset: 24884},
val: "order",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1051, col: 13, offset: 24893},
expr: &ruleRefExpr{
pos: position{line: 1051, col: 14, offset: 24894},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "ByToken",
pos: position{line: 1054, col: 1, offset: 24939},
expr: &actionExpr{
pos: position{line: 1055, col: 4, offset: 24950},
run: (*parser).callonByToken1,
expr: &seqExpr{
pos: position{line: 1055, col: 4, offset: 24950},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1055, col: 4, offset: 24950},
val: "by",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1055, col: 10, offset: 24956},
expr: &ruleRefExpr{
pos: position{line: 1055, col: 11, offset: 24957},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "GroupToken",
pos: position{line: 1058, col: 1, offset: 25002},
expr: &actionExpr{
pos: position{line: 1059, col: 4, offset: 25016},
run: (*parser).callonGroupToken1,
expr: &seqExpr{
pos: position{line: 1059, col: 4, offset: 25016},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1059, col: 4, offset: 25016},
val: "group",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1059, col: 13, offset: 25025},
expr: &ruleRefExpr{
pos: position{line: 1059, col: 14, offset: 25026},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "LimitToken",
pos: position{line: 1062, col: 1, offset: 25071},
expr: &actionExpr{
pos: position{line: 1063, col: 4, offset: 25085},
run: (*parser).callonLimitToken1,
expr: &seqExpr{
pos: position{line: 1063, col: 4, offset: 25085},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1063, col: 4, offset: 25085},
val: "limit",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1063, col: 13, offset: 25094},
expr: &ruleRefExpr{
pos: position{line: 1063, col: 14, offset: 25095},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "OffsetToken",
pos: position{line: 1066, col: 1, offset: 25140},
expr: &actionExpr{
pos: position{line: 1067, col: 4, offset: 25155},
run: (*parser).callonOffsetToken1,
expr: &seqExpr{
pos: position{line: 1067, col: 4, offset: 25155},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1067, col: 4, offset: 25155},
val: "offset",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1067, col: 14, offset: 25165},
expr: &ruleRefExpr{
pos: position{line: 1067, col: 15, offset: 25166},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "UpdateToken",
pos: position{line: 1070, col: 1, offset: 25211},
expr: &actionExpr{
pos: position{line: 1071, col: 4, offset: 25226},
run: (*parser).callonUpdateToken1,
expr: &seqExpr{
pos: position{line: 1071, col: 4, offset: 25226},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1071, col: 4, offset: 25226},
val: "update",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1071, col: 14, offset: 25236},
expr: &ruleRefExpr{
pos: position{line: 1071, col: 15, offset: 25237},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "SetToken",
pos: position{line: 1074, col: 1, offset: 25282},
expr: &actionExpr{
pos: position{line: 1075, col: 4, offset: 25294},
run: (*parser).callonSetToken1,
expr: &seqExpr{
pos: position{line: 1075, col: 4, offset: 25294},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1075, col: 4, offset: 25294},
val: "set",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1075, col: 11, offset: 25301},
expr: &ruleRefExpr{
pos: position{line: 1075, col: 12, offset: 25302},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "DeleteToken",
pos: position{line: 1078, col: 1, offset: 25347},
expr: &actionExpr{
pos: position{line: 1079, col: 4, offset: 25362},
run: (*parser).callonDeleteToken1,
expr: &seqExpr{
pos: position{line: 1079, col: 4, offset: 25362},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1079, col: 4, offset: 25362},
val: "delete",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1079, col: 14, offset: 25372},
expr: &ruleRefExpr{
pos: position{line: 1079, col: 15, offset: 25373},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "InsertToken",
pos: position{line: 1082, col: 1, offset: 25418},
expr: &actionExpr{
pos: position{line: 1083, col: 4, offset: 25433},
run: (*parser).callonInsertToken1,
expr: &seqExpr{
pos: position{line: 1083, col: 4, offset: 25433},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1083, col: 4, offset: 25433},
val: "insert",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1083, col: 14, offset: 25443},
expr: &ruleRefExpr{
pos: position{line: 1083, col: 15, offset: 25444},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "IntoToken",
pos: position{line: 1086, col: 1, offset: 25489},
expr: &actionExpr{
pos: position{line: 1087, col: 4, offset: 25502},
run: (*parser).callonIntoToken1,
expr: &seqExpr{
pos: position{line: 1087, col: 4, offset: 25502},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1087, col: 4, offset: 25502},
val: "into",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1087, col: 12, offset: 25510},
expr: &ruleRefExpr{
pos: position{line: 1087, col: 13, offset: 25511},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "ValuesToken",
pos: position{line: 1090, col: 1, offset: 25556},
expr: &actionExpr{
pos: position{line: 1091, col: 4, offset: 25571},
run: (*parser).callonValuesToken1,
expr: &seqExpr{
pos: position{line: 1091, col: 4, offset: 25571},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1091, col: 4, offset: 25571},
val: "values",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1091, col: 14, offset: 25581},
expr: &ruleRefExpr{
pos: position{line: 1091, col: 15, offset: 25582},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "CreateToken",
pos: position{line: 1094, col: 1, offset: 25627},
expr: &actionExpr{
pos: position{line: 1095, col: 4, offset: 25642},
run: (*parser).callonCreateToken1,
expr: &seqExpr{
pos: position{line: 1095, col: 4, offset: 25642},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1095, col: 4, offset: 25642},
val: "create",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1095, col: 14, offset: 25652},
expr: &ruleRefExpr{
pos: position{line: 1095, col: 15, offset: 25653},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "TableToken",
pos: position{line: 1098, col: 1, offset: 25698},
expr: &actionExpr{
pos: position{line: 1099, col: 4, offset: 25712},
run: (*parser).callonTableToken1,
expr: &seqExpr{
pos: position{line: 1099, col: 4, offset: 25712},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1099, col: 4, offset: 25712},
val: "table",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1099, col: 13, offset: 25721},
expr: &ruleRefExpr{
pos: position{line: 1099, col: 14, offset: 25722},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "IndexToken",
pos: position{line: 1102, col: 1, offset: 25767},
expr: &actionExpr{
pos: position{line: 1103, col: 4, offset: 25781},
run: (*parser).callonIndexToken1,
expr: &seqExpr{
pos: position{line: 1103, col: 4, offset: 25781},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1103, col: 4, offset: 25781},
val: "index",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1103, col: 13, offset: 25790},
expr: &ruleRefExpr{
pos: position{line: 1103, col: 14, offset: 25791},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "UniqueToken",
pos: position{line: 1106, col: 1, offset: 25836},
expr: &actionExpr{
pos: position{line: 1107, col: 4, offset: 25851},
run: (*parser).callonUniqueToken1,
expr: &seqExpr{
pos: position{line: 1107, col: 4, offset: 25851},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1107, col: 4, offset: 25851},
val: "unique",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1107, col: 14, offset: 25861},
expr: &ruleRefExpr{
pos: position{line: 1107, col: 15, offset: 25862},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "DefaultToken",
pos: position{line: 1110, col: 1, offset: 25907},
expr: &actionExpr{
pos: position{line: 1111, col: 4, offset: 25923},
run: (*parser).callonDefaultToken1,
expr: &seqExpr{
pos: position{line: 1111, col: 4, offset: 25923},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1111, col: 4, offset: 25923},
val: "default",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1111, col: 15, offset: 25934},
expr: &ruleRefExpr{
pos: position{line: 1111, col: 16, offset: 25935},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "PrimaryToken",
pos: position{line: 1114, col: 1, offset: 25980},
expr: &actionExpr{
pos: position{line: 1115, col: 4, offset: 25996},
run: (*parser).callonPrimaryToken1,
expr: &seqExpr{
pos: position{line: 1115, col: 4, offset: 25996},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1115, col: 4, offset: 25996},
val: "primary",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1115, col: 15, offset: 26007},
expr: &ruleRefExpr{
pos: position{line: 1115, col: 16, offset: 26008},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "KeyToken",
pos: position{line: 1118, col: 1, offset: 26053},
expr: &actionExpr{
pos: position{line: 1119, col: 4, offset: 26065},
run: (*parser).callonKeyToken1,
expr: &seqExpr{
pos: position{line: 1119, col: 4, offset: 26065},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1119, col: 4, offset: 26065},
val: "key",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1119, col: 11, offset: 26072},
expr: &ruleRefExpr{
pos: position{line: 1119, col: 12, offset: 26073},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "ReferencesToken",
pos: position{line: 1122, col: 1, offset: 26118},
expr: &actionExpr{
pos: position{line: 1123, col: 4, offset: 26137},
run: (*parser).callonReferencesToken1,
expr: &seqExpr{
pos: position{line: 1123, col: 4, offset: 26137},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1123, col: 4, offset: 26137},
val: "references",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1123, col: 18, offset: 26151},
expr: &ruleRefExpr{
pos: position{line: 1123, col: 19, offset: 26152},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "AutoincrementToken",
pos: position{line: 1126, col: 1, offset: 26197},
expr: &actionExpr{
pos: position{line: 1127, col: 4, offset: 26219},
run: (*parser).callonAutoincrementToken1,
expr: &seqExpr{
pos: position{line: 1127, col: 4, offset: 26219},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1127, col: 4, offset: 26219},
val: "autoincrement",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1127, col: 21, offset: 26236},
expr: &ruleRefExpr{
pos: position{line: 1127, col: 22, offset: 26237},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "OnToken",
pos: position{line: 1130, col: 1, offset: 26282},
expr: &actionExpr{
pos: position{line: 1131, col: 4, offset: 26293},
run: (*parser).callonOnToken1,
expr: &seqExpr{
pos: position{line: 1131, col: 4, offset: 26293},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1131, col: 4, offset: 26293},
val: "on",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1131, col: 10, offset: 26299},
expr: &ruleRefExpr{
pos: position{line: 1131, col: 11, offset: 26300},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "TrueToken",
pos: position{line: 1134, col: 1, offset: 26345},
expr: &actionExpr{
pos: position{line: 1135, col: 4, offset: 26358},
run: (*parser).callonTrueToken1,
expr: &seqExpr{
pos: position{line: 1135, col: 4, offset: 26358},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1135, col: 4, offset: 26358},
val: "true",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1135, col: 12, offset: 26366},
expr: &ruleRefExpr{
pos: position{line: 1135, col: 13, offset: 26367},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "FalseToken",
pos: position{line: 1138, col: 1, offset: 26412},
expr: &actionExpr{
pos: position{line: 1139, col: 4, offset: 26426},
run: (*parser).callonFalseToken1,
expr: &seqExpr{
pos: position{line: 1139, col: 4, offset: 26426},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1139, col: 4, offset: 26426},
val: "false",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1139, col: 13, offset: 26435},
expr: &ruleRefExpr{
pos: position{line: 1139, col: 14, offset: 26436},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "NullToken",
pos: position{line: 1142, col: 1, offset: 26481},
expr: &actionExpr{
pos: position{line: 1143, col: 4, offset: 26494},
run: (*parser).callonNullToken1,
expr: &seqExpr{
pos: position{line: 1143, col: 4, offset: 26494},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1143, col: 4, offset: 26494},
val: "null",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1143, col: 12, offset: 26502},
expr: &ruleRefExpr{
pos: position{line: 1143, col: 13, offset: 26503},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "IsToken",
pos: position{line: 1146, col: 1, offset: 26548},
expr: &actionExpr{
pos: position{line: 1147, col: 4, offset: 26559},
run: (*parser).callonIsToken1,
expr: &seqExpr{
pos: position{line: 1147, col: 4, offset: 26559},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1147, col: 4, offset: 26559},
val: "is",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1147, col: 10, offset: 26565},
expr: &ruleRefExpr{
pos: position{line: 1147, col: 11, offset: 26566},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "NullsToken",
pos: position{line: 1150, col: 1, offset: 26611},
expr: &actionExpr{
pos: position{line: 1151, col: 4, offset: 26625},
run: (*parser).callonNullsToken1,
expr: &seqExpr{
pos: position{line: 1151, col: 4, offset: 26625},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1151, col: 4, offset: 26625},
val: "nulls",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1151, col: 13, offset: 26634},
expr: &ruleRefExpr{
pos: position{line: 1151, col: 14, offset: 26635},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "LastToken",
pos: position{line: 1154, col: 1, offset: 26680},
expr: &actionExpr{
pos: position{line: 1155, col: 4, offset: 26693},
run: (*parser).callonLastToken1,
expr: &seqExpr{
pos: position{line: 1155, col: 4, offset: 26693},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1155, col: 4, offset: 26693},
val: "last",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1155, col: 12, offset: 26701},
expr: &ruleRefExpr{
pos: position{line: 1155, col: 13, offset: 26702},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "FirstToken",
pos: position{line: 1158, col: 1, offset: 26747},
expr: &actionExpr{
pos: position{line: 1159, col: 4, offset: 26761},
run: (*parser).callonFirstToken1,
expr: &seqExpr{
pos: position{line: 1159, col: 4, offset: 26761},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1159, col: 4, offset: 26761},
val: "first",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1159, col: 13, offset: 26770},
expr: &ruleRefExpr{
pos: position{line: 1159, col: 14, offset: 26771},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "AndToken",
pos: position{line: 1162, col: 1, offset: 26816},
expr: &actionExpr{
pos: position{line: 1163, col: 4, offset: 26828},
run: (*parser).callonAndToken1,
expr: &seqExpr{
pos: position{line: 1163, col: 4, offset: 26828},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1163, col: 4, offset: 26828},
val: "and",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1163, col: 11, offset: 26835},
expr: &ruleRefExpr{
pos: position{line: 1163, col: 12, offset: 26836},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "OrToken",
pos: position{line: 1166, col: 1, offset: 26881},
expr: &actionExpr{
pos: position{line: 1167, col: 4, offset: 26892},
run: (*parser).callonOrToken1,
expr: &seqExpr{
pos: position{line: 1167, col: 4, offset: 26892},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1167, col: 4, offset: 26892},
val: "or",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1167, col: 10, offset: 26898},
expr: &ruleRefExpr{
pos: position{line: 1167, col: 11, offset: 26899},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "NotToken",
pos: position{line: 1170, col: 1, offset: 26944},
expr: &actionExpr{
pos: position{line: 1171, col: 4, offset: 26956},
run: (*parser).callonNotToken1,
expr: &seqExpr{
pos: position{line: 1171, col: 4, offset: 26956},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1171, col: 4, offset: 26956},
val: "not",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1171, col: 11, offset: 26963},
expr: &ruleRefExpr{
pos: position{line: 1171, col: 12, offset: 26964},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "InToken",
pos: position{line: 1174, col: 1, offset: 27009},
expr: &actionExpr{
pos: position{line: 1175, col: 4, offset: 27020},
run: (*parser).callonInToken1,
expr: &seqExpr{
pos: position{line: 1175, col: 4, offset: 27020},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1175, col: 4, offset: 27020},
val: "in",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1175, col: 10, offset: 27026},
expr: &ruleRefExpr{
pos: position{line: 1175, col: 11, offset: 27027},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "LikeToken",
pos: position{line: 1178, col: 1, offset: 27072},
expr: &actionExpr{
pos: position{line: 1179, col: 4, offset: 27085},
run: (*parser).callonLikeToken1,
expr: &seqExpr{
pos: position{line: 1179, col: 4, offset: 27085},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1179, col: 4, offset: 27085},
val: "like",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1179, col: 12, offset: 27093},
expr: &ruleRefExpr{
pos: position{line: 1179, col: 13, offset: 27094},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "EscapeToken",
pos: position{line: 1182, col: 1, offset: 27139},
expr: &actionExpr{
pos: position{line: 1183, col: 4, offset: 27154},
run: (*parser).callonEscapeToken1,
expr: &seqExpr{
pos: position{line: 1183, col: 4, offset: 27154},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1183, col: 4, offset: 27154},
val: "escape",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1183, col: 14, offset: 27164},
expr: &ruleRefExpr{
pos: position{line: 1183, col: 15, offset: 27165},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "AscToken",
pos: position{line: 1186, col: 1, offset: 27210},
expr: &actionExpr{
pos: position{line: 1187, col: 4, offset: 27222},
run: (*parser).callonAscToken1,
expr: &seqExpr{
pos: position{line: 1187, col: 4, offset: 27222},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1187, col: 4, offset: 27222},
val: "asc",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1187, col: 11, offset: 27229},
expr: &ruleRefExpr{
pos: position{line: 1187, col: 12, offset: 27230},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "DescToken",
pos: position{line: 1190, col: 1, offset: 27275},
expr: &actionExpr{
pos: position{line: 1191, col: 4, offset: 27288},
run: (*parser).callonDescToken1,
expr: &seqExpr{
pos: position{line: 1191, col: 4, offset: 27288},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1191, col: 4, offset: 27288},
val: "desc",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1191, col: 12, offset: 27296},
expr: &ruleRefExpr{
pos: position{line: 1191, col: 13, offset: 27297},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "CastToken",
pos: position{line: 1194, col: 1, offset: 27342},
expr: &actionExpr{
pos: position{line: 1195, col: 4, offset: 27355},
run: (*parser).callonCastToken1,
expr: &seqExpr{
pos: position{line: 1195, col: 4, offset: 27355},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1195, col: 4, offset: 27355},
val: "cast",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1195, col: 12, offset: 27363},
expr: &ruleRefExpr{
pos: position{line: 1195, col: 13, offset: 27364},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "AsToken",
pos: position{line: 1198, col: 1, offset: 27409},
expr: &actionExpr{
pos: position{line: 1199, col: 4, offset: 27420},
run: (*parser).callonAsToken1,
expr: &seqExpr{
pos: position{line: 1199, col: 4, offset: 27420},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1199, col: 4, offset: 27420},
val: "as",
ignoreCase: true,
},
¬Expr{
pos: position{line: 1199, col: 10, offset: 27426},
expr: &ruleRefExpr{
pos: position{line: 1199, col: 11, offset: 27427},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "SeparatorToken",
pos: position{line: 1202, col: 1, offset: 27472},
expr: &litMatcher{
pos: position{line: 1203, col: 4, offset: 27490},
val: ",",
ignoreCase: false,
},
},
{
name: "AnyToken",
pos: position{line: 1205, col: 1, offset: 27495},
expr: &litMatcher{
pos: position{line: 1206, col: 4, offset: 27507},
val: "*",
ignoreCase: false,
},
},
{
name: "Identifier",
pos: position{line: 1209, col: 1, offset: 27530},
expr: &choiceExpr{
pos: position{line: 1210, col: 4, offset: 27544},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1210, col: 4, offset: 27544},
name: "NormalIdentifier",
},
&ruleRefExpr{
pos: position{line: 1211, col: 4, offset: 27564},
name: "StringIdentifier",
},
},
},
},
{
name: "NormalIdentifier",
pos: position{line: 1213, col: 1, offset: 27582},
expr: &actionExpr{
pos: position{line: 1214, col: 4, offset: 27602},
run: (*parser).callonNormalIdentifier1,
expr: &seqExpr{
pos: position{line: 1214, col: 4, offset: 27602},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 1214, col: 4, offset: 27602},
name: "NormalIdentifierStart",
},
&zeroOrMoreExpr{
pos: position{line: 1214, col: 26, offset: 27624},
expr: &ruleRefExpr{
pos: position{line: 1214, col: 26, offset: 27624},
name: "NormalIdentifierRest",
},
},
},
},
},
},
{
name: "NormalIdentifierStart",
pos: position{line: 1223, col: 1, offset: 27811},
expr: &charClassMatcher{
pos: position{line: 1224, col: 4, offset: 27836},
val: "[a-zA-Z\\x80-\\xff]",
ranges: []rune{'a', 'z', 'A', 'Z', '\u0080', 'ÿ'},
ignoreCase: false,
inverted: false,
},
},
{
name: "NormalIdentifierRest",
pos: position{line: 1226, col: 1, offset: 27855},
expr: &charClassMatcher{
pos: position{line: 1227, col: 4, offset: 27879},
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: 1229, col: 1, offset: 27902},
expr: &actionExpr{
pos: position{line: 1230, col: 4, offset: 27922},
run: (*parser).callonStringIdentifier1,
expr: &seqExpr{
pos: position{line: 1230, col: 4, offset: 27922},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1230, col: 4, offset: 27922},
val: "\"",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1230, col: 9, offset: 27927},
label: "s",
expr: &zeroOrMoreExpr{
pos: position{line: 1230, col: 11, offset: 27929},
expr: &actionExpr{
pos: position{line: 1230, col: 13, offset: 27931},
run: (*parser).callonStringIdentifier6,
expr: &choiceExpr{
pos: position{line: 1230, col: 15, offset: 27933},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 1230, col: 15, offset: 27933},
val: "[^\"\\r\\n\\\\]",
chars: []rune{'"', '\r', '\n', '\\'},
ignoreCase: false,
inverted: true,
},
&seqExpr{
pos: position{line: 1230, col: 28, offset: 27946},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1230, col: 28, offset: 27946},
val: "\\",
ignoreCase: false,
},
&anyMatcher{
line: 1230, col: 33, offset: 27951,
},
},
},
},
},
},
},
},
&litMatcher{
pos: position{line: 1230, col: 63, offset: 27981},
val: "\"",
ignoreCase: false,
},
},
},
},
},
{
name: "_",
pos: position{line: 1255, col: 1, offset: 28566},
expr: &actionExpr{
pos: position{line: 1256, col: 4, offset: 28571},
run: (*parser).callon_1,
expr: &zeroOrMoreExpr{
pos: position{line: 1256, col: 4, offset: 28571},
expr: &ruleRefExpr{
pos: position{line: 1256, col: 4, offset: 28571},
name: "Whitespace",
},
},
},
},
{
name: "Whitespace",
pos: position{line: 1259, col: 1, offset: 28607},
expr: &choiceExpr{
pos: position{line: 1260, col: 4, offset: 28621},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 1260, col: 4, offset: 28621},
val: "\t",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1261, col: 4, offset: 28642},
val: "\n",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1262, col: 4, offset: 28663},
val: "\v",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1263, col: 4, offset: 28684},
val: "\f",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1264, col: 4, offset: 28705},
val: "\r",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1265, col: 4, offset: 28726},
val: " ",
ignoreCase: false,
},
},
},
},
{
name: "EOF",
pos: position{line: 1267, col: 1, offset: 28748},
expr: ¬Expr{
pos: position{line: 1268, col: 4, offset: 28755},
expr: &anyMatcher{
line: 1268, col: 5, offset: 28756,
},
},
},
},
}
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) onInteger1() (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: "Integer",
Message: fmt.Sprintf("cannot parse %s as decimal: %v", c.text, code),
}
return node, err
}
node.V = v
return node, nil
}
func (p *parser) callonInteger1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInteger1()
}
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) onDecimal1() (interface{}, error) {
node := &ast.DecimalValueNode{}
node.SetPosition(uint32(c.pos.offset))
node.SetLength(uint32(len(c.text)))
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),
}
return node, err
}
node.V = v
return node, nil
}
func (p *parser) callonDecimal1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDecimal1()
}
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
}