tree-sitter-plpgsql/src/grammar.json

6831 lines
156 KiB
JSON
Raw Normal View History

2021-08-21 20:15:42 +03:00
{
"name": "plpgsql",
"rules": {
"source_file": {
"type": "REPEAT",
"content": {
2021-08-28 13:46:32 +03:00
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "psql_statement"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_statement"
},
{
"type": "STRING",
"value": ";"
}
]
}
]
2021-08-21 20:15:42 +03:00
}
},
"_statement": {
2021-08-28 13:46:32 +03:00
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "psql_statement"
},
{
"type": "SYMBOL",
"name": "create_function_statement"
},
{
"type": "SYMBOL",
"name": "create_table_statement"
},
{
"type": "SYMBOL",
"name": "create_schema_statement"
},
{
"type": "SYMBOL",
"name": "select_statement"
},
{
"type": "SYMBOL",
"name": "insert_statement"
},
{
"type": "SYMBOL",
"name": "delete_statement"
},
{
"type": "SYMBOL",
"name": "grant_statement"
},
{
"type": "SYMBOL",
"name": "create_trigger_statement"
},
{
"type": "SYMBOL",
"name": "create_sequence_statement"
},
{
"type": "SYMBOL",
"name": "create_index_statement"
},
{
"type": "SYMBOL",
"name": "alter_table_statement"
},
{
"type": "SYMBOL",
"name": "do_block"
}
]
},
"_with_query_statement": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "select_statement"
},
{
"type": "SYMBOL",
"name": "insert_statement"
},
{
"type": "SYMBOL",
"name": "delete_statement"
}
]
},
"insert_statement": {
2021-08-21 20:15:42 +03:00
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
2021-08-28 13:46:32 +03:00
"name": "with_query"
},
{
"type": "BLANK"
2021-08-21 20:15:42 +03:00
}
]
},
{
2021-08-28 13:46:32 +03:00
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN][sS][eE][rR][tT]"
},
"named": false,
"value": "insert"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN][tT][oO]"
},
"named": false,
"value": "into"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "as"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_list_of_identifiers"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "insert_items"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "insert_conflict"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "insert_returning"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "into"
},
{
"type": "BLANK"
}
]
2021-08-21 20:15:42 +03:00
}
]
},
2021-08-28 13:46:32 +03:00
"insert_items": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][fF][aA][uU][lL][tT]"
},
"named": false,
"value": "default"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[vV][aA][lL][uU][eE][sS]"
},
"named": false,
"value": "values"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[vV][aA][lL][uU][eE][sS]"
},
"named": false,
"value": "values"
},
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "insert_item"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "insert_item"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
{
"type": "SYMBOL",
"name": "select_statement"
}
]
},
"insert_item": {
"type": "CHOICE",
2021-08-21 20:15:42 +03:00
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
2021-08-28 13:46:32 +03:00
"value": "[dD][eE][fF][aA][uU][lL][tT]"
2021-08-21 20:15:42 +03:00
},
"named": false,
2021-08-28 13:46:32 +03:00
"value": "default"
2021-08-21 20:15:42 +03:00
},
{
2021-08-28 13:46:32 +03:00
"type": "SYMBOL",
"name": "_value_expression"
}
]
},
"insert_conflict": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][nN]"
},
"named": false,
"value": "on"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][oO][nN][fF][lL][iI][cC][tT]"
},
"named": false,
"value": "conflict"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "conflict_target"
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][oO]"
},
"named": false,
"value": "do"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][oO][tT][hH][iI][nN][gG]"
},
"named": false,
"value": "nothing"
}
]
},
{
"type": "SEQ",
2021-08-21 20:15:42 +03:00
"members": [
2021-08-28 13:46:32 +03:00
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][nN]"
},
"named": false,
"value": "on"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][oO][nN][fF][lL][iI][cC][tT]"
},
"named": false,
"value": "conflict"
},
{
"type": "SYMBOL",
"name": "conflict_target"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][oO]"
},
"named": false,
"value": "do"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[uU][pP][dD][aA][tT][eE]"
},
"named": false,
"value": "update"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][tT]"
},
"named": false,
"value": "set"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "update_set"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "update_set"
}
]
}
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "where_filter"
},
{
"type": "BLANK"
}
]
}
]
}
]
},
"conflict_target": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][nN]"
},
"named": false,
"value": "on"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][oO][nN][sS][tT][rR][aA][iI][nN][tT]"
},
"named": false,
"value": "constraint"
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
}
]
},
"update_set": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "STRING",
"value": "="
},
{
"type": "SYMBOL",
"name": "update_value"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_list_of_identifiers"
},
{
"type": "STRING",
"value": "="
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][oO][wW]"
},
"named": false,
"value": "row"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "("
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "update_value"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "update_value"
}
]
}
}
]
},
{
"type": "STRING",
"value": ")"
}
]
}
]
},
"update_value": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][fF][aA][uU][lL][tT]"
},
"named": false,
"value": "default"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
},
"insert_returning": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][eE][tT][uU][rR][nN][iI][nN][gG]"
},
"named": false,
"value": "returning"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "select_item"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "select_item"
}
]
}
}
]
}
]
},
"create_table_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][rR][eE][aA][tT][eE]"
},
"named": false,
"value": "create"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "temporary"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[uU][nN][lL][oO][gG][gG][eE][dD]"
},
"named": false,
"value": "unlogged"
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][aA][bB][lL][eE]"
},
"named": false,
"value": "table"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "if_not_exists"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "create_table_item"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "create_table_item"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
"create_table_item": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "table_column_item"
},
{
"type": "SYMBOL",
"name": "table_constraint"
}
]
},
"create_schema_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][rR][eE][aA][tT][eE]"
},
"named": false,
"value": "create"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][cC][hH][eE][mM][aA]"
},
"named": false,
"value": "schema"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "if_not_exists"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "schema_role"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SYMBOL",
"name": "schema_role"
}
]
}
]
},
"schema_role": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][uU][tT][hH][oO][rR][iI][zZ][aA][tT][iI][oO][nN]"
},
"named": false,
"value": "authorization"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][uU][rR][rR][eE][nN][tT][__][uU][sS][eE][rR]"
},
"named": false,
"value": "current_user"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][sS][sS][iI][oO][nN][__][uU][sS][eE][rR]"
},
"named": false,
"value": "session_user"
}
]
}
]
},
"create_index_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][rR][eE][aA][tT][eE]"
},
"named": false,
"value": "create"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[uU][nN][iI][qQ][uU][eE]"
},
"named": false,
"value": "unique"
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN][dD][eE][xX]"
},
"named": false,
"value": "index"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][oO][nN][cC][uU][rR][rR][eE][nN][tT][lL][yY]"
},
"named": false,
"value": "concurrently"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "if_not_exists"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][nN]"
},
"named": false,
"value": "on"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "index_using"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "("
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "index_col"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "index_col"
}
]
}
}
]
},
{
"type": "STRING",
"value": ")"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "index_includes"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "where_filter"
},
{
"type": "BLANK"
}
]
}
]
},
"index_using": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[uU][sS][iI][nN][gG]"
},
"named": false,
"value": "using"
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
},
"index_col": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "index_col_dir"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "index_col_nulls"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "STRING",
"value": ")"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "index_col_dir"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "index_col_nulls"
},
{
"type": "BLANK"
}
]
}
]
}
]
},
"index_col_dir": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][sS][cC]"
},
"named": false,
"value": "asc"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][sS][cC]"
},
"named": false,
"value": "desc"
}
]
},
"index_col_nulls": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][uU][lL][lL][sS]"
},
"named": false,
"value": "nulls"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[fF][iI][rR][sS][tT]"
},
"named": false,
"value": "first"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][uU][lL][lL][sS]"
},
"named": false,
"value": "nulls"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[lL][aA][sS][tT]"
},
"named": false,
"value": "last"
}
]
}
]
},
"index_includes": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN][cC][lL][uU][dD][eE]"
},
"named": false,
"value": "include"
},
{
"type": "SYMBOL",
"name": "_list_of_identifiers"
}
]
},
"delete_statement": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "with_query"
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][lL][eE][tT][eE]"
},
"named": false,
"value": "delete"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[fF][rR][oO][mM]"
},
"named": false,
"value": "from"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][sS]"
},
"named": false,
"value": "as"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "delete_using"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "where_filter"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][eE][tT][uU][rR][nN][iI][nN][gG]"
},
"named": false,
"value": "returning"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "select_item"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "select_item"
}
]
}
}
]
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "into"
},
{
"type": "BLANK"
}
]
}
]
},
"delete_using": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[uU][sS][iI][nN][gG]"
},
"named": false,
"value": "using"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "from_item"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "from_item"
}
]
}
}
]
}
]
},
"alter_table_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][lL][tT][eE][rR]"
},
"named": false,
"value": "alter"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][aA][bB][lL][eE]"
},
"named": false,
"value": "table"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "if_exists"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "alter_table_change"
}
]
},
"alter_table_change": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "alter_table_action"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "alter_table_action"
}
]
}
}
]
},
{
"type": "SYMBOL",
"name": "alter_table_rename_column"
},
{
"type": "SYMBOL",
"name": "alter_table_rename_constraint"
},
{
"type": "SYMBOL",
"name": "alter_table_rename_table"
},
{
"type": "SYMBOL",
"name": "alter_table_change_schema"
}
]
},
"alter_table_action": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][dD][dD]"
},
"named": false,
"value": "add"
},
{
"type": "SYMBOL",
"name": "table_constraint"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][dD][dD]"
},
"named": false,
"value": "add"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][oO][lL][uU][mM][nN]"
},
"named": false,
"value": "column"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "if_not_exists"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "table_column_item"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][rR][oO][pP]"
},
"named": false,
"value": "drop"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][oO][nN][sS][tT][rR][aA][iI][nN][tT]"
},
"named": false,
"value": "constraint"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "if_exists"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "alter_table_fk_ref_action"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][rR][oO][pP]"
},
"named": false,
"value": "drop"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][oO][lL][uU][mM][nN]"
},
"named": false,
"value": "column"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "if_exists"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "alter_table_fk_ref_action"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][lL][tT][eE][rR]"
},
"named": false,
"value": "alter"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][oO][lL][uU][mM][nN]"
},
"named": false,
"value": "column"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "alter_column_action"
},
{
"type": "BLANK"
}
]
}
]
}
]
},
"alter_column_action": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][tT]"
},
"named": false,
"value": "set"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][fF][aA][uU][lL][tT]"
},
"named": false,
"value": "default"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][rR][oO][pP]"
},
"named": false,
"value": "drop"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][fF][aA][uU][lL][tT]"
},
"named": false,
"value": "default"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][tT]"
},
"named": false,
"value": "set"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][oO][tT]"
},
"named": false,
"value": "not"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][uU][lL][lL]"
},
"named": false,
"value": "null"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][rR][oO][pP]"
},
"named": false,
"value": "drop"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][oO][tT]"
},
"named": false,
"value": "not"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][uU][lL][lL]"
},
"named": false,
"value": "null"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][yY][pP][eE]"
},
"named": false,
"value": "type"
},
{
"type": "SYMBOL",
"name": "alter_column_type"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][tT]"
},
"named": false,
"value": "set"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][aA][tT][aA]"
},
"named": false,
"value": "data"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][yY][pP][eE]"
},
"named": false,
"value": "type"
},
{
"type": "SYMBOL",
"name": "alter_column_type"
}
]
}
]
},
"table_constraint": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "table_constraint_ty"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "constraint_when"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][oO][nN][sS][tT][rR][aA][iI][nN][tT]"
},
"named": false,
"value": "constraint"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "table_constraint_ty"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "constraint_when"
},
{
"type": "BLANK"
}
]
}
]
}
]
},
"constraint_when": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][fF][eE][rR][rR][aA][bB][lL][eE]"
},
"named": false,
"value": "deferrable"
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][fF][eE][rR][rR][aA][bB][lL][eE]"
},
"named": false,
"value": "deferrable"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN][iI][tT][iI][aA][lL][lL][yY]"
},
"named": false,
"value": "initially"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][mM][mM][eE][dD][iI][aA][tT][eE]"
},
"named": false,
"value": "immediate"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][fF][eE][rR][rR][aA][bB][lL][eE]"
},
"named": false,
"value": "deferrable"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN][iI][tT][iI][aA][lL][lL][yY]"
},
"named": false,
"value": "initially"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][fF][eE][rR][rR][eE][dD]"
},
"named": false,
"value": "deferred"
}
]
}
]
},
"table_constraint_ty": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][hH][eE][cC][kK]"
},
"named": false,
"value": "check"
},
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "STRING",
"value": ")"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[uU][nN][iI][qQ][uU][eE]"
},
"named": false,
"value": "unique"
},
{
"type": "SYMBOL",
"name": "_list_of_identifiers"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[pP][rR][iI][mM][aA][rR][yY]"
},
"named": false,
"value": "primary"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[kK][eE][yY]"
},
"named": false,
"value": "key"
},
{
"type": "SYMBOL",
"name": "_list_of_identifiers"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[fF][oO][rR][eE][iI][gG][nN]"
},
"named": false,
"value": "foreign"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[kK][eE][yY]"
},
"named": false,
"value": "key"
},
{
"type": "SYMBOL",
"name": "_list_of_identifiers"
},
{
"type": "SYMBOL",
"name": "constraint_foreign_key"
}
]
}
]
},
"constraint_foreign_key": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][eE][fF][eE][rR][eE][nN][cC][eE][sS]"
},
"named": false,
"value": "references"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_list_of_identifiers"
},
{
"type": "BLANK"
}
]
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "fk_action"
}
}
]
},
"fk_action": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][nN]"
},
"named": false,
"value": "on"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][lL][eE][tT][eE]"
},
"named": false,
"value": "delete"
},
{
"type": "SYMBOL",
"name": "fk_ref_action"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][nN]"
},
"named": false,
"value": "on"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[uU][pP][dD][aA][tT][eE]"
},
"named": false,
"value": "update"
},
{
"type": "SYMBOL",
"name": "fk_ref_action"
}
]
}
]
},
"fk_ref_action": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][oO]"
},
"named": false,
"value": "no"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][cC][tT][iI][oO][nN]"
},
"named": false,
"value": "action"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][eE][sS][tT][rR][iI][cC][tT]"
},
"named": false,
"value": "restrict"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][aA][sS][cC][aA][dD][eE]"
},
"named": false,
"value": "cascade"
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][tT]"
},
"named": false,
"value": "set"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][uU][lL][lL]"
},
"named": false,
"value": "null"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][tT]"
},
"named": false,
"value": "set"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][fF][aA][uU][lL][tT]"
},
"named": false,
"value": "default"
}
]
}
]
},
"alter_column_type": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_type"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[uU][sS][iI][nN][gG]"
},
"named": false,
"value": "using"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"alter_table_fk_ref_action": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][eE][sS][tT][rR][iI][cC][tT]"
},
"named": false,
"value": "restrict"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][aA][sS][cC][aA][dD][eE]"
},
"named": false,
"value": "cascade"
}
]
},
"table_column_item": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "_type"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "column_constraint"
}
}
]
},
"column_constraint": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][oO][nN][sS][tT][rR][aA][iI][nN][tT]"
},
"named": false,
"value": "constraint"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "column_constraint_ty"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "constraint_when"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "column_constraint_ty"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "constraint_when"
},
{
"type": "BLANK"
}
]
}
]
}
]
},
"column_constraint_ty": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][oO][tT]"
},
"named": false,
"value": "not"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][uU][lL][lL]"
},
"named": false,
"value": "null"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][uU][lL][lL]"
},
"named": false,
"value": "null"
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][hH][eE][cC][kK]"
},
"named": false,
"value": "check"
},
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "STRING",
"value": ")"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][fF][aA][uU][lL][tT]"
},
"named": false,
"value": "default"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[uU][nN][iI][qQ][uU][eE]"
},
"named": false,
"value": "unique"
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[pP][rR][iI][mM][aA][rR][yY]"
},
"named": false,
"value": "primary"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[kK][eE][yY]"
},
"named": false,
"value": "key"
}
]
},
{
"type": "SYMBOL",
"name": "constraint_foreign_key"
}
]
},
"alter_table_rename_column": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][eE][nN][aA][mM][eE]"
},
"named": false,
"value": "rename"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][oO][lL][uU][mM][nN]"
},
"named": false,
"value": "column"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][oO]"
},
"named": false,
"value": "to"
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
},
"alter_table_rename_constraint": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][eE][nN][aA][mM][eE]"
},
"named": false,
"value": "rename"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][oO][nN][sS][tT][rR][aA][iI][nN][tT]"
},
"named": false,
"value": "constraint"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][oO]"
},
"named": false,
"value": "to"
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
},
"alter_table_rename_table": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][eE][nN][aA][mM][eE]"
},
"named": false,
"value": "rename"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][oO]"
},
"named": false,
"value": "to"
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
},
"alter_table_change_schema": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][tT]"
},
"named": false,
"value": "set"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][cC][hH][eE][mM][aA]"
},
"named": false,
"value": "schema"
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
},
"grant_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[gG][rR][aA][nN][tT]"
},
"named": false,
"value": "grant"
},
{
"type": "SYMBOL",
"name": "grant_privileges"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][nN]"
},
"named": false,
"value": "on"
},
{
"type": "SYMBOL",
"name": "grant_targets"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][oO]"
},
"named": false,
"value": "to"
},
{
"type": "SYMBOL",
"name": "grant_roles"
}
]
},
"grant_roles": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[pP][uU][bB][lL][iI][cC]"
},
"named": false,
"value": "public"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][uU][rR][rR][eE][nN][tT][__][uU][sS][eE][rR]"
},
"named": false,
"value": "current_user"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][sS][sS][iI][oO][nN][__][uU][sS][eE][rR]"
},
"named": false,
"value": "session_user"
},
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[gG][rR][oO][uU][pP]"
},
"named": false,
"value": "group"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
}
]
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[pP][uU][bB][lL][iI][cC]"
},
"named": false,
"value": "public"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][uU][rR][rR][eE][nN][tT][__][uU][sS][eE][rR]"
},
"named": false,
"value": "current_user"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][sS][sS][iI][oO][nN][__][uU][sS][eE][rR]"
},
"named": false,
"value": "session_user"
},
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[gG][rR][oO][uU][pP]"
},
"named": false,
"value": "group"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
}
]
}
]
}
}
]
},
"grant_privileges": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][lL][lL]"
},
"named": false,
"value": "all"
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "privileges"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
}
}
]
}
]
},
"grant_targets": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][lL][lL]"
},
"named": false,
"value": "all"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][aA][bB][lL][eE][sS]"
},
"named": false,
"value": "tables"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][qQ][uU][eE][nN][cC][eE][sS]"
},
"named": false,
"value": "sequences"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[fF][uU][nN][cC][tT][iI][oO][nN][sS]"
},
"named": false,
"value": "functions"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN]"
},
"named": false,
"value": "in"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][cC][hH][eE][mM][aA]"
},
"named": false,
"value": "schema"
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][qQ][uU][eE][nN][cC][eE]"
},
"named": false,
"value": "sequence"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
}
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][aA][bB][lL][eE]"
},
"named": false,
"value": "table"
},
{
"type": "BLANK"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
}
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][cC][hH][eE][mM][aA]"
},
"named": false,
"value": "schema"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
}
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[fF][uU][nN][cC][tT][iI][oO][nN]"
},
"named": false,
"value": "function"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[pP][rR][oO][cC][eE][dD][uU][rR][eE]"
},
"named": false,
"value": "procedure"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][oO][uU][tT][iI][nN][eE]"
},
"named": false,
"value": "routine"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "grant_function"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "grant_function"
}
]
}
}
]
}
]
}
]
},
"grant_function": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "STRING",
"value": "("
},
{
"type": "SEQ",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "_type"
}
]
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "_type"
}
]
}
]
}
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
"grant_all_in_schema": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN]"
},
"named": false,
"value": "in"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][cC][hH][eE][mM][aA]"
},
"named": false,
"value": "schema"
}
]
},
"psql_statement": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "\\"
},
{
"type": "REPEAT1",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "PATTERN",
"value": "[\\n\\r]"
}
]
},
"create_sequence_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][rR][eE][aA][tT][eE]"
},
"named": false,
"value": "create"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "temporary"
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][qQ][uU][eE][nN][cC][eE]"
},
"named": false,
"value": "sequence"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "if_not_exists"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "as"
},
{
"type": "SYMBOL",
"name": "sequence_increment"
},
{
"type": "SYMBOL",
"name": "sequence_min"
},
{
"type": "SYMBOL",
"name": "sequence_max"
},
{
"type": "SYMBOL",
"name": "sequence_start"
},
{
"type": "SYMBOL",
"name": "sequence_cache"
},
{
"type": "SYMBOL",
"name": "sequence_cycle"
},
{
"type": "SYMBOL",
"name": "sequence_owned"
}
]
}
}
]
},
"sequence_increment": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN][cC][rR][eE][mM][eE][nN][tT]"
},
"named": false,
"value": "increment"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[bB][yY]"
},
"named": false,
"value": "by"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "number"
}
]
},
"sequence_min": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][oO]"
},
"named": false,
"value": "no"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[mM][iI][nN][vV][aA][lL][uU][eE]"
},
"named": false,
"value": "minvalue"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[mM][iI][nN][vV][aA][lL][uU][eE]"
},
"named": false,
"value": "minvalue"
},
{
"type": "SYMBOL",
"name": "number"
}
]
}
]
},
"sequence_max": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][oO]"
},
"named": false,
"value": "no"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[mM][aA][xX][vV][aA][lL][uU][eE]"
},
"named": false,
"value": "maxvalue"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[mM][aA][xX][vV][aA][lL][uU][eE]"
},
"named": false,
"value": "maxvalue"
},
{
"type": "SYMBOL",
"name": "number"
}
]
}
]
},
"sequence_start": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][tT][aA][rR][tT]"
},
"named": false,
"value": "start"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[wW][iI][tT][hH]"
},
"named": false,
"value": "with"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "number"
}
]
},
"sequence_cache": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][aA][cC][hH][eE]"
},
"named": false,
"value": "cache"
},
{
"type": "SYMBOL",
"name": "number"
}
]
},
"sequence_cycle": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][oO]"
},
"named": false,
"value": "no"
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][yY][cC][lL][eE]"
},
"named": false,
"value": "cycle"
}
]
},
"sequence_owned": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][wW][nN][eE][dD]"
},
"named": false,
"value": "owned"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[bB][yY]"
},
"named": false,
"value": "by"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][oO][nN][eE]"
},
"named": false,
"value": "none"
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
}
]
},
"create_trigger_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][rR][eE][aA][tT][eE]"
},
"named": false,
"value": "create"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][oO][nN][sS][tT][rR][aA][iI][nN][tT]"
},
"named": false,
"value": "constraint"
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][rR][iI][gG][gG][eE][rR]"
},
"named": false,
"value": "trigger"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "trigger_when"
},
{
"type": "SYMBOL",
"name": "trigger_event"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][nN]"
},
"named": false,
"value": "on"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "trigger_scope"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "trigger_cond"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "trigger_exec"
}
]
},
"trigger_when": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[bB][eE][fF][oO][rR][eE]"
},
"named": false,
"value": "before"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][fF][tT][eE][rR]"
},
"named": false,
"value": "after"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN][sS][tT][eE][aA][dD][ ][oO][fF]"
},
"named": false,
"value": "instead of"
}
]
},
"trigger_event": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN][sS][eE][rR][tT]"
},
"named": false,
"value": "insert"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[uU][pP][dD][aA][tT][eE]"
},
"named": false,
"value": "update"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][lL][eE][tT][eE]"
},
"named": false,
"value": "delete"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][rR][uU][nN][cC][aA][tT][eE]"
},
"named": false,
"value": "truncate"
}
]
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][rR]"
},
"named": false,
"value": "or"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN][sS][eE][rR][tT]"
},
"named": false,
"value": "insert"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[uU][pP][dD][aA][tT][eE]"
},
"named": false,
"value": "update"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][lL][eE][tT][eE]"
},
"named": false,
"value": "delete"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][rR][uU][nN][cC][aA][tT][eE]"
},
"named": false,
"value": "truncate"
}
]
}
]
}
}
]
},
"trigger_scope": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[fF][oO][rR]"
},
"named": false,
"value": "for"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[eE][aA][cC][hH]"
},
"named": false,
"value": "each"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][tT][aA][tT][eE][mM][eE][nN][tT]"
},
"named": false,
"value": "statement"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][oO][wW]"
},
"named": false,
"value": "row"
}
]
}
]
},
"trigger_exec": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[eE][xX][eE][cC][uU][tT][eE]"
},
"named": false,
"value": "execute"
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[pP][rR][oO][cC][eE][dD][uU][rR][eE]"
},
"named": false,
"value": "procedure"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[fF][uU][nN][cC][tT][iI][oO][nN]"
},
"named": false,
"value": "function"
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "function_call"
}
]
},
"trigger_cond": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[wW][hH][eE][nN]"
},
"named": false,
"value": "when"
},
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "STRING",
"value": ")"
}
]
},
"_plpgsql_statement": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_statement"
},
{
"type": "SYMBOL",
"name": "assign_statement"
},
{
"type": "SYMBOL",
"name": "return_statement"
},
{
"type": "SYMBOL",
"name": "execute_statement"
},
{
"type": "SYMBOL",
"name": "perform_statement"
}
]
},
{
"type": "STRING",
"value": ";"
}
]
},
"execute_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[eE][xX][eE][cC][uU][tT][eE]"
},
"named": false,
"value": "execute"
},
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "into"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[uU][sS][iI][nN][gG]"
},
"named": false,
"value": "using"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
}
]
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"assign_statement": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "STRING",
"value": "="
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
},
"return_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][eE][tT][uU][rR][nN]"
},
"named": false,
"value": "return"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[qQ][uU][eE][rR][yY]"
},
"named": false,
"value": "query"
},
{
"type": "SYMBOL",
"name": "select_statement"
}
]
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
]
},
"perform_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[pP][eE][rR][fF][oO][rR][mM]"
},
"named": false,
"value": "perform"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "select_item"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "select_item"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"do_block": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][oO]"
},
"named": false,
"value": "do"
},
{
"type": "SYMBOL",
"name": "block"
}
]
},
"select_statement": {
"type": "PREC_LEFT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "with_query"
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][lL][eE][cC][tT]"
},
"named": false,
"value": "select"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "select_item"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "select_item"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "into"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "select_from"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "select_where"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "select_group_by"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "select_having"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "select_order_by"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "select_limit"
},
{
"type": "BLANK"
}
]
}
]
}
},
"with_query": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[wW][iI][tT][hH]"
},
"named": false,
"value": "with"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "with_query_item"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "with_query_item"
}
]
}
}
]
}
]
},
"with_query_item": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][sS]"
},
"named": false,
"value": "as"
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[mM][aA][tT][eE][rR][iI][aA][lL][iI][zZ][eE][dD]"
},
"named": false,
"value": "materialized"
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][oO][tT]"
},
"named": false,
"value": "not"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[mM][aA][tT][eE][rR][iI][aA][lL][iI][zZ][eE][dD]"
},
"named": false,
"value": "materialized"
}
]
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "_with_query_statement"
},
{
"type": "STRING",
"value": ")"
}
]
},
"into": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN][tT][oO]"
},
"named": false,
"value": "into"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][tT][rR][iI][cC][tT]"
},
"named": false,
"value": "strict"
},
{
"type": "BLANK"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
}
}
]
}
]
},
"select_having": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[hH][aA][vV][iI][nN][gG]"
},
"named": false,
"value": "having"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
},
"select_limit": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[lL][iI][mM][iI][tT]"
},
"named": false,
"value": "limit"
},
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][fF][fF][sS][eE][tT]"
},
"named": false,
"value": "offset"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[lL][iI][mM][iI][tT]"
},
"named": false,
"value": "limit"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][lL][lL]"
},
"named": false,
"value": "all"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][fF][fF][sS][eE][tT]"
},
"named": false,
"value": "offset"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][fF][fF][sS][eE][tT]"
},
"named": false,
"value": "offset"
},
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[lL][iI][mM][iI][tT]"
},
"named": false,
"value": "limit"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][lL][lL]"
},
"named": false,
"value": "all"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][fF][fF][sS][eE][tT]"
},
"named": false,
"value": "offset"
},
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[lL][iI][mM][iI][tT]"
},
"named": false,
"value": "limit"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
]
},
"select_group_by": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[gG][rR][oO][uU][pP]"
},
"named": false,
"value": "group"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[bB][yY]"
},
"named": false,
"value": "by"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
}
]
}
]
},
"select_order_by": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][rR][dD][eE][rR]"
},
"named": false,
"value": "order"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[bB][yY]"
},
"named": false,
"value": "by"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "order_by_item"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "order_by_item"
}
]
}
}
]
}
]
},
"order_by_item": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "order_by_direction"
},
{
"type": "BLANK"
}
]
}
]
},
"order_by_direction": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][sS][cC]"
},
"named": false,
"value": "asc"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][sS][cC]"
},
"named": false,
"value": "desc"
}
]
},
"select_where": {
"type": "SYMBOL",
"name": "where_filter"
},
"select_item": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][sS]"
},
"named": false,
"value": "as"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "BLANK"
}
]
}
]
},
"select_from": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[fF][rR][oO][mM]"
},
"named": false,
"value": "from"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "from_item"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "from_item"
}
]
}
}
]
}
]
},
"from_item": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "from_select"
},
{
"type": "SYMBOL",
"name": "from_table"
},
{
"type": "SYMBOL",
"name": "from_function"
}
]
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "join_item"
}
}
]
},
"from_select": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "select_statement"
},
{
"type": "STRING",
"value": ")"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][sS]"
},
"named": false,
"value": "as"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
},
"from_table": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][sS]"
},
"named": false,
"value": "as"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "BLANK"
}
]
}
]
},
"from_function": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "function_call"
},
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][sS]"
},
"named": false,
"value": "as"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_list_of_identifiers"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_list_of_identifiers"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][sS]"
},
"named": false,
"value": "as"
},
{
"type": "SYMBOL",
"name": "_list_of_identifiers"
}
]
}
]
},
{
"type": "BLANK"
}
]
}
]
},
"join_item": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][aA][tT][uU][rR][aA][lL]"
},
"named": false,
"value": "natural"
},
{
"type": "SYMBOL",
"name": "join_type"
},
{
"type": "SYMBOL",
"name": "from_table"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "join_type"
},
{
"type": "SYMBOL",
"name": "from_table"
},
{
"type": "SYMBOL",
"name": "join_condition"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][rR][oO][sS][sS]"
},
"named": false,
"value": "cross"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[jJ][oO][iI][nN]"
},
"named": false,
"value": "join"
},
{
"type": "SYMBOL",
"name": "from_table"
}
]
}
]
},
"join_condition": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][nN]"
},
"named": false,
"value": "on"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[uU][sS][iI][nN][gG]"
},
"named": false,
"value": "using"
},
{
"type": "SYMBOL",
"name": "_list_of_identifiers"
}
]
}
]
},
"join_type": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][nN][nN][eE][rR]"
},
"named": false,
"value": "inner"
},
{
"type": "BLANK"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[lL][eE][fF][tT]"
},
"named": false,
"value": "left"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][uU][tT][eE][rR]"
},
"named": false,
"value": "outer"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][iI][gG][hH][tT]"
},
"named": false,
"value": "right"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][uU][tT][eE][rR]"
},
"named": false,
"value": "outer"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[fF][uU][lL][lL]"
},
"named": false,
"value": "full"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][uU][tT][eE][rR]"
},
"named": false,
"value": "outer"
},
{
"type": "BLANK"
}
]
}
]
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[jJ][oO][iI][nN]"
},
"named": false,
"value": "join"
}
]
},
"create_function_statement": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[cC][rR][eE][aA][tT][eE]"
},
"named": false,
"value": "create"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "or_replace"
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[fF][uU][nN][cC][tT][iI][oO][nN]"
},
"named": false,
"value": "function"
},
{
"type": "SYMBOL",
"name": "function_signature"
},
{
"type": "SYMBOL",
"name": "function_return"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][sS]"
},
"named": false,
"value": "as"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "block"
},
{
"type": "SYMBOL",
"name": "string"
}
]
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[lL][aA][nN][gG][uU][aA][gG][eE]"
},
"named": false,
"value": "language"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "string"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "function_volatility"
},
{
"type": "BLANK"
}
]
}
]
},
"function_return": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][eE][tT][uU][rR][nN][sS]"
},
"named": false,
"value": "returns"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "return_setof"
},
{
"type": "SYMBOL",
"name": "return_table"
}
]
}
]
},
"return_setof": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][eE][tT][oO][fF]"
},
"named": false,
"value": "setof"
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
},
"return_table": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][aA][bB][lL][eE]"
},
"named": false,
"value": "table"
},
{
"type": "STRING",
"value": "("
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "var_declaration"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "var_declaration"
}
]
}
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
"function_volatility": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][mM][mM][uU][tT][aA][bB][lL][eE]"
},
"named": false,
"value": "immutable"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[sS][tT][aA][bB][lL][eE]"
},
"named": false,
"value": "stable"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[vV][oO][lL][aA][tT][iI][lL][eE]"
},
"named": false,
"value": "volatile"
}
]
},
"block": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "dollar_quote"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "declarations"
}
},
{
"type": "SYMBOL",
"name": "body"
},
{
"type": "SYMBOL",
"name": "dollar_quote"
}
]
},
"body": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[bB][eE][gG][iI][nN]"
},
"named": false,
"value": "begin"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_plpgsql_statement"
}
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[eE][nN][dD]"
},
"named": false,
"value": "end"
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ";"
},
{
"type": "BLANK"
}
]
}
]
},
"dollar_quote": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "$"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": "$"
}
]
},
"declarations": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][cC][lL][aA][rR][eE]"
},
"named": false,
"value": "declare"
},
{
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "var_definition"
}
}
]
},
"var_definition": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "var_declaration"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ":="
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ";"
}
]
},
"function_signature": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SYMBOL",
"name": "function_parameters"
}
]
},
"function_parameters": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "var_declaration"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "var_declaration"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[dD][eE][fF][aA][uU][lL][tT]"
},
"named": false,
"value": "default"
},
{
"type": "FIELD",
"name": "default_value",
"content": {
"type": "SYMBOL",
"name": "_value_expression"
}
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
"var_declaration": {
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "name",
"content": {
"type": "SYMBOL",
"name": "identifier"
}
},
{
"type": "FIELD",
"name": "type",
"content": {
"type": "SYMBOL",
"name": "_type"
}
}
]
},
"where_filter": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[wW][hH][eE][rR][eE]"
},
"named": false,
"value": "where"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
},
"or_replace": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][rR]"
},
"named": false,
"value": "or"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[rR][eE][pP][lL][aA][cC][eE]"
},
"named": false,
"value": "replace"
}
]
},
"temporary": {
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][eE][mM][pP]"
},
"named": false,
"value": "temp"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][eE][mM][pP][oO][rR][aA][rR][yY]"
},
"named": false,
"value": "temporary"
}
]
},
"if_not_exists": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][fF]"
},
"named": false,
"value": "if"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][oO][tT]"
},
"named": false,
"value": "not"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[eE][xX][iI][sS][tT][sS]"
},
"named": false,
"value": "exists"
}
]
},
"if_exists": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[iI][fF]"
},
"named": false,
"value": "if"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[eE][xX][iI][sS][tT][sS]"
},
"named": false,
"value": "exists"
}
]
},
"as": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][sS]"
},
"named": false,
"value": "as"
},
{
"type": "SYMBOL",
"name": "identifier"
}
]
},
"_type": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "predefined_types"
},
{
"type": "SYMBOL",
"name": "identifier"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_type"
},
{
"type": "STRING",
"value": "["
},
{
"type": "STRING",
"value": "]"
}
]
}
]
},
"predefined_types": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][uU][mM][eE][rR][iI][cC]"
},
"named": false,
"value": "numeric"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "precision"
},
{
"type": "BLANK"
}
]
}
]
}
]
},
"precision": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "SYMBOL",
"name": "number"
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "number"
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
"string": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "'"
},
{
"type": "REPEAT",
"content": {
"type": "CHOICE",
"members": [
{
"type": "PREC",
"value": 1,
"content": {
"type": "PATTERN",
"value": "''"
}
},
{
"type": "PREC",
"value": 2,
"content": {
"type": "PATTERN",
"value": "[^']"
}
}
]
}
},
{
"type": "STRING",
"value": "'"
}
]
},
"comment": {
"type": "TOKEN",
"content": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "--"
},
{
"type": "PATTERN",
"value": ".*"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "/*"
},
{
"type": "PATTERN",
"value": "[^*]*\\*+([^/*][^*]*\\*+)*"
},
{
"type": "STRING",
"value": "/"
}
]
}
]
}
},
"_value_expression": {
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "string"
},
{
"type": "SYMBOL",
"name": "number"
},
{
"type": "SYMBOL",
"name": "true"
},
{
"type": "SYMBOL",
"name": "false"
},
{
"type": "SYMBOL",
"name": "null"
},
{
"type": "SYMBOL",
"name": "star"
},
{
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
2021-08-21 20:15:42 +03:00
{
"type": "SYMBOL",
2021-08-28 13:46:32 +03:00
"name": "select_statement"
2021-08-21 20:15:42 +03:00
},
{
2021-08-28 13:46:32 +03:00
"type": "STRING",
"value": ")"
2021-08-21 20:15:42 +03:00
}
]
},
{
2021-08-28 13:46:32 +03:00
"type": "SEQ",
2021-08-21 20:15:42 +03:00
"members": [
{
2021-08-28 13:46:32 +03:00
"type": "STRING",
"value": "("
2021-08-21 20:15:42 +03:00
},
{
2021-08-28 13:46:32 +03:00
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "STRING",
"value": ")"
2021-08-21 20:15:42 +03:00
}
]
},
{
2021-08-28 13:46:32 +03:00
"type": "SYMBOL",
"name": "function_call"
2021-08-21 20:15:42 +03:00
},
{
"type": "SYMBOL",
2021-08-28 13:46:32 +03:00
"name": "op_expression"
2021-08-21 20:15:42 +03:00
},
{
2021-08-28 13:46:32 +03:00
"type": "SYMBOL",
"name": "time_expression"
2021-08-21 20:15:42 +03:00
},
{
"type": "SYMBOL",
"name": "identifier"
2021-08-28 13:46:32 +03:00
}
]
},
"time_expression": {
"type": "CHOICE",
"members": [
2021-08-21 20:15:42 +03:00
{
2021-08-28 13:46:32 +03:00
"type": "SEQ",
2021-08-21 20:15:42 +03:00
"members": [
{
"type": "SYMBOL",
2021-08-28 13:46:32 +03:00
"name": "identifier"
2021-08-21 20:15:42 +03:00
},
{
2021-08-28 13:46:32 +03:00
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][tT]"
},
"named": false,
"value": "at"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][iI][mM][eE]"
},
"named": false,
"value": "time"
},
{
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[zZ][oO][nN][eE]"
},
"named": false,
"value": "zone"
},
{
"type": "SYMBOL",
"name": "_value_expression"
2021-08-21 20:15:42 +03:00
}
]
}
]
},
2021-08-28 13:46:32 +03:00
"function_call": {
2021-08-21 20:15:42 +03:00
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
2021-08-28 13:46:32 +03:00
"name": "identifier"
2021-08-21 20:15:42 +03:00
},
{
"type": "STRING",
2021-08-28 13:46:32 +03:00
"value": "("
2021-08-21 20:15:42 +03:00
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
2021-08-28 13:46:32 +03:00
"name": "select_statement"
2021-08-21 20:15:42 +03:00
},
{
2021-08-28 13:46:32 +03:00
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
}
]
},
{
"type": "BLANK"
}
]
2021-08-21 20:15:42 +03:00
}
]
},
{
"type": "STRING",
2021-08-28 13:46:32 +03:00
"value": ")"
2021-08-21 20:15:42 +03:00
}
]
},
2021-08-28 13:46:32 +03:00
"op_expression": {
"type": "CHOICE",
2021-08-21 20:15:42 +03:00
"members": [
{
2021-08-28 13:46:32 +03:00
"type": "PREC_LEFT",
"value": 12,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "SYMBOL",
"name": "cast"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
2021-08-21 20:15:42 +03:00
},
{
2021-08-28 13:46:32 +03:00
"type": "PREC_RIGHT",
"value": 10,
"content": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "minus"
},
{
"type": "SYMBOL",
"name": "plus"
}
]
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
},
{
"type": "PREC_LEFT",
"value": 8,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "*"
},
{
"type": "STRING",
"value": "/"
},
{
"type": "STRING",
"value": "%"
}
]
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
},
{
"type": "PREC_LEFT",
"value": 7,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "-"
},
{
"type": "STRING",
"value": "+"
}
]
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
},
{
"type": "PREC_LEFT",
"value": 6,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "SYMBOL",
"name": "other_op"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
},
{
"type": "PREC_LEFT",
"value": 4,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "SYMBOL",
"name": "comparison_op"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
},
{
"type": "PREC_RIGHT",
"value": 2,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "not"
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
},
{
"type": "PREC_LEFT",
"value": 1,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_value_expression"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "and"
},
{
"type": "SYMBOL",
"name": "or"
}
]
},
{
"type": "SYMBOL",
"name": "_value_expression"
}
]
}
2021-08-21 20:15:42 +03:00
}
]
},
2021-08-28 13:46:32 +03:00
"_list_of_identifiers": {
2021-08-21 20:15:42 +03:00
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
2021-08-28 13:46:32 +03:00
"name": "identifier"
2021-08-21 20:15:42 +03:00
},
{
2021-08-28 13:46:32 +03:00
"type": "REPEAT",
2021-08-21 20:15:42 +03:00
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
2021-08-28 13:46:32 +03:00
"name": "identifier"
2021-08-21 20:15:42 +03:00
}
]
}
}
]
2021-08-28 13:46:32 +03:00
},
{
"type": "BLANK"
2021-08-21 20:15:42 +03:00
}
]
},
{
"type": "STRING",
"value": ")"
}
]
},
2021-08-28 13:46:32 +03:00
"comparison_op": {
"type": "CHOICE",
2021-08-21 20:15:42 +03:00
"members": [
{
2021-08-28 13:46:32 +03:00
"type": "STRING",
"value": "<"
2021-08-21 20:15:42 +03:00
},
{
2021-08-28 13:46:32 +03:00
"type": "STRING",
"value": ">"
},
{
"type": "STRING",
"value": "="
},
{
"type": "STRING",
"value": "<="
},
{
"type": "STRING",
"value": ">="
},
2021-08-21 20:15:42 +03:00
{
"type": "STRING",
2021-08-28 13:46:32 +03:00
"value": "<>"
2021-08-21 20:15:42 +03:00
},
{
"type": "STRING",
2021-08-28 13:46:32 +03:00
"value": "!="
2021-08-21 20:15:42 +03:00
}
]
},
2021-08-28 13:46:32 +03:00
"other_op": {
2021-08-21 20:15:42 +03:00
"type": "CHOICE",
"members": [
{
2021-08-28 13:46:32 +03:00
"type": "STRING",
"value": "||"
2021-08-21 20:15:42 +03:00
}
]
},
2021-08-28 13:46:32 +03:00
"cast": {
"type": "STRING",
"value": "::"
},
"minus": {
"type": "STRING",
"value": "-"
},
"plus": {
"type": "STRING",
"value": "+"
},
"not": {
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][oO][tT]"
},
"named": false,
"value": "not"
},
"and": {
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[aA][nN][dD]"
},
"named": false,
"value": "and"
},
"or": {
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[oO][rR]"
},
"named": false,
"value": "or"
},
"true": {
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[tT][rR][uU][eE]"
},
"named": false,
"value": "true"
},
"false": {
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[fF][aA][lL][sS][eE]"
},
"named": false,
"value": "false"
},
"null": {
"type": "ALIAS",
"content": {
"type": "PATTERN",
"value": "[nN][uU][lL][lL]"
},
"named": false,
"value": "null"
},
"star": {
"type": "STRING",
"value": "*"
},
"any": {
"type": "PATTERN",
"value": ".*"
},
"number": {
"type": "PATTERN",
"value": "\\d+"
},
2021-08-21 20:15:42 +03:00
"identifier": {
"type": "PATTERN",
"value": "[a-zA-Z0-9_]+[.a-zA-Z0-9_]*"
}
},
"extras": [
2021-08-28 13:46:32 +03:00
{
"type": "SYMBOL",
"name": "comment"
},
2021-08-21 20:15:42 +03:00
{
"type": "PATTERN",
2021-08-28 13:46:32 +03:00
"value": "[\\s\\uFEFF\\u2060\\u200B\\u00A0]"
2021-08-21 20:15:42 +03:00
}
],
"conflicts": [],
"precedences": [],
"externals": [],
"inline": [],
"supertypes": []
}