diff --git a/.iex.exs b/.iex.exs index d0c291e..5321080 100644 --- a/.iex.exs +++ b/.iex.exs @@ -9,3 +9,4 @@ Application.put_env(:sql, SQL.Repo, username: "postgres", password: "postgres", Mix.Tasks.Ecto.Create.run(["-r", "SQL.Repo"]) SQL.Repo.start_link() import SQL +alias SQL.BNF diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e92e60..62db244 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ # Changelog +## v0.3.0 (2025-08-01) + +### Enhancement + - Improve SQL generation with 57-344x compared to Ecto [#12](https://github.com/elixir-dbvisor/sql/pull/12). + - Fix bug for complex CTE [#15](https://github.com/elixir-dbvisor/sql/pull/15). Thanks to @kafaichoi + - Support for PostgresSQL GiST operators [#18](https://github.com/elixir-dbvisor/sql/pull/18). Thanks to @ibarchenkov + - `float` and `integer` nodes have now become `numeric` with metadata to distinguish `sign`, `whole` and `fractional` [#19](https://github.com/elixir-dbvisor/sql/pull/19). + - `keyword` nodes are now `ident` with metadata distinguish if it's a `keyword` [#19](https://github.com/elixir-dbvisor/sql/pull/19). + - `SQL.Lexer.lex/4` now returns `{:ok, context, tokens}` [#19](https://github.com/elixir-dbvisor/sql/pull/19). + - `SQL.Parser.parse/1` has become `SQL.Parser.parse/2` and takes `tokens` and `context` from `SQL.Lexer.lex/4` and returns `{:ok, context, tokens}` or raises an error [#19](https://github.com/elixir-dbvisor/sql/pull/19). + + ## v0.2.0 (2025-05-04) ### Enhancement diff --git a/bench.exs b/bench.exs index 446b070..85230ba 100644 --- a/bench.exs +++ b/bench.exs @@ -7,14 +7,29 @@ Application.put_env(:sql, :ecto_repos, [SQL.Repo]) Application.put_env(:sql, SQL.Repo, username: "postgres", password: "postgres", hostname: "localhost", database: "sql_test#{System.get_env("MIX_TEST_PARTITION")}", pool: Ecto.Adapters.SQL.Sandbox, pool_size: 10) SQL.Repo.__adapter__().storage_up(SQL.Repo.config()) SQL.Repo.start_link() -range = 1..10_000 +sql = ~SQL[with recursive temp (n, fact) as (select 0, 1 union all select n+1, (n+1)*fact from temp where n < 9)] +query = "temp" |> recursive_ctes(true) |> with_cte("temp", as: ^union_all(select("temp", [t], %{n: 0, fact: 1}), ^where(select("temp", [t], [t.n+1, t.n+1*t.fact]), [t], t.n < 9))) |> select([t], [t.n]) +result = Tuple.to_list(SQL.Lexer.lex("with recursive temp (n, fact) as (select 0, 1 union all select n+1, (n+1)*fact from temp where n < 9)", __ENV__.file)) +tokens = Enum.at(result, -1) +context = Enum.at(result, 1) Benchee.run( %{ - "to_string" => fn -> for _ <- range, do: to_string(~SQL[with recursive temp (n, fact) as (select 0, 1 union all select n+1, (n+1)*fact from temp where n < 9)]) end, - "to_sql" => fn -> for _ <- range, do: SQL.to_sql(~SQL[with recursive temp (n, fact) as (select 0, 1 union all select n+1, (n+1)*fact from temp where n < 9)]) end, - "inspect" => fn -> for _ <- range, do: inspect(~SQL[with recursive temp (n, fact) as (select 0, 1 union all select n+1, (n+1)*fact from temp where n < 9)]) end, - "ecto" => fn -> for _ <- range, do: SQL.Repo.to_sql(:all, "temp" |> recursive_ctes(true) |> with_cte("temp", as: ^union_all(select("temp", [t], %{n: 0, fact: 1}), ^where(select("temp", [t], [t.n+1, t.n+1*t.fact]), [t], t.n < 9))) |> select([t], [t.n])) end + "comptime to_string" => fn _ -> to_string(sql) end, + "comptime to_sql" => fn _ -> SQL.to_sql(sql) end, + "comptime inspect" => fn _ -> inspect(sql) end, + "comptime ecto" => fn _ -> SQL.Repo.to_sql(:all, query) end, + "lex" => fn _ -> SQL.Lexer.lex("with recursive temp (n, fact) as (select 0, 1 union all select n+1, (n+1)*fact from temp where n < 9)", __ENV__.file) end, + "parse" => fn _ -> SQL.Parser.parse(tokens, context) end, + "runtime to_string" => fn _ -> to_string(~SQL[with recursive temp (n, fact) as (select 0, 1 union all select n+1, (n+1)*fact from temp where n < 9)]) end, + "runtime to_sql" => fn _ -> SQL.to_sql(~SQL[with recursive temp (n, fact) as (select 0, 1 union all select n+1, (n+1)*fact from temp where n < 9)]) end, + "runtime inspect" => fn _ -> inspect(~SQL[with recursive temp (n, fact) as (select 0, 1 union all select n+1, (n+1)*fact from temp where n < 9)]) end, + "runtime ecto" => fn _ -> SQL.Repo.to_sql(:all, "temp" |> recursive_ctes(true) |> with_cte("temp", as: ^union_all(select("temp", [t], %{n: 0, fact: 1}), ^where(select("temp", [t], [t.n+1, t.n+1*t.fact]), [t], t.n < 9))) |> select([t], [t.n])) end }, - time: 10, - memory_time: 2 + inputs: %{ + "Small" => Enum.to_list(1..1_000), + "Medium" => Enum.to_list(1..10_000), + "Bigger" => Enum.to_list(1..100_000) + }, + memory_time: 2, + reduction_time: 2 ) diff --git a/lib/adapters/ansi.ex b/lib/adapters/ansi.ex index 350b909..c29abb1 100644 --- a/lib/adapters/ansi.ex +++ b/lib/adapters/ansi.ex @@ -11,23 +11,36 @@ defmodule SQL.Adapters.ANSI do @doc false def token_to_string(value, mod \\ __MODULE__) - def token_to_string(value, mod) when is_struct(value) do - to_string(%{value | module: mod}) + def token_to_string(value, _mod) when is_struct(value) do + to_string(value) end - def token_to_string({tag, _, [{:parens, _, _} = value]}, mod) when tag in ~w[integer float update]a do + def token_to_string({:*, _, []}, _mod) do + "*" + end + def token_to_string({:fun, _, [left, right]}, mod) do + "#{mod.token_to_string(left)}#{mod.token_to_string(right)}" + end + def token_to_string({tag, _, [{:paren, _, _} = value]}, mod) when tag in ~w[numeric update]a do "#{mod.token_to_string(tag)}#{mod.token_to_string(value)}" end - def token_to_string({tag, _, value}, _mod) when tag in ~w[ident integer float]a do - "#{value}" + def token_to_string({:ident, [{:keyword, :non_reserved},{:tag, tag}|_], [{:paren, _, _} = value]}, mod) do + "#{mod.token_to_string(tag)}#{mod.token_to_string(value)}" end - def token_to_string({tag, _}, mod) do - mod.token_to_string(tag) + def token_to_string({:ident, [{:keyword, :non_reserved}, {:tag, tag}|_], [{:numeric, _, _} = value]}, mod) do + "#{mod.token_to_string(tag)} #{mod.token_to_string(value)}" + end + def token_to_string({_tag, [{:keyword, :non_reserved}|_], value}, mod) do + "#{mod.token_to_string(value)}" + end + def token_to_string({:numeric = tag, _, []}, mod), do: mod.token_to_string(tag) + def token_to_string({tag, _, value}, _mod) when tag in ~w[ident numeric]a do + value end def token_to_string({:comment, _, value}, _mod) do - "-- #{value}" + "--#{value}" end def token_to_string({:comments, _, value}, _mod) do - "\\* #{value} *\\" + "\\*#{value}*\\" end def token_to_string({:double_quote, _, value}, _mod) do "\"#{value}\"" @@ -35,7 +48,7 @@ defmodule SQL.Adapters.ANSI do def token_to_string({:quote, _, value}, _mod) do "'#{value}'" end - def token_to_string({:parens, _, value}, mod) do + def token_to_string({:paren, _, value}, mod) do "(#{mod.token_to_string(value)})" end def token_to_string({:bracket, _, value}, mod) do @@ -47,21 +60,36 @@ defmodule SQL.Adapters.ANSI do def token_to_string({:comma, _, value}, mod) do ", #{mod.token_to_string(value)}" end + def token_to_string({:dot, _, [left, right]}, mod) do + "#{mod.token_to_string(left)}.#{mod.token_to_string(right)}" + end def token_to_string({tag, _, []}, mod) do mod.token_to_string(tag) end - def token_to_string({tag, _, [[_ | _] = left, right]}, mod) when tag in ~w[join]a do + def token_to_string({:join=tag, _, [right]}, mod) do + "#{mod.token_to_string(tag)} #{mod.token_to_string(right)}" + end + def token_to_string({:join=tag, _, [{t, [{:keyword, :reserved}|_], _}=p, p1, p2, right]}, mod) when t != :as do + "#{mod.token_to_string(p)} #{mod.token_to_string(p1)} #{mod.token_to_string(p2)} #{mod.token_to_string(tag)} #{mod.token_to_string(right)}" + end + def token_to_string({:join=tag, _, [{t, [{:keyword, :reserved}|_], _}=p, p1, right]}, mod) when t != :as do + "#{mod.token_to_string(p)} #{mod.token_to_string(p1)} #{mod.token_to_string(tag)} #{mod.token_to_string(right)}" + end + def token_to_string({:join=tag, _, [{t, [{:keyword, :reserved}|_], _}=left, right]}, mod) when t != :as do "#{mod.token_to_string(left)} #{mod.token_to_string(tag)} #{mod.token_to_string(right)}" end def token_to_string({tag, _, [{:with = t, _, [left, right]}]}, mod) when tag in ~w[to]a do "#{mod.token_to_string(tag)} #{mod.token_to_string(left)} #{mod.token_to_string(t)} #{mod.token_to_string(right)}" end - def token_to_string({tag, _, value}, mod) when tag in ~w[select from fetch limit where order offset group having with join by distinct create type drop insert alter table add into delete update start grant revoke set declare open close commit rollback references recursive]a do + def token_to_string({tag, _, value}, mod) when tag in ~w[select from fetch limit where order offset group having with join by distinct create type drop insert alter table add into delete update start grant revoke set declare open close commit rollback references recursive outer]a do "#{mod.token_to_string(tag)} #{mod.token_to_string(value)}" end def token_to_string({:on = tag, _, [source, as, value]}, mod) do "#{mod.token_to_string(source)} #{mod.token_to_string(as)} #{mod.token_to_string(tag)} #{mod.token_to_string(value)}" end + def token_to_string({:not = tag, _, [ident | values]}, mod) when values != [] do + "#{mod.token_to_string(ident)} #{mod.token_to_string(tag)} #{mod.token_to_string(values)}" + end def token_to_string({tag, _, [left, [{:all = t, _, right}]]}, mod) when tag in ~w[union except intersect]a do "#{mod.token_to_string(left)} #{mod.token_to_string(tag)} #{mod.token_to_string(t)} #{mod.token_to_string(right)}" end @@ -71,19 +99,13 @@ defmodule SQL.Adapters.ANSI do def token_to_string({tag, _, [left, right]}, mod) when tag in ~w[:: [\] <> <= >= != || + - ^ * / % < > = like ilike as union except intersect between and or on is not in cursor for to]a do "#{mod.token_to_string(left)} #{mod.token_to_string(tag)} #{mod.token_to_string(right)}" end - def token_to_string({tag, _, [{:parens, _, _} = value]}, mod) when tag not in ~w[in on]a do + def token_to_string({tag, _, [{:paren, _, _} = value]}, mod) when tag not in ~w[in on]a do "#{mod.token_to_string(tag)}#{mod.token_to_string(value)}" end - def token_to_string({tag, _, values}, mod) when tag in ~w[not all between symmetric absolute relative forward backward on in for without]a do + def token_to_string({tag, _, values}, mod) when tag in ~w[not all between asymmetric symmetric absolute relative forward backward on in for without]a do "#{mod.token_to_string(tag)} #{mod.token_to_string(values)}" end - def token_to_string({tag, _, [left, right]}, mod) when tag in ~w[.]a do - "#{mod.token_to_string(left)}.#{mod.token_to_string(right)}" - end - def token_to_string({tag, _, [left]}, mod) when tag in ~w[not]a do - "#{mod.token_to_string(left)} #{mod.token_to_string(tag)}" - end - def token_to_string({tag, _, [left]}, mod) when tag in ~w[asc desc isnull notnull]a do + def token_to_string({tag, _, [left]}, mod) when tag in ~w[asc desc isnull notnull not]a do "#{mod.token_to_string(left)} #{mod.token_to_string(tag)}" end def token_to_string({:binding, _, [idx]}, _mod) when is_integer(idx) do @@ -92,7 +114,7 @@ defmodule SQL.Adapters.ANSI do def token_to_string({:binding, _, value}, _mod) do "{{#{value}}}" end - def token_to_string(:asterisk, _mod) do + def token_to_string(:*, _mod) do "*" end def token_to_string(value, _mod) when is_atom(value) do @@ -101,12 +123,15 @@ defmodule SQL.Adapters.ANSI do def token_to_string(value, _mod) when is_binary(value) do "'#{value}'" end - def token_to_string(values, mod) when is_list(values) do + def token_to_string([h|_]=values, mod) when is_tuple(h) or is_tuple(hd(h)) do values |> Enum.reduce([], fn - token, [] = acc -> [acc | mod.token_to_string(token)] - {:comma, _, _} = token, acc -> [acc | mod.token_to_string(token)] - token, acc -> [acc, " " | mod.token_to_string(token)] + token, [] = acc -> [acc,mod.token_to_string(token, mod)] + {:comma, _, _} = token, acc -> [acc,mod.token_to_string(token, mod)] + token, acc -> [acc," ",mod.token_to_string(token, mod)] end) end + def token_to_string(value, _mod) do + value + end end diff --git a/lib/adapters/postgres.ex b/lib/adapters/postgres.ex index 768621d..98b4ad1 100644 --- a/lib/adapters/postgres.ex +++ b/lib/adapters/postgres.ex @@ -14,5 +14,8 @@ defmodule SQL.Adapters.Postgres do def token_to_string({:not, _, [left, {:in, _, [{:binding, _, _} = right]}]}, mod), do: "#{mod.token_to_string(left)} != ANY(#{mod.token_to_string(right)})" def token_to_string({:in, _, [left, {:binding, _, _} = right]}, mod), do: "#{mod.token_to_string(left)} = ANY(#{mod.token_to_string(right)})" def token_to_string({:binding, _, [idx]}, _mod) when is_integer(idx), do: "$#{idx}" + def token_to_string({tag, _, [left, right]}, mod) when tag in ~w[>>=]a do + "#{mod.token_to_string(left)} #{mod.token_to_string(tag)} #{mod.token_to_string(right)}" + end def token_to_string(token, mod), do: SQL.Adapters.ANSI.token_to_string(token, mod) end diff --git a/lib/bnf.ex b/lib/bnf.ex index 549ae09..2dd5c13 100644 --- a/lib/bnf.ex +++ b/lib/bnf.ex @@ -2,102 +2,217 @@ # SPDX-FileCopyrightText: 2025 DBVisor # https://standards.iso.org/iso-iec/9075/-2/ed-6/en/ # https://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_IEC_9075-1_2023_ed_6_-_id_76583_Publication_PDF_(en).zip -# 0. \w(?![^<]*>) -# 1. <[^>]*>\.{3} repeat non-terminal rule -# 2. ({.+}...) repeat group -# 3. <[^>]*> - non-terminal -# 4. \[[^\]]*] - optional -# 5. \|(?![^\[]*\]) - or +# "standard/ISO_IEC_9075-2(E)_Foundation.bnf.txt" + defmodule SQL.BNF do @moduledoc false - def parse() do - File.cwd!() - |> Path.join("standard/ISO_IEC_9075-2(E)_Foundation.bnf.txt") - |> File.read!() - |> parse() + def parse(opts \\ %{}) do + case opts do + %{path: path} -> + File.cwd!() + |> Path.join(path) + |> File.read!() + |> parse(opts) + %{download: true} -> + {:ok, {_, _, body}} = :httpc.request(:get, {~c"https://standards.iso.org/iso-iec/9075/-2/ed-6/en/ISO_IEC_9075-2(E)_Foundation.bnf.txt", []}, [], [body_format: :binary]) + parse(body, opts) + opts when is_binary(opts) -> + parse(opts, %{}) + end end - def parse(binary) do - Map.new(parse(binary, :symbol, [], [], [], [], [])) - end + defp parse(binary, opts, type \\ :symbol, data \\ [], acc \\ [], symbol \\ [], expr \\ [], rules \\ {[], []}) + defp parse(<<>>, opts, type, data, acc, symbol, expr, rules) do + {terminals, non_terminals} = merge(type, rules, symbol, [expr | [acc | data]]) + {terminals, non_terminals} = Enum.reduce(non_terminals, {terminals, []}, fn + {r, [v]} = rule, {terminals, non_terminals} -> + value = Enum.find(terminals, &(elem(&1, 0) == v)) + if value do + {[{r, elem(value, 1)} | terminals], non_terminals} + else + {terminals, [rule | non_terminals]} + end + rule, {terminals, non_terminals} -> {terminals, [rule | non_terminals]} + end) + exprs = Enum.flat_map(non_terminals, &elem(&1, 1)) + %{true: non_terminals, false: root} = Enum.group_by(non_terminals, &(elem(&1, 0) in exprs)) + {keywords, operators, letters, digits, terminals} = Enum.reduce(terminals, {[], [], [], [], []}, fn + {r, e} = rule, {keywords, operators, letters, digits, terminals} -> + cond do + String.ends_with?(r, "word>") == true -> + e = if is_map_key(opts, r), do: e ++ opts[r], else: e + {[{r, (for v <- e, v != "|", do: {atom(v), match(v), guard(v)})} | keywords], operators, letters, digits, terminals} + String.ends_with?(r, "letter>") == true -> {keywords, operators, [{r, Enum.reject(e, &(&1 == "|"))}|letters], digits, terminals} + String.ends_with?(r, "digit>") == true -> {keywords, operators, letters, [{r, Enum.reject(e, &(&1 == "|"))}|digits], terminals} + String.ends_with?(r, "operator>") == true -> {keywords, [rule | operators], letters, digits, terminals} + r in ~w[ ] -> {keywords, [rule | operators], letters, digits, terminals} + true -> {keywords, operators, letters, digits, [rule | terminals]} + end + end) - defp parse(<<>>, _type, data, acc, symbol, expr, rules) do - merge(rules, symbol, expr ++ merge(acc, data)) + symbols = terminals ++ operators + operators = opts + |> Map.get(:operators, []) + |> Kernel.++(operators) + |> Enum.sort_by(fn + {_, [b]} -> byte_size(b) + {_, _, [b |_]} -> byte_size(b) + end, :desc) + |> Enum.map(fn + {r, e} -> {r, (for v <- e, do: {String.to_atom(v), inline_match(v)})} + {r, _, e} -> {r, (for v <- e, do: {String.to_atom(v), inline_match(v)})} + end) + special_characters = Enum.filter(non_terminals ++ root, &(String.ends_with?(elem(&1, 0), "special character>") || String.ends_with?(elem(&1, 0), "special symbol>"))) + special_characters = for {_, e} <- special_characters, v <- e, v != "|", do: {String.to_atom(v), elem(Enum.find(symbols, {v, v}, &elem(&1, 0) == v), 1)} + special_characters = special_characters ++ [tilde: ["~"], number_sign: ["#"]] + special_characters = Enum.filter(special_characters, &byte_size(hd(elem(&1, 1))) == 1) + %{count: {length(terminals), length(non_terminals), length(root)}, letters: letters, digits: Map.new(digits), special_characters: special_characters, keywords: Map.new(keywords), operators: operators, root: root, terminals: Map.new(terminals), non_terminals: Map.new(non_terminals)} + end + defp parse(<>, opts, :symbol = type, symbol, _acc, _data, _expr, rules) do + parse(rest, opts, type, [], [], symbol, [], rules) + end + defp parse(<>, opts, type, data, acc, symbol, expr, rules) when type in [:non_terminal, :terminal] and (b in ?a..?z or b in ?A..?Z) do + parse(<>, opts, :symbol, [], [], [], [], merge(type, rules, symbol, [expr | [acc | data]])) end - defp parse(<>, :symbol = type, symbol, _acc, _data, _expr, rules) do - parse(rest, type, [], [], symbol, [], rules) + defp parse(<>, opts, type, data, acc, symbol, expr, rules) when b in [?\s, ?\t, ?\r, ?\n, ?\f] do + parse(rest, opts, :terminal, [], [], "#{data}", [], merge(type, rules, symbol, [expr | acc])) end - defp parse(<>, _type, data, acc, symbol, expr, rules) do - parse(<>, :symbol, [], [], [], [], merge(rules, symbol, expr ++ merge(acc, data))) + defp parse(<>, opts, type, [?!, ?! | _] = data, acc, symbol, expr, rules) do + parse(rest, opts, type, [], [acc, [data | ~c"."]], symbol, expr, rules) end - defp parse(<>, _type, data, acc, symbol, expr, rules) do - parse(rest, :expr, [], [], String.trim("#{data}"), [], merge(rules, symbol, expr ++ acc)) + defp parse(<>, opts, type, data, acc, symbol, expr, rules) do + parse(rest, opts, type, [data | ~c" ..."], acc, symbol, expr, rules) end - defp parse(<>, type, [?!, ?! | _] = data, acc, symbol, expr, rules) do - parse(rest, type, [], merge(acc, "#{data ++ [?.]}"), symbol, expr, rules) + defp parse(<>, opts, type, data, acc, symbol, expr, rules) do + parse(rest, opts, type, [data | ~c"|"], acc, symbol, expr, rules) end - defp parse(<>, type, data, acc, symbol, expr, rules) do - parse(rest, type, data ++ [?., ?., ?.], acc, symbol, expr, rules) + defp parse(<>, opts, type, data, acc, symbol, expr, rules) when b in [?\s, ?\t, ?\r, ?\f] and type != :symbol and (c in ?a..?z or c in ?A..?Z) do + parse(rest, opts, :non_terminal, [data | [?<, c]], acc, symbol, expr, rules) end - defp parse(<>, type, data, acc, symbol, expr, rules) do - parse(rest, type, data ++ [?|], acc, symbol, expr, rules) + defp parse(<>, opts, type, data, acc, symbol, expr, rules) when b in [?\s, ?\t, ?\r, ?\f] and c not in [?\s, ?\t, ?\r, ?\f, ?\n] do + parse(rest, opts, type, [data | [b, c]], acc, symbol, expr, rules) end - defp parse(<>, type, [] = data, acc, symbol, expr, rules) when b in [?\s, ?\t, ?\r, ?\n, ?\f] do - parse(rest, type, data, acc, symbol, expr, rules) + defp parse(<>, opts, type, data, acc, symbol, expr, rules) when b in [?\n, ?\s, ?\t, ?\r, ?\n, ?\f] do + parse(rest, opts, type, data, acc, symbol, expr, rules) end - defp parse(<>, type, data, acc, symbol, expr, rules) when b in [?\n] do - parse(rest, type, data, acc, symbol, expr, rules) + defp parse(<>, opts, type, data, acc, symbol, expr, rules) do + parse(rest, opts, type, [data | [b]], acc, symbol, expr, rules) end - defp parse(<>, type, data, acc, symbol, expr, rules) do - parse(rest, type, data ++ [b], acc, symbol, expr, rules) + + @syntax_rules "!! See the Syntax Rules." + defp merge(_type, rules, [], expr) when expr in [[], ""], do: rules + defp merge(type, rules, rule, expr) when is_list(expr), do: merge(type, rules, rule, String.trim("#{expr}")) + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {[{symbol, ["\u0020"]} | terminals], non_terminals} # 32 \u0020 + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {[{symbol, ["[[:Lu:], [:Ll:], [:Lt:], [:Lm:], [:Lo:], [:Nl:]]"]} | terminals], non_terminals} # "Lu", "Ll", "Lt", "Lm", "Lo", or "Nl" Unicode.Set.match?(<>, "[[:Lu:], [:Ll:], [:Lt:], [:Lm:], [:Lo:], [:Nl:]]") + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {[{symbol, ["[[:Mn:], [:Mc:], [:Nd:], [:Pc:], [:Cf:]]"]} | terminals], non_terminals} # 183 \u00B7 or "Mn", "Mc", "Nd", "Pc", or "Cf" Unicode.Set.match?(<>, "[[:Mn:], [:Mc:], [:Nd:], [:Pc:], [:Cf:]]") + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {[{symbol, ["\\u"]} | terminals], non_terminals} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {[{symbol, [{:non_double_quote_character, [], "b != ?\""}]} | terminals], non_terminals} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {[{symbol, ["\u0009", "\u000D", "\u00A0", "\u00A0", "\u1680", "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006", "\u2007", "\u2008", "\u2009", "\u200A", "\u202F", "\u205F", "\u3000", "\u180E", "\u200B", "\u200C", "\u200D", "\u2060", "\uFEFF"]} | terminals], non_terminals} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, expr), do: {terminals, [map(symbol, String.replace(expr, @syntax_rules, "")) | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {[{symbol, ["\u000A", "\u000B", "\u000C", "\u000D", "\u0085", "\u2028", "\u2029"]} | terminals], non_terminals} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [{:not_qoute, "b != ?'", ""}]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [{:not_escape, "b != ?\\", ""}]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [{:escape, "b == ?\\", ""}]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, ["", "", ""]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, ["", "", ""]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, ["","", ""]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, ["","", ""]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [""]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} # would be dialect specific + defp merge(_type, {terminals, non_terminals}, symbol, expr) when symbol in ["", ""], do: {terminals, [map(symbol, String.replace(expr, @syntax_rules, "")) | non_terminals]} # no between s + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} # would be dialect specific + defp merge(_type, {terminals, non_terminals}, "" = symbol, @syntax_rules), do: {terminals, [{symbol, [:ignore]} | non_terminals]} # would be dialect specific + defp merge(_type, _rules, symbol, @syntax_rules), do: raise "Please apply rules for #{symbol} by referencing the PDF or https://github.com/ronsavage/SQL/blob/master/Syntax.rules.txt" + defp merge(:terminal, {terminals, non_terminals}, symbol, expr), do: {[map(symbol, expr) | terminals], non_terminals} + defp merge(:non_terminal, {terminals, non_terminals}, symbol, expr), do: {terminals, [map(symbol, expr) | non_terminals]} + + def choice(value, group \\ [], acc \\ []) + def choice([], group, []), do: Enum.reverse(group) + def choice([], [], acc), do: Enum.reverse(acc) + def choice([], group, acc), do: Enum.reverse([Enum.reverse(group) | acc]) + def choice(["|" | rest], [] = group, acc), do: choice(rest, group, acc) + def choice(["|" | rest], group, acc), do: choice(rest, [], [Enum.reverse(group) | acc]) + def choice([k | rest], group, acc), do: choice(rest, [k | group], acc) + + def optional(value, acc \\ []) + def optional([], acc), do: choice(Enum.reverse(acc)) + def optional(["]" | rest], acc), do: {rest, optional([], acc)} + def optional(["[" | rest], acc) do + case optional(rest, []) do + {rest, optional} -> optional(rest, [{:optional, optional} | acc]) + optional -> optional(rest, [{:optional, optional} | acc]) + end end + def optional([node | rest], acc), do: optional(rest, [node | acc]) - defp merge([], []), do: [] - defp merge(rules, []), do: rules - defp merge(rules, data), do: rules ++ [data] - defp merge(rules, [], []), do: rules - defp merge(rules, rule, expr) when is_list(rule), do: merge(rules, "#{rule}", expr) - defp merge(rules, rule, expr) when is_list(expr), do: merge(rules, rule, "#{expr}") - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, ["\u0020"]}] # 32 \u0020 - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] # "Lu", "Ll", "Lt", "Lm", "Lo", or "Nl" Unicode.Set.match?(<>, "[[:Lu:], [:Ll:], [:Lt:], [:Lm:], [:Lo:], [:Nl:]]") - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] # 183 \u00B7 or "Mn", "Mc", "Nd", "Pc", or "Cf" Unicode.Set.match?(<>, "[[:Mn:], [:Mc:], [:Nd:], [:Pc:], [:Cf:]]") - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, ["\\u"]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, ["\u0009", "\u000D", "\u00A0", "\u00A0", "\u1680", "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006", "\u2007", "\u2008", "\u2009", "\u200A", "\u202F", "\u205F", "\u3000", "\u180E", "\u200B", "\u200C", "\u200D", "\u2060", "\uFEFF"]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, _expr), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, ["\u000A", "\u000B", "\u000C", "\u000D", "\u0085", "\u2028", "\u2029"]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, _expr), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, _expr), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(rules, "" = symbol, "!! See the Syntax Rules."), do: rules ++ [{symbol, [:ignore]}] - defp merge(_rules, symbol, "!! See the Syntax Rules."), do: raise "Please apply rules for #{symbol} by referencing the PDF or https://github.com/ronsavage/SQL/blob/master/Syntax.rules.txt" - defp merge(rules, symbol, expr), do: rules ++ [{symbol, expr}] + def group(value, acc \\ []) + def group([], acc), do: optional(repeat(Enum.reverse(acc))) + def group(["}" | rest], acc), do: {rest, {:group, group([], acc)}} + def group(["{" | rest], acc) do + case group(rest, []) do + {rest, group} -> group(rest, [group | acc]) + group -> group(rest, [group | acc]) + end + end + def group([node | rest], acc), do: group(rest, [node | acc]) + def group(expr, acc), do: group([], [expr | acc]) + + def repeat(value, acc \\ []) + def repeat([], acc), do: Enum.reverse(acc) + def repeat([node, "..." | rest], acc), do: repeat(rest, [{:repeat, node} | acc]) + def repeat([node | rest], acc), do: repeat(rest, [node | acc]) + + defp map(symbol, [v] = expr) when is_tuple(v), do: {symbol, expr} + defp map(symbol, expr) when expr in ["|", "[", "]", [:ignore], ["\u0020"], ["\u0009", "\u000D", "\u00A0", "\u00A0", "\u1680", "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006", "\u2007", "\u2008", "\u2009", "\u200A", "\u202F", "\u205F", "\u3000", "\u180E", "\u200B", "\u200C", "\u200D", "\u2060", "\uFEFF"], ["\u000A", "\u000B", "\u000C", "\u000D", "\u0085", "\u2028", "\u2029"]], do: {symbol, List.wrap(expr)} + defp map(symbol, expr) when is_list(expr), do: {symbol, expr} + defp map(symbol, expr) when is_binary(expr) do + {symbol, ~r"<[^>]*>" + |> Regex.split(expr, include_captures: true, trim: true) + |> Enum.reject(&(&1 == " ")) + |> Enum.flat_map(fn + <> = nt -> [nt] + expr -> String.split(String.trim(expr), " ", trim: true) + end)} + end + + def cast(<> = expr) when b in ?a..?z or b in ?A..?Z, do: expr + def cast(expr) when expr in ["|", "{", "}", "[", "]", :ignore, :self, "\u0020", "\u0009", "\u000D", "\u00A0", "\u00A0", "\u1680", "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006", "\u2007", "\u2008", "\u2009", "\u200A", "\u202F", "\u205F", "\u3000", "\u180E", "\u200B", "\u200C", "\u200D", "\u2060", "\uFEFF", "\u000A", "\u000B", "\u000C", "\u000D", "\u0085", "\u2028", "\u2029"], do: expr + def cast(expr) when is_binary(expr), do: {atom(expr), match(expr), guard(expr)} + def cast(expr) when is_tuple(expr) or is_list(expr) or is_atom(expr), do: expr + + def atom(value), do: String.to_atom(String.replace(String.replace(String.downcase(value), ["<", ">"], ""), ["/", " "], "_")) + def match(value), do: Enum.reduce(1..byte_size(value), "[]", fn n, acc -> "[#{acc}, b#{n}]" end) + def inline_match(value) do + for <>, reduce: "[]" do + acc -> "[#{acc}, ?#{<>}]" + end + end + def guard(value) do + {value, _n} = for <>, reduce: {"", 1} do + {"", n} -> {guard(k, n), n+1} + {acc, n} -> {"#{acc} and #{guard(k, n)}", n+1} + end + value + end + def guard(k, n) when k in ?a..?z, do: "is_#{<>}(b#{n})" + def guard(k, n), do: "b#{n} in #{inspect(Enum.uniq(~c"#{<>}#{String.upcase(<>)}"))}" end diff --git a/lib/helpers.ex b/lib/helpers.ex new file mode 100644 index 0000000..85a664c --- /dev/null +++ b/lib/helpers.ex @@ -0,0 +1,2822 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 DBVisor + +defmodule SQL.Helpers do + @moduledoc false + + defguard is_newline(b) when b in [10, 11, 12, 13, 133, 8232, 8233] + defguard is_space(b) when b in ~c" " + defguard is_whitespace(b) when b in [9, 13, 160, 160, 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 6158, 8203, 8204, 8205, 8288, 65279] + defguard is_literal(b) when b in ~c{"'`} + defguard is_expr(b) when b in [:paren, :bracket, :brace] + defguard is_nested_start(b) when b in ~c"([{" + defguard is_nested_end(b) when b in ~c")]}" + defguard is_special_character(b) when b in ~c" \"%&'()*+,-./:;<=>?[]^_|{}$'*@,$!>[(<-%.+?])/~#*/" + defguard is_digit(b) when b in ~c"0123456789" + defguard is_comment(b) when b in ["--", "/*"] + defguard is_sign(b) when b in ~c"-+" + defguard is_dot(b) when b == ?. + defguard is_delimiter(b) when b in ~c";," + defguard is_operator(node) when elem(node, 0) in ~w"^-= <=> ->> ||/ !~* <<| |>> &<| |&> ?-| ?|| <<= >>= #>> -|- && || &= ^= |= |*= >> << -> := += -= *= /= %= !> !< @> <@ |/ ^@ ~* !~ ## &< &> <^ >^ ?# ?- ?| ~= @@ !! #> ?& #- @? :: <> >= <= != + - ! & ^ | ~ % @ # * / = > <"a + + defguard is_a(b) when b in ~c"aA" + + defguard is_b(b) when b in ~c"bB" + + defguard is_c(b) when b in ~c"cC" + + defguard is_d(b) when b in ~c"dD" + + defguard is_e(b) when b in ~c"eE" + + defguard is_f(b) when b in ~c"fF" + + defguard is_g(b) when b in ~c"gG" + + defguard is_h(b) when b in ~c"hH" + + defguard is_i(b) when b in ~c"iI" + + defguard is_j(b) when b in ~c"jJ" + + defguard is_k(b) when b in ~c"kK" + + defguard is_l(b) when b in ~c"lL" + + defguard is_m(b) when b in ~c"mM" + + defguard is_n(b) when b in ~c"nN" + + defguard is_o(b) when b in ~c"oO" + + defguard is_p(b) when b in ~c"pP" + + defguard is_q(b) when b in ~c"qQ" + + defguard is_r(b) when b in ~c"rR" + + defguard is_s(b) when b in ~c"sS" + + defguard is_t(b) when b in ~c"tT" + + defguard is_u(b) when b in ~c"uU" + + defguard is_v(b) when b in ~c"vV" + + defguard is_w(b) when b in ~c"wW" + + defguard is_x(b) when b in ~c"xX" + + defguard is_y(b) when b in ~c"yY" + + defguard is_z(b) when b in ~c"zZ" + + + defguard is_kw_abs(node) when elem(hd(elem(node, 1)), 1) == :abs + + defguard is_kw_absent(node) when elem(hd(elem(node, 1)), 1) == :absent + + defguard is_kw_acos(node) when elem(hd(elem(node, 1)), 1) == :acos + + defguard is_kw_all(node) when elem(hd(elem(node, 1)), 1) == :all + + defguard is_kw_allocate(node) when elem(hd(elem(node, 1)), 1) == :allocate + + defguard is_kw_alter(node) when elem(hd(elem(node, 1)), 1) == :alter + + defguard is_kw_and(node) when elem(hd(elem(node, 1)), 1) == :and + + defguard is_kw_any(node) when elem(hd(elem(node, 1)), 1) == :any + + defguard is_kw_any_value(node) when elem(hd(elem(node, 1)), 1) == :any_value + + defguard is_kw_are(node) when elem(hd(elem(node, 1)), 1) == :are + + defguard is_kw_array(node) when elem(hd(elem(node, 1)), 1) == :array + + defguard is_kw_array_agg(node) when elem(hd(elem(node, 1)), 1) == :array_agg + + defguard is_kw_array_max_cardinality(node) when elem(hd(elem(node, 1)), 1) == :array_max_cardinality + + defguard is_kw_as(node) when elem(hd(elem(node, 1)), 1) == :as + + defguard is_kw_asensitive(node) when elem(hd(elem(node, 1)), 1) == :asensitive + + defguard is_kw_asin(node) when elem(hd(elem(node, 1)), 1) == :asin + + defguard is_kw_asymmetric(node) when elem(hd(elem(node, 1)), 1) == :asymmetric + + defguard is_kw_at(node) when elem(hd(elem(node, 1)), 1) == :at + + defguard is_kw_atan(node) when elem(hd(elem(node, 1)), 1) == :atan + + defguard is_kw_atomic(node) when elem(hd(elem(node, 1)), 1) == :atomic + + defguard is_kw_authorization(node) when elem(hd(elem(node, 1)), 1) == :authorization + + defguard is_kw_avg(node) when elem(hd(elem(node, 1)), 1) == :avg + + defguard is_kw_begin(node) when elem(hd(elem(node, 1)), 1) == :begin + + defguard is_kw_begin_frame(node) when elem(hd(elem(node, 1)), 1) == :begin_frame + + defguard is_kw_begin_partition(node) when elem(hd(elem(node, 1)), 1) == :begin_partition + + defguard is_kw_between(node) when elem(hd(elem(node, 1)), 1) == :between + + defguard is_kw_bigint(node) when elem(hd(elem(node, 1)), 1) == :bigint + + defguard is_kw_binary(node) when elem(hd(elem(node, 1)), 1) == :binary + + defguard is_kw_blob(node) when elem(hd(elem(node, 1)), 1) == :blob + + defguard is_kw_boolean(node) when elem(hd(elem(node, 1)), 1) == :boolean + + defguard is_kw_both(node) when elem(hd(elem(node, 1)), 1) == :both + + defguard is_kw_btrim(node) when elem(hd(elem(node, 1)), 1) == :btrim + + defguard is_kw_by(node) when elem(hd(elem(node, 1)), 1) == :by + + defguard is_kw_call(node) when elem(hd(elem(node, 1)), 1) == :call + + defguard is_kw_called(node) when elem(hd(elem(node, 1)), 1) == :called + + defguard is_kw_cardinality(node) when elem(hd(elem(node, 1)), 1) == :cardinality + + defguard is_kw_cascaded(node) when elem(hd(elem(node, 1)), 1) == :cascaded + + defguard is_kw_case(node) when elem(hd(elem(node, 1)), 1) == :case + + defguard is_kw_cast(node) when elem(hd(elem(node, 1)), 1) == :cast + + defguard is_kw_ceil(node) when elem(hd(elem(node, 1)), 1) == :ceil + + defguard is_kw_ceiling(node) when elem(hd(elem(node, 1)), 1) == :ceiling + + defguard is_kw_char(node) when elem(hd(elem(node, 1)), 1) == :char + + defguard is_kw_char_length(node) when elem(hd(elem(node, 1)), 1) == :char_length + + defguard is_kw_character(node) when elem(hd(elem(node, 1)), 1) == :character + + defguard is_kw_character_length(node) when elem(hd(elem(node, 1)), 1) == :character_length + + defguard is_kw_check(node) when elem(hd(elem(node, 1)), 1) == :check + + defguard is_kw_classifier(node) when elem(hd(elem(node, 1)), 1) == :classifier + + defguard is_kw_clob(node) when elem(hd(elem(node, 1)), 1) == :clob + + defguard is_kw_close(node) when elem(hd(elem(node, 1)), 1) == :close + + defguard is_kw_coalesce(node) when elem(hd(elem(node, 1)), 1) == :coalesce + + defguard is_kw_collate(node) when elem(hd(elem(node, 1)), 1) == :collate + + defguard is_kw_collect(node) when elem(hd(elem(node, 1)), 1) == :collect + + defguard is_kw_column(node) when elem(hd(elem(node, 1)), 1) == :column + + defguard is_kw_commit(node) when elem(hd(elem(node, 1)), 1) == :commit + + defguard is_kw_condition(node) when elem(hd(elem(node, 1)), 1) == :condition + + defguard is_kw_connect(node) when elem(hd(elem(node, 1)), 1) == :connect + + defguard is_kw_constraint(node) when elem(hd(elem(node, 1)), 1) == :constraint + + defguard is_kw_contains(node) when elem(hd(elem(node, 1)), 1) == :contains + + defguard is_kw_convert(node) when elem(hd(elem(node, 1)), 1) == :convert + + defguard is_kw_copy(node) when elem(hd(elem(node, 1)), 1) == :copy + + defguard is_kw_corr(node) when elem(hd(elem(node, 1)), 1) == :corr + + defguard is_kw_corresponding(node) when elem(hd(elem(node, 1)), 1) == :corresponding + + defguard is_kw_cos(node) when elem(hd(elem(node, 1)), 1) == :cos + + defguard is_kw_cosh(node) when elem(hd(elem(node, 1)), 1) == :cosh + + defguard is_kw_count(node) when elem(hd(elem(node, 1)), 1) == :count + + defguard is_kw_covar_pop(node) when elem(hd(elem(node, 1)), 1) == :covar_pop + + defguard is_kw_covar_samp(node) when elem(hd(elem(node, 1)), 1) == :covar_samp + + defguard is_kw_create(node) when elem(hd(elem(node, 1)), 1) == :create + + defguard is_kw_cross(node) when elem(hd(elem(node, 1)), 1) == :cross + + defguard is_kw_cube(node) when elem(hd(elem(node, 1)), 1) == :cube + + defguard is_kw_cume_dist(node) when elem(hd(elem(node, 1)), 1) == :cume_dist + + defguard is_kw_current(node) when elem(hd(elem(node, 1)), 1) == :current + + defguard is_kw_current_catalog(node) when elem(hd(elem(node, 1)), 1) == :current_catalog + + defguard is_kw_current_date(node) when elem(hd(elem(node, 1)), 1) == :current_date + + defguard is_kw_current_default_transform_group(node) when elem(hd(elem(node, 1)), 1) == :current_default_transform_group + + defguard is_kw_current_path(node) when elem(hd(elem(node, 1)), 1) == :current_path + + defguard is_kw_current_role(node) when elem(hd(elem(node, 1)), 1) == :current_role + + defguard is_kw_current_row(node) when elem(hd(elem(node, 1)), 1) == :current_row + + defguard is_kw_current_schema(node) when elem(hd(elem(node, 1)), 1) == :current_schema + + defguard is_kw_current_time(node) when elem(hd(elem(node, 1)), 1) == :current_time + + defguard is_kw_current_timestamp(node) when elem(hd(elem(node, 1)), 1) == :current_timestamp + + defguard is_kw_current_transform_group_for_type(node) when elem(hd(elem(node, 1)), 1) == :current_transform_group_for_type + + defguard is_kw_current_user(node) when elem(hd(elem(node, 1)), 1) == :current_user + + defguard is_kw_cursor(node) when elem(hd(elem(node, 1)), 1) == :cursor + + defguard is_kw_cycle(node) when elem(hd(elem(node, 1)), 1) == :cycle + + defguard is_kw_date(node) when elem(hd(elem(node, 1)), 1) == :date + + defguard is_kw_day(node) when elem(hd(elem(node, 1)), 1) == :day + + defguard is_kw_deallocate(node) when elem(hd(elem(node, 1)), 1) == :deallocate + + defguard is_kw_dec(node) when elem(hd(elem(node, 1)), 1) == :dec + + defguard is_kw_decfloat(node) when elem(hd(elem(node, 1)), 1) == :decfloat + + defguard is_kw_decimal(node) when elem(hd(elem(node, 1)), 1) == :decimal + + defguard is_kw_declare(node) when elem(hd(elem(node, 1)), 1) == :declare + + defguard is_kw_default(node) when elem(hd(elem(node, 1)), 1) == :default + + defguard is_kw_define(node) when elem(hd(elem(node, 1)), 1) == :define + + defguard is_kw_delete(node) when elem(hd(elem(node, 1)), 1) == :delete + + defguard is_kw_dense_rank(node) when elem(hd(elem(node, 1)), 1) == :dense_rank + + defguard is_kw_deref(node) when elem(hd(elem(node, 1)), 1) == :deref + + defguard is_kw_describe(node) when elem(hd(elem(node, 1)), 1) == :describe + + defguard is_kw_deterministic(node) when elem(hd(elem(node, 1)), 1) == :deterministic + + defguard is_kw_disconnect(node) when elem(hd(elem(node, 1)), 1) == :disconnect + + defguard is_kw_distinct(node) when elem(hd(elem(node, 1)), 1) == :distinct + + defguard is_kw_double(node) when elem(hd(elem(node, 1)), 1) == :double + + defguard is_kw_drop(node) when elem(hd(elem(node, 1)), 1) == :drop + + defguard is_kw_dynamic(node) when elem(hd(elem(node, 1)), 1) == :dynamic + + defguard is_kw_each(node) when elem(hd(elem(node, 1)), 1) == :each + + defguard is_kw_element(node) when elem(hd(elem(node, 1)), 1) == :element + + defguard is_kw_else(node) when elem(hd(elem(node, 1)), 1) == :else + + defguard is_kw_empty(node) when elem(hd(elem(node, 1)), 1) == :empty + + defguard is_kw_end(node) when elem(hd(elem(node, 1)), 1) == :end + + defguard is_kw_end_frame(node) when elem(hd(elem(node, 1)), 1) == :end_frame + + defguard is_kw_end_partition(node) when elem(hd(elem(node, 1)), 1) == :end_partition + + defguard is_kw_end_exec(node) when elem(hd(elem(node, 1)), 1) == :"end-exec" + + defguard is_kw_equals(node) when elem(hd(elem(node, 1)), 1) == :equals + + defguard is_kw_escape(node) when elem(hd(elem(node, 1)), 1) == :escape + + defguard is_kw_every(node) when elem(hd(elem(node, 1)), 1) == :every + + defguard is_kw_except(node) when elem(hd(elem(node, 1)), 1) == :except + + defguard is_kw_exec(node) when elem(hd(elem(node, 1)), 1) == :exec + + defguard is_kw_execute(node) when elem(hd(elem(node, 1)), 1) == :execute + + defguard is_kw_exists(node) when elem(hd(elem(node, 1)), 1) == :exists + + defguard is_kw_exp(node) when elem(hd(elem(node, 1)), 1) == :exp + + defguard is_kw_external(node) when elem(hd(elem(node, 1)), 1) == :external + + defguard is_kw_extract(node) when elem(hd(elem(node, 1)), 1) == :extract + + defguard is_kw_false(node) when elem(hd(elem(node, 1)), 1) == false + + defguard is_kw_fetch(node) when elem(hd(elem(node, 1)), 1) == :fetch + + defguard is_kw_filter(node) when elem(hd(elem(node, 1)), 1) == :filter + + defguard is_kw_first_value(node) when elem(hd(elem(node, 1)), 1) == :first_value + + defguard is_kw_float(node) when elem(hd(elem(node, 1)), 1) == :float + + defguard is_kw_floor(node) when elem(hd(elem(node, 1)), 1) == :floor + + defguard is_kw_for(node) when elem(hd(elem(node, 1)), 1) == :for + + defguard is_kw_foreign(node) when elem(hd(elem(node, 1)), 1) == :foreign + + defguard is_kw_frame_row(node) when elem(hd(elem(node, 1)), 1) == :frame_row + + defguard is_kw_free(node) when elem(hd(elem(node, 1)), 1) == :free + + defguard is_kw_from(node) when elem(hd(elem(node, 1)), 1) == :from + + defguard is_kw_full(node) when elem(hd(elem(node, 1)), 1) == :full + + defguard is_kw_function(node) when elem(hd(elem(node, 1)), 1) == :function + + defguard is_kw_fusion(node) when elem(hd(elem(node, 1)), 1) == :fusion + + defguard is_kw_get(node) when elem(hd(elem(node, 1)), 1) == :get + + defguard is_kw_global(node) when elem(hd(elem(node, 1)), 1) == :global + + defguard is_kw_grant(node) when elem(hd(elem(node, 1)), 1) == :grant + + defguard is_kw_greatest(node) when elem(hd(elem(node, 1)), 1) == :greatest + + defguard is_kw_group(node) when elem(hd(elem(node, 1)), 1) == :group + + defguard is_kw_grouping(node) when elem(hd(elem(node, 1)), 1) == :grouping + + defguard is_kw_groups(node) when elem(hd(elem(node, 1)), 1) == :groups + + defguard is_kw_having(node) when elem(hd(elem(node, 1)), 1) == :having + + defguard is_kw_hold(node) when elem(hd(elem(node, 1)), 1) == :hold + + defguard is_kw_hour(node) when elem(hd(elem(node, 1)), 1) == :hour + + defguard is_kw_identity(node) when elem(hd(elem(node, 1)), 1) == :identity + + defguard is_kw_in(node) when elem(hd(elem(node, 1)), 1) == :in + + defguard is_kw_indicator(node) when elem(hd(elem(node, 1)), 1) == :indicator + + defguard is_kw_initial(node) when elem(hd(elem(node, 1)), 1) == :initial + + defguard is_kw_inner(node) when elem(hd(elem(node, 1)), 1) == :inner + + defguard is_kw_inout(node) when elem(hd(elem(node, 1)), 1) == :inout + + defguard is_kw_insensitive(node) when elem(hd(elem(node, 1)), 1) == :insensitive + + defguard is_kw_insert(node) when elem(hd(elem(node, 1)), 1) == :insert + + defguard is_kw_int(node) when elem(hd(elem(node, 1)), 1) == :int + + defguard is_kw_integer(node) when elem(hd(elem(node, 1)), 1) == :integer + + defguard is_kw_intersect(node) when elem(hd(elem(node, 1)), 1) == :intersect + + defguard is_kw_intersection(node) when elem(hd(elem(node, 1)), 1) == :intersection + + defguard is_kw_interval(node) when elem(hd(elem(node, 1)), 1) == :interval + + defguard is_kw_into(node) when elem(hd(elem(node, 1)), 1) == :into + + defguard is_kw_is(node) when elem(hd(elem(node, 1)), 1) == :is + + defguard is_kw_join(node) when elem(hd(elem(node, 1)), 1) == :join + + defguard is_kw_json(node) when elem(hd(elem(node, 1)), 1) == :json + + defguard is_kw_json_array(node) when elem(hd(elem(node, 1)), 1) == :json_array + + defguard is_kw_json_arrayagg(node) when elem(hd(elem(node, 1)), 1) == :json_arrayagg + + defguard is_kw_json_exists(node) when elem(hd(elem(node, 1)), 1) == :json_exists + + defguard is_kw_json_object(node) when elem(hd(elem(node, 1)), 1) == :json_object + + defguard is_kw_json_objectagg(node) when elem(hd(elem(node, 1)), 1) == :json_objectagg + + defguard is_kw_json_query(node) when elem(hd(elem(node, 1)), 1) == :json_query + + defguard is_kw_json_scalar(node) when elem(hd(elem(node, 1)), 1) == :json_scalar + + defguard is_kw_json_serialize(node) when elem(hd(elem(node, 1)), 1) == :json_serialize + + defguard is_kw_json_table(node) when elem(hd(elem(node, 1)), 1) == :json_table + + defguard is_kw_json_table_primitive(node) when elem(hd(elem(node, 1)), 1) == :json_table_primitive + + defguard is_kw_json_value(node) when elem(hd(elem(node, 1)), 1) == :json_value + + defguard is_kw_lag(node) when elem(hd(elem(node, 1)), 1) == :lag + + defguard is_kw_language(node) when elem(hd(elem(node, 1)), 1) == :language + + defguard is_kw_large(node) when elem(hd(elem(node, 1)), 1) == :large + + defguard is_kw_last_value(node) when elem(hd(elem(node, 1)), 1) == :last_value + + defguard is_kw_lateral(node) when elem(hd(elem(node, 1)), 1) == :lateral + + defguard is_kw_lead(node) when elem(hd(elem(node, 1)), 1) == :lead + + defguard is_kw_leading(node) when elem(hd(elem(node, 1)), 1) == :leading + + defguard is_kw_least(node) when elem(hd(elem(node, 1)), 1) == :least + + defguard is_kw_left(node) when elem(hd(elem(node, 1)), 1) == :left + + defguard is_kw_like(node) when elem(hd(elem(node, 1)), 1) == :like + + defguard is_kw_like_regex(node) when elem(hd(elem(node, 1)), 1) == :like_regex + + defguard is_kw_listagg(node) when elem(hd(elem(node, 1)), 1) == :listagg + + defguard is_kw_ln(node) when elem(hd(elem(node, 1)), 1) == :ln + + defguard is_kw_local(node) when elem(hd(elem(node, 1)), 1) == :local + + defguard is_kw_localtime(node) when elem(hd(elem(node, 1)), 1) == :localtime + + defguard is_kw_localtimestamp(node) when elem(hd(elem(node, 1)), 1) == :localtimestamp + + defguard is_kw_log(node) when elem(hd(elem(node, 1)), 1) == :log + + defguard is_kw_log10(node) when elem(hd(elem(node, 1)), 1) == :log10 + + defguard is_kw_lower(node) when elem(hd(elem(node, 1)), 1) == :lower + + defguard is_kw_lpad(node) when elem(hd(elem(node, 1)), 1) == :lpad + + defguard is_kw_ltrim(node) when elem(hd(elem(node, 1)), 1) == :ltrim + + defguard is_kw_match(node) when elem(hd(elem(node, 1)), 1) == :match + + defguard is_kw_match_number(node) when elem(hd(elem(node, 1)), 1) == :match_number + + defguard is_kw_match_recognize(node) when elem(hd(elem(node, 1)), 1) == :match_recognize + + defguard is_kw_matches(node) when elem(hd(elem(node, 1)), 1) == :matches + + defguard is_kw_max(node) when elem(hd(elem(node, 1)), 1) == :max + + defguard is_kw_member(node) when elem(hd(elem(node, 1)), 1) == :member + + defguard is_kw_merge(node) when elem(hd(elem(node, 1)), 1) == :merge + + defguard is_kw_method(node) when elem(hd(elem(node, 1)), 1) == :method + + defguard is_kw_min(node) when elem(hd(elem(node, 1)), 1) == :min + + defguard is_kw_minute(node) when elem(hd(elem(node, 1)), 1) == :minute + + defguard is_kw_mod(node) when elem(hd(elem(node, 1)), 1) == :mod + + defguard is_kw_modifies(node) when elem(hd(elem(node, 1)), 1) == :modifies + + defguard is_kw_module(node) when elem(hd(elem(node, 1)), 1) == :module + + defguard is_kw_month(node) when elem(hd(elem(node, 1)), 1) == :month + + defguard is_kw_multiset(node) when elem(hd(elem(node, 1)), 1) == :multiset + + defguard is_kw_national(node) when elem(hd(elem(node, 1)), 1) == :national + + defguard is_kw_natural(node) when elem(hd(elem(node, 1)), 1) == :natural + + defguard is_kw_nchar(node) when elem(hd(elem(node, 1)), 1) == :nchar + + defguard is_kw_nclob(node) when elem(hd(elem(node, 1)), 1) == :nclob + + defguard is_kw_new(node) when elem(hd(elem(node, 1)), 1) == :new + + defguard is_kw_no(node) when elem(hd(elem(node, 1)), 1) == :no + + defguard is_kw_none(node) when elem(hd(elem(node, 1)), 1) == :none + + defguard is_kw_normalize(node) when elem(hd(elem(node, 1)), 1) == :normalize + + defguard is_kw_not(node) when elem(hd(elem(node, 1)), 1) == :not + + defguard is_kw_nth_value(node) when elem(hd(elem(node, 1)), 1) == :nth_value + + defguard is_kw_ntile(node) when elem(hd(elem(node, 1)), 1) == :ntile + + defguard is_kw_null(node) when elem(hd(elem(node, 1)), 1) == :null + + defguard is_kw_nullif(node) when elem(hd(elem(node, 1)), 1) == :nullif + + defguard is_kw_numeric(node) when elem(hd(elem(node, 1)), 1) == :numeric + + defguard is_kw_occurrences_regex(node) when elem(hd(elem(node, 1)), 1) == :occurrences_regex + + defguard is_kw_octet_length(node) when elem(hd(elem(node, 1)), 1) == :octet_length + + defguard is_kw_of(node) when elem(hd(elem(node, 1)), 1) == :of + + defguard is_kw_offset(node) when elem(hd(elem(node, 1)), 1) == :offset + + defguard is_kw_old(node) when elem(hd(elem(node, 1)), 1) == :old + + defguard is_kw_omit(node) when elem(hd(elem(node, 1)), 1) == :omit + + defguard is_kw_on(node) when elem(hd(elem(node, 1)), 1) == :on + + defguard is_kw_one(node) when elem(hd(elem(node, 1)), 1) == :one + + defguard is_kw_only(node) when elem(hd(elem(node, 1)), 1) == :only + + defguard is_kw_open(node) when elem(hd(elem(node, 1)), 1) == :open + + defguard is_kw_or(node) when elem(hd(elem(node, 1)), 1) == :or + + defguard is_kw_order(node) when elem(hd(elem(node, 1)), 1) == :order + + defguard is_kw_out(node) when elem(hd(elem(node, 1)), 1) == :out + + defguard is_kw_outer(node) when elem(hd(elem(node, 1)), 1) == :outer + + defguard is_kw_over(node) when elem(hd(elem(node, 1)), 1) == :over + + defguard is_kw_overlaps(node) when elem(hd(elem(node, 1)), 1) == :overlaps + + defguard is_kw_overlay(node) when elem(hd(elem(node, 1)), 1) == :overlay + + defguard is_kw_parameter(node) when elem(hd(elem(node, 1)), 1) == :parameter + + defguard is_kw_partition(node) when elem(hd(elem(node, 1)), 1) == :partition + + defguard is_kw_pattern(node) when elem(hd(elem(node, 1)), 1) == :pattern + + defguard is_kw_per(node) when elem(hd(elem(node, 1)), 1) == :per + + defguard is_kw_percent(node) when elem(hd(elem(node, 1)), 1) == :percent + + defguard is_kw_percent_rank(node) when elem(hd(elem(node, 1)), 1) == :percent_rank + + defguard is_kw_percentile_cont(node) when elem(hd(elem(node, 1)), 1) == :percentile_cont + + defguard is_kw_percentile_disc(node) when elem(hd(elem(node, 1)), 1) == :percentile_disc + + defguard is_kw_period(node) when elem(hd(elem(node, 1)), 1) == :period + + defguard is_kw_portion(node) when elem(hd(elem(node, 1)), 1) == :portion + + defguard is_kw_position(node) when elem(hd(elem(node, 1)), 1) == :position + + defguard is_kw_position_regex(node) when elem(hd(elem(node, 1)), 1) == :position_regex + + defguard is_kw_power(node) when elem(hd(elem(node, 1)), 1) == :power + + defguard is_kw_precedes(node) when elem(hd(elem(node, 1)), 1) == :precedes + + defguard is_kw_precision(node) when elem(hd(elem(node, 1)), 1) == :precision + + defguard is_kw_prepare(node) when elem(hd(elem(node, 1)), 1) == :prepare + + defguard is_kw_primary(node) when elem(hd(elem(node, 1)), 1) == :primary + + defguard is_kw_procedure(node) when elem(hd(elem(node, 1)), 1) == :procedure + + defguard is_kw_ptf(node) when elem(hd(elem(node, 1)), 1) == :ptf + + defguard is_kw_range(node) when elem(hd(elem(node, 1)), 1) == :range + + defguard is_kw_rank(node) when elem(hd(elem(node, 1)), 1) == :rank + + defguard is_kw_reads(node) when elem(hd(elem(node, 1)), 1) == :reads + + defguard is_kw_real(node) when elem(hd(elem(node, 1)), 1) == :real + + defguard is_kw_recursive(node) when elem(hd(elem(node, 1)), 1) == :recursive + + defguard is_kw_ref(node) when elem(hd(elem(node, 1)), 1) == :ref + + defguard is_kw_references(node) when elem(hd(elem(node, 1)), 1) == :references + + defguard is_kw_referencing(node) when elem(hd(elem(node, 1)), 1) == :referencing + + defguard is_kw_regr_avgx(node) when elem(hd(elem(node, 1)), 1) == :regr_avgx + + defguard is_kw_regr_avgy(node) when elem(hd(elem(node, 1)), 1) == :regr_avgy + + defguard is_kw_regr_count(node) when elem(hd(elem(node, 1)), 1) == :regr_count + + defguard is_kw_regr_intercept(node) when elem(hd(elem(node, 1)), 1) == :regr_intercept + + defguard is_kw_regr_r2(node) when elem(hd(elem(node, 1)), 1) == :regr_r2 + + defguard is_kw_regr_slope(node) when elem(hd(elem(node, 1)), 1) == :regr_slope + + defguard is_kw_regr_sxx(node) when elem(hd(elem(node, 1)), 1) == :regr_sxx + + defguard is_kw_regr_sxy(node) when elem(hd(elem(node, 1)), 1) == :regr_sxy + + defguard is_kw_regr_syy(node) when elem(hd(elem(node, 1)), 1) == :regr_syy + + defguard is_kw_release(node) when elem(hd(elem(node, 1)), 1) == :release + + defguard is_kw_result(node) when elem(hd(elem(node, 1)), 1) == :result + + defguard is_kw_return(node) when elem(hd(elem(node, 1)), 1) == :return + + defguard is_kw_returns(node) when elem(hd(elem(node, 1)), 1) == :returns + + defguard is_kw_revoke(node) when elem(hd(elem(node, 1)), 1) == :revoke + + defguard is_kw_right(node) when elem(hd(elem(node, 1)), 1) == :right + + defguard is_kw_rollback(node) when elem(hd(elem(node, 1)), 1) == :rollback + + defguard is_kw_rollup(node) when elem(hd(elem(node, 1)), 1) == :rollup + + defguard is_kw_row(node) when elem(hd(elem(node, 1)), 1) == :row + + defguard is_kw_row_number(node) when elem(hd(elem(node, 1)), 1) == :row_number + + defguard is_kw_rows(node) when elem(hd(elem(node, 1)), 1) == :rows + + defguard is_kw_rpad(node) when elem(hd(elem(node, 1)), 1) == :rpad + + defguard is_kw_rtrim(node) when elem(hd(elem(node, 1)), 1) == :rtrim + + defguard is_kw_running(node) when elem(hd(elem(node, 1)), 1) == :running + + defguard is_kw_savepoint(node) when elem(hd(elem(node, 1)), 1) == :savepoint + + defguard is_kw_scope(node) when elem(hd(elem(node, 1)), 1) == :scope + + defguard is_kw_scroll(node) when elem(hd(elem(node, 1)), 1) == :scroll + + defguard is_kw_search(node) when elem(hd(elem(node, 1)), 1) == :search + + defguard is_kw_second(node) when elem(hd(elem(node, 1)), 1) == :second + + defguard is_kw_seek(node) when elem(hd(elem(node, 1)), 1) == :seek + + defguard is_kw_select(node) when elem(hd(elem(node, 1)), 1) == :select + + defguard is_kw_sensitive(node) when elem(hd(elem(node, 1)), 1) == :sensitive + + defguard is_kw_session_user(node) when elem(hd(elem(node, 1)), 1) == :session_user + + defguard is_kw_set(node) when elem(hd(elem(node, 1)), 1) == :set + + defguard is_kw_show(node) when elem(hd(elem(node, 1)), 1) == :show + + defguard is_kw_similar(node) when elem(hd(elem(node, 1)), 1) == :similar + + defguard is_kw_sin(node) when elem(hd(elem(node, 1)), 1) == :sin + + defguard is_kw_sinh(node) when elem(hd(elem(node, 1)), 1) == :sinh + + defguard is_kw_skip(node) when elem(hd(elem(node, 1)), 1) == :skip + + defguard is_kw_smallint(node) when elem(hd(elem(node, 1)), 1) == :smallint + + defguard is_kw_some(node) when elem(hd(elem(node, 1)), 1) == :some + + defguard is_kw_specific(node) when elem(hd(elem(node, 1)), 1) == :specific + + defguard is_kw_specifictype(node) when elem(hd(elem(node, 1)), 1) == :specifictype + + defguard is_kw_sql(node) when elem(hd(elem(node, 1)), 1) == :sql + + defguard is_kw_sqlexception(node) when elem(hd(elem(node, 1)), 1) == :sqlexception + + defguard is_kw_sqlstate(node) when elem(hd(elem(node, 1)), 1) == :sqlstate + + defguard is_kw_sqlwarning(node) when elem(hd(elem(node, 1)), 1) == :sqlwarning + + defguard is_kw_sqrt(node) when elem(hd(elem(node, 1)), 1) == :sqrt + + defguard is_kw_start(node) when elem(hd(elem(node, 1)), 1) == :start + + defguard is_kw_static(node) when elem(hd(elem(node, 1)), 1) == :static + + defguard is_kw_stddev_pop(node) when elem(hd(elem(node, 1)), 1) == :stddev_pop + + defguard is_kw_stddev_samp(node) when elem(hd(elem(node, 1)), 1) == :stddev_samp + + defguard is_kw_submultiset(node) when elem(hd(elem(node, 1)), 1) == :submultiset + + defguard is_kw_subset(node) when elem(hd(elem(node, 1)), 1) == :subset + + defguard is_kw_substring(node) when elem(hd(elem(node, 1)), 1) == :substring + + defguard is_kw_substring_regex(node) when elem(hd(elem(node, 1)), 1) == :substring_regex + + defguard is_kw_succeeds(node) when elem(hd(elem(node, 1)), 1) == :succeeds + + defguard is_kw_sum(node) when elem(hd(elem(node, 1)), 1) == :sum + + defguard is_kw_symmetric(node) when elem(hd(elem(node, 1)), 1) == :symmetric + + defguard is_kw_system(node) when elem(hd(elem(node, 1)), 1) == :system + + defguard is_kw_system_time(node) when elem(hd(elem(node, 1)), 1) == :system_time + + defguard is_kw_system_user(node) when elem(hd(elem(node, 1)), 1) == :system_user + + defguard is_kw_table(node) when elem(hd(elem(node, 1)), 1) == :table + + defguard is_kw_tablesample(node) when elem(hd(elem(node, 1)), 1) == :tablesample + + defguard is_kw_tan(node) when elem(hd(elem(node, 1)), 1) == :tan + + defguard is_kw_tanh(node) when elem(hd(elem(node, 1)), 1) == :tanh + + defguard is_kw_then(node) when elem(hd(elem(node, 1)), 1) == :then + + defguard is_kw_time(node) when elem(hd(elem(node, 1)), 1) == :time + + defguard is_kw_timestamp(node) when elem(hd(elem(node, 1)), 1) == :timestamp + + defguard is_kw_timezone_hour(node) when elem(hd(elem(node, 1)), 1) == :timezone_hour + + defguard is_kw_timezone_minute(node) when elem(hd(elem(node, 1)), 1) == :timezone_minute + + defguard is_kw_to(node) when elem(hd(elem(node, 1)), 1) == :to + + defguard is_kw_trailing(node) when elem(hd(elem(node, 1)), 1) == :trailing + + defguard is_kw_translate(node) when elem(hd(elem(node, 1)), 1) == :translate + + defguard is_kw_translate_regex(node) when elem(hd(elem(node, 1)), 1) == :translate_regex + + defguard is_kw_translation(node) when elem(hd(elem(node, 1)), 1) == :translation + + defguard is_kw_treat(node) when elem(hd(elem(node, 1)), 1) == :treat + + defguard is_kw_trigger(node) when elem(hd(elem(node, 1)), 1) == :trigger + + defguard is_kw_trim(node) when elem(hd(elem(node, 1)), 1) == :trim + + defguard is_kw_trim_array(node) when elem(hd(elem(node, 1)), 1) == :trim_array + + defguard is_kw_true(node) when elem(hd(elem(node, 1)), 1) == true + + defguard is_kw_truncate(node) when elem(hd(elem(node, 1)), 1) == :truncate + + defguard is_kw_uescape(node) when elem(hd(elem(node, 1)), 1) == :uescape + + defguard is_kw_union(node) when elem(hd(elem(node, 1)), 1) == :union + + defguard is_kw_unique(node) when elem(hd(elem(node, 1)), 1) == :unique + + defguard is_kw_unknown(node) when elem(hd(elem(node, 1)), 1) == :unknown + + defguard is_kw_unnest(node) when elem(hd(elem(node, 1)), 1) == :unnest + + defguard is_kw_update(node) when elem(hd(elem(node, 1)), 1) == :update + + defguard is_kw_upper(node) when elem(hd(elem(node, 1)), 1) == :upper + + defguard is_kw_user(node) when elem(hd(elem(node, 1)), 1) == :user + + defguard is_kw_using(node) when elem(hd(elem(node, 1)), 1) == :using + + defguard is_kw_value(node) when elem(hd(elem(node, 1)), 1) == :value + + defguard is_kw_values(node) when elem(hd(elem(node, 1)), 1) == :values + + defguard is_kw_value_of(node) when elem(hd(elem(node, 1)), 1) == :value_of + + defguard is_kw_var_pop(node) when elem(hd(elem(node, 1)), 1) == :var_pop + + defguard is_kw_var_samp(node) when elem(hd(elem(node, 1)), 1) == :var_samp + + defguard is_kw_varbinary(node) when elem(hd(elem(node, 1)), 1) == :varbinary + + defguard is_kw_varchar(node) when elem(hd(elem(node, 1)), 1) == :varchar + + defguard is_kw_varying(node) when elem(hd(elem(node, 1)), 1) == :varying + + defguard is_kw_versioning(node) when elem(hd(elem(node, 1)), 1) == :versioning + + defguard is_kw_when(node) when elem(hd(elem(node, 1)), 1) == :when + + defguard is_kw_whenever(node) when elem(hd(elem(node, 1)), 1) == :whenever + + defguard is_kw_where(node) when elem(hd(elem(node, 1)), 1) == :where + + defguard is_kw_width_bucket(node) when elem(hd(elem(node, 1)), 1) == :width_bucket + + defguard is_kw_window(node) when elem(hd(elem(node, 1)), 1) == :window + + defguard is_kw_with(node) when elem(hd(elem(node, 1)), 1) == :with + + defguard is_kw_within(node) when elem(hd(elem(node, 1)), 1) == :within + + defguard is_kw_without(node) when elem(hd(elem(node, 1)), 1) == :without + + defguard is_kw_year(node) when elem(hd(elem(node, 1)), 1) == :year + + defguard is_kw_limit(node) when elem(hd(elem(node, 1)), 1) == :limit + + defguard is_kw_ilike(node) when elem(hd(elem(node, 1)), 1) == :ilike + + defguard is_kw_backward(node) when elem(hd(elem(node, 1)), 1) == :backward + + defguard is_kw_forward(node) when elem(hd(elem(node, 1)), 1) == :forward + + defguard is_kw_isnull(node) when elem(hd(elem(node, 1)), 1) == :isnull + + defguard is_kw_notnull(node) when elem(hd(elem(node, 1)), 1) == :notnull + + defguard is_kw_datetime(node) when elem(hd(elem(node, 1)), 1) == :datetime + + defguard is_kw_flag(node) when elem(hd(elem(node, 1)), 1) == :flag + + defguard is_kw_keyvalue(node) when elem(hd(elem(node, 1)), 1) == :keyvalue + + defguard is_kw_last(node) when elem(hd(elem(node, 1)), 1) == :last + + defguard is_kw_lax(node) when elem(hd(elem(node, 1)), 1) == :lax + + defguard is_kw_number(node) when elem(hd(elem(node, 1)), 1) == :number + + defguard is_kw_size(node) when elem(hd(elem(node, 1)), 1) == :size + + defguard is_kw_starts(node) when elem(hd(elem(node, 1)), 1) == :starts + + defguard is_kw_strict(node) when elem(hd(elem(node, 1)), 1) == :strict + + defguard is_kw_string(node) when elem(hd(elem(node, 1)), 1) == :string + + defguard is_kw_time_tz(node) when elem(hd(elem(node, 1)), 1) == :time_tz + + defguard is_kw_timestamp_tz(node) when elem(hd(elem(node, 1)), 1) == :timestamp_tz + + defguard is_kw_type(node) when elem(hd(elem(node, 1)), 1) == :type + + defguard is_kw_a(node) when elem(hd(elem(node, 1)), 1) == :a + + defguard is_kw_absolute(node) when elem(hd(elem(node, 1)), 1) == :absolute + + defguard is_kw_action(node) when elem(hd(elem(node, 1)), 1) == :action + + defguard is_kw_ada(node) when elem(hd(elem(node, 1)), 1) == :ada + + defguard is_kw_add(node) when elem(hd(elem(node, 1)), 1) == :add + + defguard is_kw_admin(node) when elem(hd(elem(node, 1)), 1) == :admin + + defguard is_kw_after(node) when elem(hd(elem(node, 1)), 1) == :after + + defguard is_kw_always(node) when elem(hd(elem(node, 1)), 1) == :always + + defguard is_kw_asc(node) when elem(hd(elem(node, 1)), 1) == :asc + + defguard is_kw_assertion(node) when elem(hd(elem(node, 1)), 1) == :assertion + + defguard is_kw_assignment(node) when elem(hd(elem(node, 1)), 1) == :assignment + + defguard is_kw_attribute(node) when elem(hd(elem(node, 1)), 1) == :attribute + + defguard is_kw_attributes(node) when elem(hd(elem(node, 1)), 1) == :attributes + + defguard is_kw_before(node) when elem(hd(elem(node, 1)), 1) == :before + + defguard is_kw_bernoulli(node) when elem(hd(elem(node, 1)), 1) == :bernoulli + + defguard is_kw_breadth(node) when elem(hd(elem(node, 1)), 1) == :breadth + + defguard is_kw_c(node) when elem(hd(elem(node, 1)), 1) == :c + + defguard is_kw_cascade(node) when elem(hd(elem(node, 1)), 1) == :cascade + + defguard is_kw_catalog(node) when elem(hd(elem(node, 1)), 1) == :catalog + + defguard is_kw_catalog_name(node) when elem(hd(elem(node, 1)), 1) == :catalog_name + + defguard is_kw_chain(node) when elem(hd(elem(node, 1)), 1) == :chain + + defguard is_kw_chaining(node) when elem(hd(elem(node, 1)), 1) == :chaining + + defguard is_kw_character_set_catalog(node) when elem(hd(elem(node, 1)), 1) == :character_set_catalog + + defguard is_kw_character_set_name(node) when elem(hd(elem(node, 1)), 1) == :character_set_name + + defguard is_kw_character_set_schema(node) when elem(hd(elem(node, 1)), 1) == :character_set_schema + + defguard is_kw_characteristics(node) when elem(hd(elem(node, 1)), 1) == :characteristics + + defguard is_kw_characters(node) when elem(hd(elem(node, 1)), 1) == :characters + + defguard is_kw_class_origin(node) when elem(hd(elem(node, 1)), 1) == :class_origin + + defguard is_kw_cobol(node) when elem(hd(elem(node, 1)), 1) == :cobol + + defguard is_kw_collation(node) when elem(hd(elem(node, 1)), 1) == :collation + + defguard is_kw_collation_catalog(node) when elem(hd(elem(node, 1)), 1) == :collation_catalog + + defguard is_kw_collation_name(node) when elem(hd(elem(node, 1)), 1) == :collation_name + + defguard is_kw_collation_schema(node) when elem(hd(elem(node, 1)), 1) == :collation_schema + + defguard is_kw_columns(node) when elem(hd(elem(node, 1)), 1) == :columns + + defguard is_kw_column_name(node) when elem(hd(elem(node, 1)), 1) == :column_name + + defguard is_kw_command_function(node) when elem(hd(elem(node, 1)), 1) == :command_function + + defguard is_kw_command_function_code(node) when elem(hd(elem(node, 1)), 1) == :command_function_code + + defguard is_kw_committed(node) when elem(hd(elem(node, 1)), 1) == :committed + + defguard is_kw_conditional(node) when elem(hd(elem(node, 1)), 1) == :conditional + + defguard is_kw_condition_number(node) when elem(hd(elem(node, 1)), 1) == :condition_number + + defguard is_kw_connection(node) when elem(hd(elem(node, 1)), 1) == :connection + + defguard is_kw_connection_name(node) when elem(hd(elem(node, 1)), 1) == :connection_name + + defguard is_kw_constraint_catalog(node) when elem(hd(elem(node, 1)), 1) == :constraint_catalog + + defguard is_kw_constraint_name(node) when elem(hd(elem(node, 1)), 1) == :constraint_name + + defguard is_kw_constraint_schema(node) when elem(hd(elem(node, 1)), 1) == :constraint_schema + + defguard is_kw_constraints(node) when elem(hd(elem(node, 1)), 1) == :constraints + + defguard is_kw_constructor(node) when elem(hd(elem(node, 1)), 1) == :constructor + + defguard is_kw_continue(node) when elem(hd(elem(node, 1)), 1) == :continue + + defguard is_kw_copartition(node) when elem(hd(elem(node, 1)), 1) == :copartition + + defguard is_kw_cursor_name(node) when elem(hd(elem(node, 1)), 1) == :cursor_name + + defguard is_kw_data(node) when elem(hd(elem(node, 1)), 1) == :data + + defguard is_kw_datetime_interval_code(node) when elem(hd(elem(node, 1)), 1) == :datetime_interval_code + + defguard is_kw_datetime_interval_precision(node) when elem(hd(elem(node, 1)), 1) == :datetime_interval_precision + + defguard is_kw_defaults(node) when elem(hd(elem(node, 1)), 1) == :defaults + + defguard is_kw_deferrable(node) when elem(hd(elem(node, 1)), 1) == :deferrable + + defguard is_kw_deferred(node) when elem(hd(elem(node, 1)), 1) == :deferred + + defguard is_kw_defined(node) when elem(hd(elem(node, 1)), 1) == :defined + + defguard is_kw_definer(node) when elem(hd(elem(node, 1)), 1) == :definer + + defguard is_kw_degree(node) when elem(hd(elem(node, 1)), 1) == :degree + + defguard is_kw_depth(node) when elem(hd(elem(node, 1)), 1) == :depth + + defguard is_kw_derived(node) when elem(hd(elem(node, 1)), 1) == :derived + + defguard is_kw_desc(node) when elem(hd(elem(node, 1)), 1) == :desc + + defguard is_kw_descriptor(node) when elem(hd(elem(node, 1)), 1) == :descriptor + + defguard is_kw_diagnostics(node) when elem(hd(elem(node, 1)), 1) == :diagnostics + + defguard is_kw_dispatch(node) when elem(hd(elem(node, 1)), 1) == :dispatch + + defguard is_kw_domain(node) when elem(hd(elem(node, 1)), 1) == :domain + + defguard is_kw_dynamic_function(node) when elem(hd(elem(node, 1)), 1) == :dynamic_function + + defguard is_kw_dynamic_function_code(node) when elem(hd(elem(node, 1)), 1) == :dynamic_function_code + + defguard is_kw_encoding(node) when elem(hd(elem(node, 1)), 1) == :encoding + + defguard is_kw_enforced(node) when elem(hd(elem(node, 1)), 1) == :enforced + + defguard is_kw_error(node) when elem(hd(elem(node, 1)), 1) == :error + + defguard is_kw_exclude(node) when elem(hd(elem(node, 1)), 1) == :exclude + + defguard is_kw_excluding(node) when elem(hd(elem(node, 1)), 1) == :excluding + + defguard is_kw_expression(node) when elem(hd(elem(node, 1)), 1) == :expression + + defguard is_kw_final(node) when elem(hd(elem(node, 1)), 1) == :final + + defguard is_kw_finish(node) when elem(hd(elem(node, 1)), 1) == :finish + + defguard is_kw_first(node) when elem(hd(elem(node, 1)), 1) == :first + + defguard is_kw_following(node) when elem(hd(elem(node, 1)), 1) == :following + + defguard is_kw_format(node) when elem(hd(elem(node, 1)), 1) == :format + + defguard is_kw_fortran(node) when elem(hd(elem(node, 1)), 1) == :fortran + + defguard is_kw_found(node) when elem(hd(elem(node, 1)), 1) == :found + + defguard is_kw_fulfill(node) when elem(hd(elem(node, 1)), 1) == :fulfill + + defguard is_kw_g(node) when elem(hd(elem(node, 1)), 1) == :g + + defguard is_kw_general(node) when elem(hd(elem(node, 1)), 1) == :general + + defguard is_kw_generated(node) when elem(hd(elem(node, 1)), 1) == :generated + + defguard is_kw_go(node) when elem(hd(elem(node, 1)), 1) == :go + + defguard is_kw_goto(node) when elem(hd(elem(node, 1)), 1) == :goto + + defguard is_kw_granted(node) when elem(hd(elem(node, 1)), 1) == :granted + + defguard is_kw_hierarchy(node) when elem(hd(elem(node, 1)), 1) == :hierarchy + + defguard is_kw_ignore(node) when elem(hd(elem(node, 1)), 1) == :ignore + + defguard is_kw_immediate(node) when elem(hd(elem(node, 1)), 1) == :immediate + + defguard is_kw_immediately(node) when elem(hd(elem(node, 1)), 1) == :immediately + + defguard is_kw_implementation(node) when elem(hd(elem(node, 1)), 1) == :implementation + + defguard is_kw_including(node) when elem(hd(elem(node, 1)), 1) == :including + + defguard is_kw_increment(node) when elem(hd(elem(node, 1)), 1) == :increment + + defguard is_kw_initially(node) when elem(hd(elem(node, 1)), 1) == :initially + + defguard is_kw_input(node) when elem(hd(elem(node, 1)), 1) == :input + + defguard is_kw_instance(node) when elem(hd(elem(node, 1)), 1) == :instance + + defguard is_kw_instantiable(node) when elem(hd(elem(node, 1)), 1) == :instantiable + + defguard is_kw_instead(node) when elem(hd(elem(node, 1)), 1) == :instead + + defguard is_kw_invoker(node) when elem(hd(elem(node, 1)), 1) == :invoker + + defguard is_kw_isolation(node) when elem(hd(elem(node, 1)), 1) == :isolation + + defguard is_kw_k(node) when elem(hd(elem(node, 1)), 1) == :k + + defguard is_kw_keep(node) when elem(hd(elem(node, 1)), 1) == :keep + + defguard is_kw_key(node) when elem(hd(elem(node, 1)), 1) == :key + + defguard is_kw_keys(node) when elem(hd(elem(node, 1)), 1) == :keys + + defguard is_kw_key_member(node) when elem(hd(elem(node, 1)), 1) == :key_member + + defguard is_kw_key_type(node) when elem(hd(elem(node, 1)), 1) == :key_type + + defguard is_kw_length(node) when elem(hd(elem(node, 1)), 1) == :length + + defguard is_kw_level(node) when elem(hd(elem(node, 1)), 1) == :level + + defguard is_kw_locator(node) when elem(hd(elem(node, 1)), 1) == :locator + + defguard is_kw_m(node) when elem(hd(elem(node, 1)), 1) == :m + + defguard is_kw_map(node) when elem(hd(elem(node, 1)), 1) == :map + + defguard is_kw_matched(node) when elem(hd(elem(node, 1)), 1) == :matched + + defguard is_kw_maxvalue(node) when elem(hd(elem(node, 1)), 1) == :maxvalue + + defguard is_kw_measures(node) when elem(hd(elem(node, 1)), 1) == :measures + + defguard is_kw_message_length(node) when elem(hd(elem(node, 1)), 1) == :message_length + + defguard is_kw_message_octet_length(node) when elem(hd(elem(node, 1)), 1) == :message_octet_length + + defguard is_kw_message_text(node) when elem(hd(elem(node, 1)), 1) == :message_text + + defguard is_kw_minvalue(node) when elem(hd(elem(node, 1)), 1) == :minvalue + + defguard is_kw_more(node) when elem(hd(elem(node, 1)), 1) == :more + + defguard is_kw_mumps(node) when elem(hd(elem(node, 1)), 1) == :mumps + + defguard is_kw_name(node) when elem(hd(elem(node, 1)), 1) == :name + + defguard is_kw_names(node) when elem(hd(elem(node, 1)), 1) == :names + + defguard is_kw_nested(node) when elem(hd(elem(node, 1)), 1) == :nested + + defguard is_kw_nesting(node) when elem(hd(elem(node, 1)), 1) == :nesting + + defguard is_kw_next(node) when elem(hd(elem(node, 1)), 1) == :next + + defguard is_kw_nfc(node) when elem(hd(elem(node, 1)), 1) == :nfc + + defguard is_kw_nfd(node) when elem(hd(elem(node, 1)), 1) == :nfd + + defguard is_kw_nfkc(node) when elem(hd(elem(node, 1)), 1) == :nfkc + + defguard is_kw_nfkd(node) when elem(hd(elem(node, 1)), 1) == :nfkd + + defguard is_kw_normalized(node) when elem(hd(elem(node, 1)), 1) == :normalized + + defguard is_kw_null_ordering(node) when elem(hd(elem(node, 1)), 1) == :null_ordering + + defguard is_kw_nullable(node) when elem(hd(elem(node, 1)), 1) == :nullable + + defguard is_kw_nulls(node) when elem(hd(elem(node, 1)), 1) == :nulls + + defguard is_kw_object(node) when elem(hd(elem(node, 1)), 1) == :object + + defguard is_kw_occurrence(node) when elem(hd(elem(node, 1)), 1) == :occurrence + + defguard is_kw_octets(node) when elem(hd(elem(node, 1)), 1) == :octets + + defguard is_kw_option(node) when elem(hd(elem(node, 1)), 1) == :option + + defguard is_kw_options(node) when elem(hd(elem(node, 1)), 1) == :options + + defguard is_kw_ordering(node) when elem(hd(elem(node, 1)), 1) == :ordering + + defguard is_kw_ordinality(node) when elem(hd(elem(node, 1)), 1) == :ordinality + + defguard is_kw_others(node) when elem(hd(elem(node, 1)), 1) == :others + + defguard is_kw_output(node) when elem(hd(elem(node, 1)), 1) == :output + + defguard is_kw_overflow(node) when elem(hd(elem(node, 1)), 1) == :overflow + + defguard is_kw_overriding(node) when elem(hd(elem(node, 1)), 1) == :overriding + + defguard is_kw_p(node) when elem(hd(elem(node, 1)), 1) == :p + + defguard is_kw_pad(node) when elem(hd(elem(node, 1)), 1) == :pad + + defguard is_kw_parameter_mode(node) when elem(hd(elem(node, 1)), 1) == :parameter_mode + + defguard is_kw_parameter_name(node) when elem(hd(elem(node, 1)), 1) == :parameter_name + + defguard is_kw_parameter_ordinal_position(node) when elem(hd(elem(node, 1)), 1) == :parameter_ordinal_position + + defguard is_kw_parameter_specific_catalog(node) when elem(hd(elem(node, 1)), 1) == :parameter_specific_catalog + + defguard is_kw_parameter_specific_name(node) when elem(hd(elem(node, 1)), 1) == :parameter_specific_name + + defguard is_kw_parameter_specific_schema(node) when elem(hd(elem(node, 1)), 1) == :parameter_specific_schema + + defguard is_kw_partial(node) when elem(hd(elem(node, 1)), 1) == :partial + + defguard is_kw_pascal(node) when elem(hd(elem(node, 1)), 1) == :pascal + + defguard is_kw_pass(node) when elem(hd(elem(node, 1)), 1) == :pass + + defguard is_kw_passing(node) when elem(hd(elem(node, 1)), 1) == :passing + + defguard is_kw_past(node) when elem(hd(elem(node, 1)), 1) == :past + + defguard is_kw_path(node) when elem(hd(elem(node, 1)), 1) == :path + + defguard is_kw_permute(node) when elem(hd(elem(node, 1)), 1) == :permute + + defguard is_kw_pipe(node) when elem(hd(elem(node, 1)), 1) == :pipe + + defguard is_kw_placing(node) when elem(hd(elem(node, 1)), 1) == :placing + + defguard is_kw_plan(node) when elem(hd(elem(node, 1)), 1) == :plan + + defguard is_kw_pli(node) when elem(hd(elem(node, 1)), 1) == :pli + + defguard is_kw_preceding(node) when elem(hd(elem(node, 1)), 1) == :preceding + + defguard is_kw_preserve(node) when elem(hd(elem(node, 1)), 1) == :preserve + + defguard is_kw_prev(node) when elem(hd(elem(node, 1)), 1) == :prev + + defguard is_kw_prior(node) when elem(hd(elem(node, 1)), 1) == :prior + + defguard is_kw_private(node) when elem(hd(elem(node, 1)), 1) == :private + + defguard is_kw_privileges(node) when elem(hd(elem(node, 1)), 1) == :privileges + + defguard is_kw_prune(node) when elem(hd(elem(node, 1)), 1) == :prune + + defguard is_kw_public(node) when elem(hd(elem(node, 1)), 1) == :public + + defguard is_kw_quotes(node) when elem(hd(elem(node, 1)), 1) == :quotes + + defguard is_kw_read(node) when elem(hd(elem(node, 1)), 1) == :read + + defguard is_kw_relative(node) when elem(hd(elem(node, 1)), 1) == :relative + + defguard is_kw_repeatable(node) when elem(hd(elem(node, 1)), 1) == :repeatable + + defguard is_kw_respect(node) when elem(hd(elem(node, 1)), 1) == :respect + + defguard is_kw_restart(node) when elem(hd(elem(node, 1)), 1) == :restart + + defguard is_kw_restrict(node) when elem(hd(elem(node, 1)), 1) == :restrict + + defguard is_kw_returned_cardinality(node) when elem(hd(elem(node, 1)), 1) == :returned_cardinality + + defguard is_kw_returned_length(node) when elem(hd(elem(node, 1)), 1) == :returned_length + + defguard is_kw_returned_octet_length(node) when elem(hd(elem(node, 1)), 1) == :returned_octet_length + + defguard is_kw_returned_sqlstate(node) when elem(hd(elem(node, 1)), 1) == :returned_sqlstate + + defguard is_kw_returning(node) when elem(hd(elem(node, 1)), 1) == :returning + + defguard is_kw_role(node) when elem(hd(elem(node, 1)), 1) == :role + + defguard is_kw_routine(node) when elem(hd(elem(node, 1)), 1) == :routine + + defguard is_kw_routine_catalog(node) when elem(hd(elem(node, 1)), 1) == :routine_catalog + + defguard is_kw_routine_name(node) when elem(hd(elem(node, 1)), 1) == :routine_name + + defguard is_kw_routine_schema(node) when elem(hd(elem(node, 1)), 1) == :routine_schema + + defguard is_kw_row_count(node) when elem(hd(elem(node, 1)), 1) == :row_count + + defguard is_kw_scalar(node) when elem(hd(elem(node, 1)), 1) == :scalar + + defguard is_kw_scale(node) when elem(hd(elem(node, 1)), 1) == :scale + + defguard is_kw_schema(node) when elem(hd(elem(node, 1)), 1) == :schema + + defguard is_kw_schema_name(node) when elem(hd(elem(node, 1)), 1) == :schema_name + + defguard is_kw_scope_catalog(node) when elem(hd(elem(node, 1)), 1) == :scope_catalog + + defguard is_kw_scope_name(node) when elem(hd(elem(node, 1)), 1) == :scope_name + + defguard is_kw_scope_schema(node) when elem(hd(elem(node, 1)), 1) == :scope_schema + + defguard is_kw_section(node) when elem(hd(elem(node, 1)), 1) == :section + + defguard is_kw_security(node) when elem(hd(elem(node, 1)), 1) == :security + + defguard is_kw_self(node) when elem(hd(elem(node, 1)), 1) == :self + + defguard is_kw_semantics(node) when elem(hd(elem(node, 1)), 1) == :semantics + + defguard is_kw_sequence(node) when elem(hd(elem(node, 1)), 1) == :sequence + + defguard is_kw_serializable(node) when elem(hd(elem(node, 1)), 1) == :serializable + + defguard is_kw_server_name(node) when elem(hd(elem(node, 1)), 1) == :server_name + + defguard is_kw_session(node) when elem(hd(elem(node, 1)), 1) == :session + + defguard is_kw_sets(node) when elem(hd(elem(node, 1)), 1) == :sets + + defguard is_kw_simple(node) when elem(hd(elem(node, 1)), 1) == :simple + + defguard is_kw_sort_direction(node) when elem(hd(elem(node, 1)), 1) == :sort_direction + + defguard is_kw_source(node) when elem(hd(elem(node, 1)), 1) == :source + + defguard is_kw_space(node) when elem(hd(elem(node, 1)), 1) == :space + + defguard is_kw_specific_name(node) when elem(hd(elem(node, 1)), 1) == :specific_name + + defguard is_kw_state(node) when elem(hd(elem(node, 1)), 1) == :state + + defguard is_kw_statement(node) when elem(hd(elem(node, 1)), 1) == :statement + + defguard is_kw_structure(node) when elem(hd(elem(node, 1)), 1) == :structure + + defguard is_kw_style(node) when elem(hd(elem(node, 1)), 1) == :style + + defguard is_kw_subclass_origin(node) when elem(hd(elem(node, 1)), 1) == :subclass_origin + + defguard is_kw_t(node) when elem(hd(elem(node, 1)), 1) == :t + + defguard is_kw_table_name(node) when elem(hd(elem(node, 1)), 1) == :table_name + + defguard is_kw_temporary(node) when elem(hd(elem(node, 1)), 1) == :temporary + + defguard is_kw_through(node) when elem(hd(elem(node, 1)), 1) == :through + + defguard is_kw_ties(node) when elem(hd(elem(node, 1)), 1) == :ties + + defguard is_kw_top_level_count(node) when elem(hd(elem(node, 1)), 1) == :top_level_count + + defguard is_kw_transaction(node) when elem(hd(elem(node, 1)), 1) == :transaction + + defguard is_kw_transaction_active(node) when elem(hd(elem(node, 1)), 1) == :transaction_active + + defguard is_kw_transactions_committed(node) when elem(hd(elem(node, 1)), 1) == :transactions_committed + + defguard is_kw_transactions_rolled_back(node) when elem(hd(elem(node, 1)), 1) == :transactions_rolled_back + + defguard is_kw_transform(node) when elem(hd(elem(node, 1)), 1) == :transform + + defguard is_kw_transforms(node) when elem(hd(elem(node, 1)), 1) == :transforms + + defguard is_kw_trigger_catalog(node) when elem(hd(elem(node, 1)), 1) == :trigger_catalog + + defguard is_kw_trigger_name(node) when elem(hd(elem(node, 1)), 1) == :trigger_name + + defguard is_kw_trigger_schema(node) when elem(hd(elem(node, 1)), 1) == :trigger_schema + + defguard is_kw_unbounded(node) when elem(hd(elem(node, 1)), 1) == :unbounded + + defguard is_kw_uncommitted(node) when elem(hd(elem(node, 1)), 1) == :uncommitted + + defguard is_kw_unconditional(node) when elem(hd(elem(node, 1)), 1) == :unconditional + + defguard is_kw_under(node) when elem(hd(elem(node, 1)), 1) == :under + + defguard is_kw_unmatched(node) when elem(hd(elem(node, 1)), 1) == :unmatched + + defguard is_kw_unnamed(node) when elem(hd(elem(node, 1)), 1) == :unnamed + + defguard is_kw_usage(node) when elem(hd(elem(node, 1)), 1) == :usage + + defguard is_kw_user_defined_type_catalog(node) when elem(hd(elem(node, 1)), 1) == :user_defined_type_catalog + + defguard is_kw_user_defined_type_code(node) when elem(hd(elem(node, 1)), 1) == :user_defined_type_code + + defguard is_kw_user_defined_type_name(node) when elem(hd(elem(node, 1)), 1) == :user_defined_type_name + + defguard is_kw_user_defined_type_schema(node) when elem(hd(elem(node, 1)), 1) == :user_defined_type_schema + + defguard is_kw_utf16(node) when elem(hd(elem(node, 1)), 1) == :utf16 + + defguard is_kw_utf32(node) when elem(hd(elem(node, 1)), 1) == :utf32 + + defguard is_kw_utf8(node) when elem(hd(elem(node, 1)), 1) == :utf8 + + defguard is_kw_view(node) when elem(hd(elem(node, 1)), 1) == :view + + defguard is_kw_work(node) when elem(hd(elem(node, 1)), 1) == :work + + defguard is_kw_wrapper(node) when elem(hd(elem(node, 1)), 1) == :wrapper + + defguard is_kw_write(node) when elem(hd(elem(node, 1)), 1) == :write + + defguard is_kw_zone(node) when elem(hd(elem(node, 1)), 1) == :zone + + + + def tag([[[[], b1], b2], b3]) when is_a(b1) and is_b(b2) and is_s(b3), do: {:reserved, :abs} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_a(b1) and is_b(b2) and is_s(b3) and is_e(b4) and is_n(b5) and is_t(b6), do: {:reserved, :absent} + + def tag([[[[[], b1], b2], b3], b4]) when is_a(b1) and is_c(b2) and is_o(b3) and is_s(b4), do: {:reserved, :acos} + + def tag([[[[], b1], b2], b3]) when is_a(b1) and is_l(b2) and is_l(b3), do: {:reserved, :all} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_a(b1) and is_l(b2) and is_l(b3) and is_o(b4) and is_c(b5) and is_a(b6) and is_t(b7) and is_e(b8), do: {:reserved, :allocate} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_a(b1) and is_l(b2) and is_t(b3) and is_e(b4) and is_r(b5), do: {:reserved, :alter} + + def tag([[[[], b1], b2], b3]) when is_a(b1) and is_n(b2) and is_d(b3), do: {:reserved, :and} + + def tag([[[[], b1], b2], b3]) when is_a(b1) and is_n(b2) and is_y(b3), do: {:reserved, :any} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_a(b1) and is_n(b2) and is_y(b3) and b4 in ~c"_" and is_v(b5) and is_a(b6) and is_l(b7) and is_u(b8) and is_e(b9), do: {:reserved, :any_value} + + def tag([[[[], b1], b2], b3]) when is_a(b1) and is_r(b2) and is_e(b3), do: {:reserved, :are} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_a(b1) and is_r(b2) and is_r(b3) and is_a(b4) and is_y(b5), do: {:reserved, :array} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_a(b1) and is_r(b2) and is_r(b3) and is_a(b4) and is_y(b5) and b6 in ~c"_" and is_a(b7) and is_g(b8) and is_g(b9), do: {:reserved, :array_agg} + + def tag([[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21]) when is_a(b1) and is_r(b2) and is_r(b3) and is_a(b4) and is_y(b5) and b6 in ~c"_" and is_m(b7) and is_a(b8) and is_x(b9) and b10 in ~c"_" and is_c(b11) and is_a(b12) and is_r(b13) and is_d(b14) and is_i(b15) and is_n(b16) and is_a(b17) and is_l(b18) and is_i(b19) and is_t(b20) and is_y(b21), do: {:reserved, :array_max_cardinality} + + def tag([[[], b1], b2]) when is_a(b1) and is_s(b2), do: {:reserved, :as} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_a(b1) and is_s(b2) and is_e(b3) and is_n(b4) and is_s(b5) and is_i(b6) and is_t(b7) and is_i(b8) and is_v(b9) and is_e(b10), do: {:reserved, :asensitive} + + def tag([[[[[], b1], b2], b3], b4]) when is_a(b1) and is_s(b2) and is_i(b3) and is_n(b4), do: {:reserved, :asin} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_a(b1) and is_s(b2) and is_y(b3) and is_m(b4) and is_m(b5) and is_e(b6) and is_t(b7) and is_r(b8) and is_i(b9) and is_c(b10), do: {:reserved, :asymmetric} + + def tag([[[], b1], b2]) when is_a(b1) and is_t(b2), do: {:reserved, :at} + + def tag([[[[[], b1], b2], b3], b4]) when is_a(b1) and is_t(b2) and is_a(b3) and is_n(b4), do: {:reserved, :atan} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_a(b1) and is_t(b2) and is_o(b3) and is_m(b4) and is_i(b5) and is_c(b6), do: {:reserved, :atomic} + + def tag([[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when is_a(b1) and is_u(b2) and is_t(b3) and is_h(b4) and is_o(b5) and is_r(b6) and is_i(b7) and is_z(b8) and is_a(b9) and is_t(b10) and is_i(b11) and is_o(b12) and is_n(b13), do: {:reserved, :authorization} + + def tag([[[[], b1], b2], b3]) when is_a(b1) and is_v(b2) and is_g(b3), do: {:reserved, :avg} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_b(b1) and is_e(b2) and is_g(b3) and is_i(b4) and is_n(b5), do: {:reserved, :begin} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_b(b1) and is_e(b2) and is_g(b3) and is_i(b4) and is_n(b5) and b6 in ~c"_" and is_f(b7) and is_r(b8) and is_a(b9) and is_m(b10) and is_e(b11), do: {:reserved, :begin_frame} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_b(b1) and is_e(b2) and is_g(b3) and is_i(b4) and is_n(b5) and b6 in ~c"_" and is_p(b7) and is_a(b8) and is_r(b9) and is_t(b10) and is_i(b11) and is_t(b12) and is_i(b13) and is_o(b14) and is_n(b15), do: {:reserved, :begin_partition} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_b(b1) and is_e(b2) and is_t(b3) and is_w(b4) and is_e(b5) and is_e(b6) and is_n(b7), do: {:reserved, :between} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_b(b1) and is_i(b2) and is_g(b3) and is_i(b4) and is_n(b5) and is_t(b6), do: {:reserved, :bigint} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_b(b1) and is_i(b2) and is_n(b3) and is_a(b4) and is_r(b5) and is_y(b6), do: {:reserved, :binary} + + def tag([[[[[], b1], b2], b3], b4]) when is_b(b1) and is_l(b2) and is_o(b3) and is_b(b4), do: {:reserved, :blob} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_b(b1) and is_o(b2) and is_o(b3) and is_l(b4) and is_e(b5) and is_a(b6) and is_n(b7), do: {:reserved, :boolean} + + def tag([[[[[], b1], b2], b3], b4]) when is_b(b1) and is_o(b2) and is_t(b3) and is_h(b4), do: {:reserved, :both} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_b(b1) and is_t(b2) and is_r(b3) and is_i(b4) and is_m(b5), do: {:reserved, :btrim} + + def tag([[[], b1], b2]) when is_b(b1) and is_y(b2), do: {:reserved, :by} + + def tag([[[[[], b1], b2], b3], b4]) when is_c(b1) and is_a(b2) and is_l(b3) and is_l(b4), do: {:reserved, :call} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_c(b1) and is_a(b2) and is_l(b3) and is_l(b4) and is_e(b5) and is_d(b6), do: {:reserved, :called} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_c(b1) and is_a(b2) and is_r(b3) and is_d(b4) and is_i(b5) and is_n(b6) and is_a(b7) and is_l(b8) and is_i(b9) and is_t(b10) and is_y(b11), do: {:reserved, :cardinality} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_c(b1) and is_a(b2) and is_s(b3) and is_c(b4) and is_a(b5) and is_d(b6) and is_e(b7) and is_d(b8), do: {:reserved, :cascaded} + + def tag([[[[[], b1], b2], b3], b4]) when is_c(b1) and is_a(b2) and is_s(b3) and is_e(b4), do: {:reserved, :case} + + def tag([[[[[], b1], b2], b3], b4]) when is_c(b1) and is_a(b2) and is_s(b3) and is_t(b4), do: {:reserved, :cast} + + def tag([[[[[], b1], b2], b3], b4]) when is_c(b1) and is_e(b2) and is_i(b3) and is_l(b4), do: {:reserved, :ceil} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_c(b1) and is_e(b2) and is_i(b3) and is_l(b4) and is_i(b5) and is_n(b6) and is_g(b7), do: {:reserved, :ceiling} + + def tag([[[[[], b1], b2], b3], b4]) when is_c(b1) and is_h(b2) and is_a(b3) and is_r(b4), do: {:reserved, :char} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_c(b1) and is_h(b2) and is_a(b3) and is_r(b4) and b5 in ~c"_" and is_l(b6) and is_e(b7) and is_n(b8) and is_g(b9) and is_t(b10) and is_h(b11), do: {:reserved, :char_length} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_c(b1) and is_h(b2) and is_a(b3) and is_r(b4) and is_a(b5) and is_c(b6) and is_t(b7) and is_e(b8) and is_r(b9), do: {:reserved, :character} + + def tag([[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16]) when is_c(b1) and is_h(b2) and is_a(b3) and is_r(b4) and is_a(b5) and is_c(b6) and is_t(b7) and is_e(b8) and is_r(b9) and b10 in ~c"_" and is_l(b11) and is_e(b12) and is_n(b13) and is_g(b14) and is_t(b15) and is_h(b16), do: {:reserved, :character_length} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_c(b1) and is_h(b2) and is_e(b3) and is_c(b4) and is_k(b5), do: {:reserved, :check} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_c(b1) and is_l(b2) and is_a(b3) and is_s(b4) and is_s(b5) and is_i(b6) and is_f(b7) and is_i(b8) and is_e(b9) and is_r(b10), do: {:reserved, :classifier} + + def tag([[[[[], b1], b2], b3], b4]) when is_c(b1) and is_l(b2) and is_o(b3) and is_b(b4), do: {:reserved, :clob} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_c(b1) and is_l(b2) and is_o(b3) and is_s(b4) and is_e(b5), do: {:reserved, :close} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_c(b1) and is_o(b2) and is_a(b3) and is_l(b4) and is_e(b5) and is_s(b6) and is_c(b7) and is_e(b8), do: {:reserved, :coalesce} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_c(b1) and is_o(b2) and is_l(b3) and is_l(b4) and is_a(b5) and is_t(b6) and is_e(b7), do: {:reserved, :collate} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_c(b1) and is_o(b2) and is_l(b3) and is_l(b4) and is_e(b5) and is_c(b6) and is_t(b7), do: {:reserved, :collect} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_c(b1) and is_o(b2) and is_l(b3) and is_u(b4) and is_m(b5) and is_n(b6), do: {:reserved, :column} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_c(b1) and is_o(b2) and is_m(b3) and is_m(b4) and is_i(b5) and is_t(b6), do: {:reserved, :commit} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_c(b1) and is_o(b2) and is_n(b3) and is_d(b4) and is_i(b5) and is_t(b6) and is_i(b7) and is_o(b8) and is_n(b9), do: {:reserved, :condition} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_c(b1) and is_o(b2) and is_n(b3) and is_n(b4) and is_e(b5) and is_c(b6) and is_t(b7), do: {:reserved, :connect} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_c(b1) and is_o(b2) and is_n(b3) and is_s(b4) and is_t(b5) and is_r(b6) and is_a(b7) and is_i(b8) and is_n(b9) and is_t(b10), do: {:reserved, :constraint} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_c(b1) and is_o(b2) and is_n(b3) and is_t(b4) and is_a(b5) and is_i(b6) and is_n(b7) and is_s(b8), do: {:reserved, :contains} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_c(b1) and is_o(b2) and is_n(b3) and is_v(b4) and is_e(b5) and is_r(b6) and is_t(b7), do: {:reserved, :convert} + + def tag([[[[[], b1], b2], b3], b4]) when is_c(b1) and is_o(b2) and is_p(b3) and is_y(b4), do: {:reserved, :copy} + + def tag([[[[[], b1], b2], b3], b4]) when is_c(b1) and is_o(b2) and is_r(b3) and is_r(b4), do: {:reserved, :corr} + + def tag([[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when is_c(b1) and is_o(b2) and is_r(b3) and is_r(b4) and is_e(b5) and is_s(b6) and is_p(b7) and is_o(b8) and is_n(b9) and is_d(b10) and is_i(b11) and is_n(b12) and is_g(b13), do: {:reserved, :corresponding} + + def tag([[[[], b1], b2], b3]) when is_c(b1) and is_o(b2) and is_s(b3), do: {:reserved, :cos} + + def tag([[[[[], b1], b2], b3], b4]) when is_c(b1) and is_o(b2) and is_s(b3) and is_h(b4), do: {:reserved, :cosh} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_c(b1) and is_o(b2) and is_u(b3) and is_n(b4) and is_t(b5), do: {:reserved, :count} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_c(b1) and is_o(b2) and is_v(b3) and is_a(b4) and is_r(b5) and b6 in ~c"_" and is_p(b7) and is_o(b8) and is_p(b9), do: {:reserved, :covar_pop} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_c(b1) and is_o(b2) and is_v(b3) and is_a(b4) and is_r(b5) and b6 in ~c"_" and is_s(b7) and is_a(b8) and is_m(b9) and is_p(b10), do: {:reserved, :covar_samp} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_c(b1) and is_r(b2) and is_e(b3) and is_a(b4) and is_t(b5) and is_e(b6), do: {:reserved, :create} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_c(b1) and is_r(b2) and is_o(b3) and is_s(b4) and is_s(b5), do: {:reserved, :cross} + + def tag([[[[[], b1], b2], b3], b4]) when is_c(b1) and is_u(b2) and is_b(b3) and is_e(b4), do: {:reserved, :cube} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_c(b1) and is_u(b2) and is_m(b3) and is_e(b4) and b5 in ~c"_" and is_d(b6) and is_i(b7) and is_s(b8) and is_t(b9), do: {:reserved, :cume_dist} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_c(b1) and is_u(b2) and is_r(b3) and is_r(b4) and is_e(b5) and is_n(b6) and is_t(b7), do: {:reserved, :current} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_c(b1) and is_u(b2) and is_r(b3) and is_r(b4) and is_e(b5) and is_n(b6) and is_t(b7) and b8 in ~c"_" and is_c(b9) and is_a(b10) and is_t(b11) and is_a(b12) and is_l(b13) and is_o(b14) and is_g(b15), do: {:reserved, :current_catalog} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_c(b1) and is_u(b2) and is_r(b3) and is_r(b4) and is_e(b5) and is_n(b6) and is_t(b7) and b8 in ~c"_" and is_d(b9) and is_a(b10) and is_t(b11) and is_e(b12), do: {:reserved, :current_date} + + def tag([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24], b25], b26], b27], b28], b29], b30], b31]) when is_c(b1) and is_u(b2) and is_r(b3) and is_r(b4) and is_e(b5) and is_n(b6) and is_t(b7) and b8 in ~c"_" and is_d(b9) and is_e(b10) and is_f(b11) and is_a(b12) and is_u(b13) and is_l(b14) and is_t(b15) and b16 in ~c"_" and is_t(b17) and is_r(b18) and is_a(b19) and is_n(b20) and is_s(b21) and is_f(b22) and is_o(b23) and is_r(b24) and is_m(b25) and b26 in ~c"_" and is_g(b27) and is_r(b28) and is_o(b29) and is_u(b30) and is_p(b31), do: {:reserved, :current_default_transform_group} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_c(b1) and is_u(b2) and is_r(b3) and is_r(b4) and is_e(b5) and is_n(b6) and is_t(b7) and b8 in ~c"_" and is_p(b9) and is_a(b10) and is_t(b11) and is_h(b12), do: {:reserved, :current_path} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_c(b1) and is_u(b2) and is_r(b3) and is_r(b4) and is_e(b5) and is_n(b6) and is_t(b7) and b8 in ~c"_" and is_r(b9) and is_o(b10) and is_l(b11) and is_e(b12), do: {:reserved, :current_role} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_c(b1) and is_u(b2) and is_r(b3) and is_r(b4) and is_e(b5) and is_n(b6) and is_t(b7) and b8 in ~c"_" and is_r(b9) and is_o(b10) and is_w(b11), do: {:reserved, :current_row} + + def tag([[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when is_c(b1) and is_u(b2) and is_r(b3) and is_r(b4) and is_e(b5) and is_n(b6) and is_t(b7) and b8 in ~c"_" and is_s(b9) and is_c(b10) and is_h(b11) and is_e(b12) and is_m(b13) and is_a(b14), do: {:reserved, :current_schema} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_c(b1) and is_u(b2) and is_r(b3) and is_r(b4) and is_e(b5) and is_n(b6) and is_t(b7) and b8 in ~c"_" and is_t(b9) and is_i(b10) and is_m(b11) and is_e(b12), do: {:reserved, :current_time} + + def tag([[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17]) when is_c(b1) and is_u(b2) and is_r(b3) and is_r(b4) and is_e(b5) and is_n(b6) and is_t(b7) and b8 in ~c"_" and is_t(b9) and is_i(b10) and is_m(b11) and is_e(b12) and is_s(b13) and is_t(b14) and is_a(b15) and is_m(b16) and is_p(b17), do: {:reserved, :current_timestamp} + + def tag([[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24], b25], b26], b27], b28], b29], b30], b31], b32]) when is_c(b1) and is_u(b2) and is_r(b3) and is_r(b4) and is_e(b5) and is_n(b6) and is_t(b7) and b8 in ~c"_" and is_t(b9) and is_r(b10) and is_a(b11) and is_n(b12) and is_s(b13) and is_f(b14) and is_o(b15) and is_r(b16) and is_m(b17) and b18 in ~c"_" and is_g(b19) and is_r(b20) and is_o(b21) and is_u(b22) and is_p(b23) and b24 in ~c"_" and is_f(b25) and is_o(b26) and is_r(b27) and b28 in ~c"_" and is_t(b29) and is_y(b30) and is_p(b31) and is_e(b32), do: {:reserved, :current_transform_group_for_type} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_c(b1) and is_u(b2) and is_r(b3) and is_r(b4) and is_e(b5) and is_n(b6) and is_t(b7) and b8 in ~c"_" and is_u(b9) and is_s(b10) and is_e(b11) and is_r(b12), do: {:reserved, :current_user} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_c(b1) and is_u(b2) and is_r(b3) and is_s(b4) and is_o(b5) and is_r(b6), do: {:reserved, :cursor} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_c(b1) and is_y(b2) and is_c(b3) and is_l(b4) and is_e(b5), do: {:reserved, :cycle} + + def tag([[[[[], b1], b2], b3], b4]) when is_d(b1) and is_a(b2) and is_t(b3) and is_e(b4), do: {:reserved, :date} + + def tag([[[[], b1], b2], b3]) when is_d(b1) and is_a(b2) and is_y(b3), do: {:reserved, :day} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_d(b1) and is_e(b2) and is_a(b3) and is_l(b4) and is_l(b5) and is_o(b6) and is_c(b7) and is_a(b8) and is_t(b9) and is_e(b10), do: {:reserved, :deallocate} + + def tag([[[[], b1], b2], b3]) when is_d(b1) and is_e(b2) and is_c(b3), do: {:reserved, :dec} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_d(b1) and is_e(b2) and is_c(b3) and is_f(b4) and is_l(b5) and is_o(b6) and is_a(b7) and is_t(b8), do: {:reserved, :decfloat} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_d(b1) and is_e(b2) and is_c(b3) and is_i(b4) and is_m(b5) and is_a(b6) and is_l(b7), do: {:reserved, :decimal} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_d(b1) and is_e(b2) and is_c(b3) and is_l(b4) and is_a(b5) and is_r(b6) and is_e(b7), do: {:reserved, :declare} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_d(b1) and is_e(b2) and is_f(b3) and is_a(b4) and is_u(b5) and is_l(b6) and is_t(b7), do: {:reserved, :default} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_d(b1) and is_e(b2) and is_f(b3) and is_i(b4) and is_n(b5) and is_e(b6), do: {:reserved, :define} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_d(b1) and is_e(b2) and is_l(b3) and is_e(b4) and is_t(b5) and is_e(b6), do: {:reserved, :delete} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_d(b1) and is_e(b2) and is_n(b3) and is_s(b4) and is_e(b5) and b6 in ~c"_" and is_r(b7) and is_a(b8) and is_n(b9) and is_k(b10), do: {:reserved, :dense_rank} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_d(b1) and is_e(b2) and is_r(b3) and is_e(b4) and is_f(b5), do: {:reserved, :deref} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_d(b1) and is_e(b2) and is_s(b3) and is_c(b4) and is_r(b5) and is_i(b6) and is_b(b7) and is_e(b8), do: {:reserved, :describe} + + def tag([[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when is_d(b1) and is_e(b2) and is_t(b3) and is_e(b4) and is_r(b5) and is_m(b6) and is_i(b7) and is_n(b8) and is_i(b9) and is_s(b10) and is_t(b11) and is_i(b12) and is_c(b13), do: {:reserved, :deterministic} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_d(b1) and is_i(b2) and is_s(b3) and is_c(b4) and is_o(b5) and is_n(b6) and is_n(b7) and is_e(b8) and is_c(b9) and is_t(b10), do: {:reserved, :disconnect} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_d(b1) and is_i(b2) and is_s(b3) and is_t(b4) and is_i(b5) and is_n(b6) and is_c(b7) and is_t(b8), do: {:reserved, :distinct} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_d(b1) and is_o(b2) and is_u(b3) and is_b(b4) and is_l(b5) and is_e(b6), do: {:reserved, :double} + + def tag([[[[[], b1], b2], b3], b4]) when is_d(b1) and is_r(b2) and is_o(b3) and is_p(b4), do: {:reserved, :drop} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_d(b1) and is_y(b2) and is_n(b3) and is_a(b4) and is_m(b5) and is_i(b6) and is_c(b7), do: {:reserved, :dynamic} + + def tag([[[[[], b1], b2], b3], b4]) when is_e(b1) and is_a(b2) and is_c(b3) and is_h(b4), do: {:reserved, :each} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_e(b1) and is_l(b2) and is_e(b3) and is_m(b4) and is_e(b5) and is_n(b6) and is_t(b7), do: {:reserved, :element} + + def tag([[[[[], b1], b2], b3], b4]) when is_e(b1) and is_l(b2) and is_s(b3) and is_e(b4), do: {:reserved, :else} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_e(b1) and is_m(b2) and is_p(b3) and is_t(b4) and is_y(b5), do: {:reserved, :empty} + + def tag([[[[], b1], b2], b3]) when is_e(b1) and is_n(b2) and is_d(b3), do: {:reserved, :end} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_e(b1) and is_n(b2) and is_d(b3) and b4 in ~c"_" and is_f(b5) and is_r(b6) and is_a(b7) and is_m(b8) and is_e(b9), do: {:reserved, :end_frame} + + def tag([[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when is_e(b1) and is_n(b2) and is_d(b3) and b4 in ~c"_" and is_p(b5) and is_a(b6) and is_r(b7) and is_t(b8) and is_i(b9) and is_t(b10) and is_i(b11) and is_o(b12) and is_n(b13), do: {:reserved, :end_partition} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_e(b1) and is_n(b2) and is_d(b3) and b4 in ~c"-" and is_e(b5) and is_x(b6) and is_e(b7) and is_c(b8), do: {:reserved, :"end-exec"} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_e(b1) and is_q(b2) and is_u(b3) and is_a(b4) and is_l(b5) and is_s(b6), do: {:reserved, :equals} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_e(b1) and is_s(b2) and is_c(b3) and is_a(b4) and is_p(b5) and is_e(b6), do: {:reserved, :escape} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_e(b1) and is_v(b2) and is_e(b3) and is_r(b4) and is_y(b5), do: {:reserved, :every} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_e(b1) and is_x(b2) and is_c(b3) and is_e(b4) and is_p(b5) and is_t(b6), do: {:reserved, :except} + + def tag([[[[[], b1], b2], b3], b4]) when is_e(b1) and is_x(b2) and is_e(b3) and is_c(b4), do: {:reserved, :exec} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_e(b1) and is_x(b2) and is_e(b3) and is_c(b4) and is_u(b5) and is_t(b6) and is_e(b7), do: {:reserved, :execute} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_e(b1) and is_x(b2) and is_i(b3) and is_s(b4) and is_t(b5) and is_s(b6), do: {:reserved, :exists} + + def tag([[[[], b1], b2], b3]) when is_e(b1) and is_x(b2) and is_p(b3), do: {:reserved, :exp} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_e(b1) and is_x(b2) and is_t(b3) and is_e(b4) and is_r(b5) and is_n(b6) and is_a(b7) and is_l(b8), do: {:reserved, :external} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_e(b1) and is_x(b2) and is_t(b3) and is_r(b4) and is_a(b5) and is_c(b6) and is_t(b7), do: {:reserved, :extract} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_f(b1) and is_a(b2) and is_l(b3) and is_s(b4) and is_e(b5), do: {:reserved, false} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_f(b1) and is_e(b2) and is_t(b3) and is_c(b4) and is_h(b5), do: {:reserved, :fetch} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_f(b1) and is_i(b2) and is_l(b3) and is_t(b4) and is_e(b5) and is_r(b6), do: {:reserved, :filter} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_f(b1) and is_i(b2) and is_r(b3) and is_s(b4) and is_t(b5) and b6 in ~c"_" and is_v(b7) and is_a(b8) and is_l(b9) and is_u(b10) and is_e(b11), do: {:reserved, :first_value} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_f(b1) and is_l(b2) and is_o(b3) and is_a(b4) and is_t(b5), do: {:reserved, :float} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_f(b1) and is_l(b2) and is_o(b3) and is_o(b4) and is_r(b5), do: {:reserved, :floor} + + def tag([[[[], b1], b2], b3]) when is_f(b1) and is_o(b2) and is_r(b3), do: {:reserved, :for} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_f(b1) and is_o(b2) and is_r(b3) and is_e(b4) and is_i(b5) and is_g(b6) and is_n(b7), do: {:reserved, :foreign} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_f(b1) and is_r(b2) and is_a(b3) and is_m(b4) and is_e(b5) and b6 in ~c"_" and is_r(b7) and is_o(b8) and is_w(b9), do: {:reserved, :frame_row} + + def tag([[[[[], b1], b2], b3], b4]) when is_f(b1) and is_r(b2) and is_e(b3) and is_e(b4), do: {:reserved, :free} + + def tag([[[[[], b1], b2], b3], b4]) when is_f(b1) and is_r(b2) and is_o(b3) and is_m(b4), do: {:reserved, :from} + + def tag([[[[[], b1], b2], b3], b4]) when is_f(b1) and is_u(b2) and is_l(b3) and is_l(b4), do: {:reserved, :full} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_f(b1) and is_u(b2) and is_n(b3) and is_c(b4) and is_t(b5) and is_i(b6) and is_o(b7) and is_n(b8), do: {:reserved, :function} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_f(b1) and is_u(b2) and is_s(b3) and is_i(b4) and is_o(b5) and is_n(b6), do: {:reserved, :fusion} + + def tag([[[[], b1], b2], b3]) when is_g(b1) and is_e(b2) and is_t(b3), do: {:reserved, :get} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_g(b1) and is_l(b2) and is_o(b3) and is_b(b4) and is_a(b5) and is_l(b6), do: {:reserved, :global} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_g(b1) and is_r(b2) and is_a(b3) and is_n(b4) and is_t(b5), do: {:reserved, :grant} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_g(b1) and is_r(b2) and is_e(b3) and is_a(b4) and is_t(b5) and is_e(b6) and is_s(b7) and is_t(b8), do: {:reserved, :greatest} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_g(b1) and is_r(b2) and is_o(b3) and is_u(b4) and is_p(b5), do: {:reserved, :group} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_g(b1) and is_r(b2) and is_o(b3) and is_u(b4) and is_p(b5) and is_i(b6) and is_n(b7) and is_g(b8), do: {:reserved, :grouping} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_g(b1) and is_r(b2) and is_o(b3) and is_u(b4) and is_p(b5) and is_s(b6), do: {:reserved, :groups} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_h(b1) and is_a(b2) and is_v(b3) and is_i(b4) and is_n(b5) and is_g(b6), do: {:reserved, :having} + + def tag([[[[[], b1], b2], b3], b4]) when is_h(b1) and is_o(b2) and is_l(b3) and is_d(b4), do: {:reserved, :hold} + + def tag([[[[[], b1], b2], b3], b4]) when is_h(b1) and is_o(b2) and is_u(b3) and is_r(b4), do: {:reserved, :hour} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_i(b1) and is_d(b2) and is_e(b3) and is_n(b4) and is_t(b5) and is_i(b6) and is_t(b7) and is_y(b8), do: {:reserved, :identity} + + def tag([[[], b1], b2]) when is_i(b1) and is_n(b2), do: {:reserved, :in} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_i(b1) and is_n(b2) and is_d(b3) and is_i(b4) and is_c(b5) and is_a(b6) and is_t(b7) and is_o(b8) and is_r(b9), do: {:reserved, :indicator} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_i(b1) and is_n(b2) and is_i(b3) and is_t(b4) and is_i(b5) and is_a(b6) and is_l(b7), do: {:reserved, :initial} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_i(b1) and is_n(b2) and is_n(b3) and is_e(b4) and is_r(b5), do: {:reserved, :inner} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_i(b1) and is_n(b2) and is_o(b3) and is_u(b4) and is_t(b5), do: {:reserved, :inout} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_i(b1) and is_n(b2) and is_s(b3) and is_e(b4) and is_n(b5) and is_s(b6) and is_i(b7) and is_t(b8) and is_i(b9) and is_v(b10) and is_e(b11), do: {:reserved, :insensitive} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_i(b1) and is_n(b2) and is_s(b3) and is_e(b4) and is_r(b5) and is_t(b6), do: {:reserved, :insert} + + def tag([[[[], b1], b2], b3]) when is_i(b1) and is_n(b2) and is_t(b3), do: {:reserved, :int} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_i(b1) and is_n(b2) and is_t(b3) and is_e(b4) and is_g(b5) and is_e(b6) and is_r(b7), do: {:reserved, :integer} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_i(b1) and is_n(b2) and is_t(b3) and is_e(b4) and is_r(b5) and is_s(b6) and is_e(b7) and is_c(b8) and is_t(b9), do: {:reserved, :intersect} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_i(b1) and is_n(b2) and is_t(b3) and is_e(b4) and is_r(b5) and is_s(b6) and is_e(b7) and is_c(b8) and is_t(b9) and is_i(b10) and is_o(b11) and is_n(b12), do: {:reserved, :intersection} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_i(b1) and is_n(b2) and is_t(b3) and is_e(b4) and is_r(b5) and is_v(b6) and is_a(b7) and is_l(b8), do: {:reserved, :interval} + + def tag([[[[[], b1], b2], b3], b4]) when is_i(b1) and is_n(b2) and is_t(b3) and is_o(b4), do: {:reserved, :into} + + def tag([[[], b1], b2]) when is_i(b1) and is_s(b2), do: {:reserved, :is} + + def tag([[[[[], b1], b2], b3], b4]) when is_j(b1) and is_o(b2) and is_i(b3) and is_n(b4), do: {:reserved, :join} + + def tag([[[[[], b1], b2], b3], b4]) when is_j(b1) and is_s(b2) and is_o(b3) and is_n(b4), do: {:reserved, :json} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_j(b1) and is_s(b2) and is_o(b3) and is_n(b4) and b5 in ~c"_" and is_a(b6) and is_r(b7) and is_r(b8) and is_a(b9) and is_y(b10), do: {:reserved, :json_array} + + def tag([[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when is_j(b1) and is_s(b2) and is_o(b3) and is_n(b4) and b5 in ~c"_" and is_a(b6) and is_r(b7) and is_r(b8) and is_a(b9) and is_y(b10) and is_a(b11) and is_g(b12) and is_g(b13), do: {:reserved, :json_arrayagg} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_j(b1) and is_s(b2) and is_o(b3) and is_n(b4) and b5 in ~c"_" and is_e(b6) and is_x(b7) and is_i(b8) and is_s(b9) and is_t(b10) and is_s(b11), do: {:reserved, :json_exists} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_j(b1) and is_s(b2) and is_o(b3) and is_n(b4) and b5 in ~c"_" and is_o(b6) and is_b(b7) and is_j(b8) and is_e(b9) and is_c(b10) and is_t(b11), do: {:reserved, :json_object} + + def tag([[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when is_j(b1) and is_s(b2) and is_o(b3) and is_n(b4) and b5 in ~c"_" and is_o(b6) and is_b(b7) and is_j(b8) and is_e(b9) and is_c(b10) and is_t(b11) and is_a(b12) and is_g(b13) and is_g(b14), do: {:reserved, :json_objectagg} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_j(b1) and is_s(b2) and is_o(b3) and is_n(b4) and b5 in ~c"_" and is_q(b6) and is_u(b7) and is_e(b8) and is_r(b9) and is_y(b10), do: {:reserved, :json_query} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_j(b1) and is_s(b2) and is_o(b3) and is_n(b4) and b5 in ~c"_" and is_s(b6) and is_c(b7) and is_a(b8) and is_l(b9) and is_a(b10) and is_r(b11), do: {:reserved, :json_scalar} + + def tag([[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when is_j(b1) and is_s(b2) and is_o(b3) and is_n(b4) and b5 in ~c"_" and is_s(b6) and is_e(b7) and is_r(b8) and is_i(b9) and is_a(b10) and is_l(b11) and is_i(b12) and is_z(b13) and is_e(b14), do: {:reserved, :json_serialize} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_j(b1) and is_s(b2) and is_o(b3) and is_n(b4) and b5 in ~c"_" and is_t(b6) and is_a(b7) and is_b(b8) and is_l(b9) and is_e(b10), do: {:reserved, :json_table} + + def tag([[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20]) when is_j(b1) and is_s(b2) and is_o(b3) and is_n(b4) and b5 in ~c"_" and is_t(b6) and is_a(b7) and is_b(b8) and is_l(b9) and is_e(b10) and b11 in ~c"_" and is_p(b12) and is_r(b13) and is_i(b14) and is_m(b15) and is_i(b16) and is_t(b17) and is_i(b18) and is_v(b19) and is_e(b20), do: {:reserved, :json_table_primitive} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_j(b1) and is_s(b2) and is_o(b3) and is_n(b4) and b5 in ~c"_" and is_v(b6) and is_a(b7) and is_l(b8) and is_u(b9) and is_e(b10), do: {:reserved, :json_value} + + def tag([[[[], b1], b2], b3]) when is_l(b1) and is_a(b2) and is_g(b3), do: {:reserved, :lag} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_l(b1) and is_a(b2) and is_n(b3) and is_g(b4) and is_u(b5) and is_a(b6) and is_g(b7) and is_e(b8), do: {:reserved, :language} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_l(b1) and is_a(b2) and is_r(b3) and is_g(b4) and is_e(b5), do: {:reserved, :large} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_l(b1) and is_a(b2) and is_s(b3) and is_t(b4) and b5 in ~c"_" and is_v(b6) and is_a(b7) and is_l(b8) and is_u(b9) and is_e(b10), do: {:reserved, :last_value} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_l(b1) and is_a(b2) and is_t(b3) and is_e(b4) and is_r(b5) and is_a(b6) and is_l(b7), do: {:reserved, :lateral} + + def tag([[[[[], b1], b2], b3], b4]) when is_l(b1) and is_e(b2) and is_a(b3) and is_d(b4), do: {:reserved, :lead} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_l(b1) and is_e(b2) and is_a(b3) and is_d(b4) and is_i(b5) and is_n(b6) and is_g(b7), do: {:reserved, :leading} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_l(b1) and is_e(b2) and is_a(b3) and is_s(b4) and is_t(b5), do: {:reserved, :least} + + def tag([[[[[], b1], b2], b3], b4]) when is_l(b1) and is_e(b2) and is_f(b3) and is_t(b4), do: {:reserved, :left} + + def tag([[[[[], b1], b2], b3], b4]) when is_l(b1) and is_i(b2) and is_k(b3) and is_e(b4), do: {:reserved, :like} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_l(b1) and is_i(b2) and is_k(b3) and is_e(b4) and b5 in ~c"_" and is_r(b6) and is_e(b7) and is_g(b8) and is_e(b9) and is_x(b10), do: {:reserved, :like_regex} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_l(b1) and is_i(b2) and is_s(b3) and is_t(b4) and is_a(b5) and is_g(b6) and is_g(b7), do: {:reserved, :listagg} + + def tag([[[], b1], b2]) when is_l(b1) and is_n(b2), do: {:reserved, :ln} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_l(b1) and is_o(b2) and is_c(b3) and is_a(b4) and is_l(b5), do: {:reserved, :local} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_l(b1) and is_o(b2) and is_c(b3) and is_a(b4) and is_l(b5) and is_t(b6) and is_i(b7) and is_m(b8) and is_e(b9), do: {:reserved, :localtime} + + def tag([[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when is_l(b1) and is_o(b2) and is_c(b3) and is_a(b4) and is_l(b5) and is_t(b6) and is_i(b7) and is_m(b8) and is_e(b9) and is_s(b10) and is_t(b11) and is_a(b12) and is_m(b13) and is_p(b14), do: {:reserved, :localtimestamp} + + def tag([[[[], b1], b2], b3]) when is_l(b1) and is_o(b2) and is_g(b3), do: {:reserved, :log} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_l(b1) and is_o(b2) and is_g(b3) and b4 in ~c"1" and b5 in ~c"0", do: {:reserved, :log10} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_l(b1) and is_o(b2) and is_w(b3) and is_e(b4) and is_r(b5), do: {:reserved, :lower} + + def tag([[[[[], b1], b2], b3], b4]) when is_l(b1) and is_p(b2) and is_a(b3) and is_d(b4), do: {:reserved, :lpad} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_l(b1) and is_t(b2) and is_r(b3) and is_i(b4) and is_m(b5), do: {:reserved, :ltrim} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_m(b1) and is_a(b2) and is_t(b3) and is_c(b4) and is_h(b5), do: {:reserved, :match} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_m(b1) and is_a(b2) and is_t(b3) and is_c(b4) and is_h(b5) and b6 in ~c"_" and is_n(b7) and is_u(b8) and is_m(b9) and is_b(b10) and is_e(b11) and is_r(b12), do: {:reserved, :match_number} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_m(b1) and is_a(b2) and is_t(b3) and is_c(b4) and is_h(b5) and b6 in ~c"_" and is_r(b7) and is_e(b8) and is_c(b9) and is_o(b10) and is_g(b11) and is_n(b12) and is_i(b13) and is_z(b14) and is_e(b15), do: {:reserved, :match_recognize} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_m(b1) and is_a(b2) and is_t(b3) and is_c(b4) and is_h(b5) and is_e(b6) and is_s(b7), do: {:reserved, :matches} + + def tag([[[[], b1], b2], b3]) when is_m(b1) and is_a(b2) and is_x(b3), do: {:reserved, :max} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_m(b1) and is_e(b2) and is_m(b3) and is_b(b4) and is_e(b5) and is_r(b6), do: {:reserved, :member} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_m(b1) and is_e(b2) and is_r(b3) and is_g(b4) and is_e(b5), do: {:reserved, :merge} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_m(b1) and is_e(b2) and is_t(b3) and is_h(b4) and is_o(b5) and is_d(b6), do: {:reserved, :method} + + def tag([[[[], b1], b2], b3]) when is_m(b1) and is_i(b2) and is_n(b3), do: {:reserved, :min} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_m(b1) and is_i(b2) and is_n(b3) and is_u(b4) and is_t(b5) and is_e(b6), do: {:reserved, :minute} + + def tag([[[[], b1], b2], b3]) when is_m(b1) and is_o(b2) and is_d(b3), do: {:reserved, :mod} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_m(b1) and is_o(b2) and is_d(b3) and is_i(b4) and is_f(b5) and is_i(b6) and is_e(b7) and is_s(b8), do: {:reserved, :modifies} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_m(b1) and is_o(b2) and is_d(b3) and is_u(b4) and is_l(b5) and is_e(b6), do: {:reserved, :module} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_m(b1) and is_o(b2) and is_n(b3) and is_t(b4) and is_h(b5), do: {:reserved, :month} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_m(b1) and is_u(b2) and is_l(b3) and is_t(b4) and is_i(b5) and is_s(b6) and is_e(b7) and is_t(b8), do: {:reserved, :multiset} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_n(b1) and is_a(b2) and is_t(b3) and is_i(b4) and is_o(b5) and is_n(b6) and is_a(b7) and is_l(b8), do: {:reserved, :national} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_n(b1) and is_a(b2) and is_t(b3) and is_u(b4) and is_r(b5) and is_a(b6) and is_l(b7), do: {:reserved, :natural} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_n(b1) and is_c(b2) and is_h(b3) and is_a(b4) and is_r(b5), do: {:reserved, :nchar} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_n(b1) and is_c(b2) and is_l(b3) and is_o(b4) and is_b(b5), do: {:reserved, :nclob} + + def tag([[[[], b1], b2], b3]) when is_n(b1) and is_e(b2) and is_w(b3), do: {:reserved, :new} + + def tag([[[], b1], b2]) when is_n(b1) and is_o(b2), do: {:reserved, :no} + + def tag([[[[[], b1], b2], b3], b4]) when is_n(b1) and is_o(b2) and is_n(b3) and is_e(b4), do: {:reserved, :none} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_n(b1) and is_o(b2) and is_r(b3) and is_m(b4) and is_a(b5) and is_l(b6) and is_i(b7) and is_z(b8) and is_e(b9), do: {:reserved, :normalize} + + def tag([[[[], b1], b2], b3]) when is_n(b1) and is_o(b2) and is_t(b3), do: {:reserved, :not} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_n(b1) and is_t(b2) and is_h(b3) and b4 in ~c"_" and is_v(b5) and is_a(b6) and is_l(b7) and is_u(b8) and is_e(b9), do: {:reserved, :nth_value} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_n(b1) and is_t(b2) and is_i(b3) and is_l(b4) and is_e(b5), do: {:reserved, :ntile} + + def tag([[[[[], b1], b2], b3], b4]) when is_n(b1) and is_u(b2) and is_l(b3) and is_l(b4), do: {:reserved, :null} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_n(b1) and is_u(b2) and is_l(b3) and is_l(b4) and is_i(b5) and is_f(b6), do: {:reserved, :nullif} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_n(b1) and is_u(b2) and is_m(b3) and is_e(b4) and is_r(b5) and is_i(b6) and is_c(b7), do: {:reserved, :numeric} + + def tag([[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17]) when is_o(b1) and is_c(b2) and is_c(b3) and is_u(b4) and is_r(b5) and is_r(b6) and is_e(b7) and is_n(b8) and is_c(b9) and is_e(b10) and is_s(b11) and b12 in ~c"_" and is_r(b13) and is_e(b14) and is_g(b15) and is_e(b16) and is_x(b17), do: {:reserved, :occurrences_regex} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_o(b1) and is_c(b2) and is_t(b3) and is_e(b4) and is_t(b5) and b6 in ~c"_" and is_l(b7) and is_e(b8) and is_n(b9) and is_g(b10) and is_t(b11) and is_h(b12), do: {:reserved, :octet_length} + + def tag([[[], b1], b2]) when is_o(b1) and is_f(b2), do: {:reserved, :of} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_o(b1) and is_f(b2) and is_f(b3) and is_s(b4) and is_e(b5) and is_t(b6), do: {:reserved, :offset} + + def tag([[[[], b1], b2], b3]) when is_o(b1) and is_l(b2) and is_d(b3), do: {:reserved, :old} + + def tag([[[[[], b1], b2], b3], b4]) when is_o(b1) and is_m(b2) and is_i(b3) and is_t(b4), do: {:reserved, :omit} + + def tag([[[], b1], b2]) when is_o(b1) and is_n(b2), do: {:reserved, :on} + + def tag([[[[], b1], b2], b3]) when is_o(b1) and is_n(b2) and is_e(b3), do: {:reserved, :one} + + def tag([[[[[], b1], b2], b3], b4]) when is_o(b1) and is_n(b2) and is_l(b3) and is_y(b4), do: {:reserved, :only} + + def tag([[[[[], b1], b2], b3], b4]) when is_o(b1) and is_p(b2) and is_e(b3) and is_n(b4), do: {:reserved, :open} + + def tag([[[], b1], b2]) when is_o(b1) and is_r(b2), do: {:reserved, :or} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_o(b1) and is_r(b2) and is_d(b3) and is_e(b4) and is_r(b5), do: {:reserved, :order} + + def tag([[[[], b1], b2], b3]) when is_o(b1) and is_u(b2) and is_t(b3), do: {:reserved, :out} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_o(b1) and is_u(b2) and is_t(b3) and is_e(b4) and is_r(b5), do: {:reserved, :outer} + + def tag([[[[[], b1], b2], b3], b4]) when is_o(b1) and is_v(b2) and is_e(b3) and is_r(b4), do: {:reserved, :over} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_o(b1) and is_v(b2) and is_e(b3) and is_r(b4) and is_l(b5) and is_a(b6) and is_p(b7) and is_s(b8), do: {:reserved, :overlaps} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_o(b1) and is_v(b2) and is_e(b3) and is_r(b4) and is_l(b5) and is_a(b6) and is_y(b7), do: {:reserved, :overlay} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_p(b1) and is_a(b2) and is_r(b3) and is_a(b4) and is_m(b5) and is_e(b6) and is_t(b7) and is_e(b8) and is_r(b9), do: {:reserved, :parameter} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_p(b1) and is_a(b2) and is_r(b3) and is_t(b4) and is_i(b5) and is_t(b6) and is_i(b7) and is_o(b8) and is_n(b9), do: {:reserved, :partition} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_p(b1) and is_a(b2) and is_t(b3) and is_t(b4) and is_e(b5) and is_r(b6) and is_n(b7), do: {:reserved, :pattern} + + def tag([[[[], b1], b2], b3]) when is_p(b1) and is_e(b2) and is_r(b3), do: {:reserved, :per} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_p(b1) and is_e(b2) and is_r(b3) and is_c(b4) and is_e(b5) and is_n(b6) and is_t(b7), do: {:reserved, :percent} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_p(b1) and is_e(b2) and is_r(b3) and is_c(b4) and is_e(b5) and is_n(b6) and is_t(b7) and b8 in ~c"_" and is_r(b9) and is_a(b10) and is_n(b11) and is_k(b12), do: {:reserved, :percent_rank} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_p(b1) and is_e(b2) and is_r(b3) and is_c(b4) and is_e(b5) and is_n(b6) and is_t(b7) and is_i(b8) and is_l(b9) and is_e(b10) and b11 in ~c"_" and is_c(b12) and is_o(b13) and is_n(b14) and is_t(b15), do: {:reserved, :percentile_cont} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_p(b1) and is_e(b2) and is_r(b3) and is_c(b4) and is_e(b5) and is_n(b6) and is_t(b7) and is_i(b8) and is_l(b9) and is_e(b10) and b11 in ~c"_" and is_d(b12) and is_i(b13) and is_s(b14) and is_c(b15), do: {:reserved, :percentile_disc} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_p(b1) and is_e(b2) and is_r(b3) and is_i(b4) and is_o(b5) and is_d(b6), do: {:reserved, :period} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_p(b1) and is_o(b2) and is_r(b3) and is_t(b4) and is_i(b5) and is_o(b6) and is_n(b7), do: {:reserved, :portion} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_p(b1) and is_o(b2) and is_s(b3) and is_i(b4) and is_t(b5) and is_i(b6) and is_o(b7) and is_n(b8), do: {:reserved, :position} + + def tag([[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when is_p(b1) and is_o(b2) and is_s(b3) and is_i(b4) and is_t(b5) and is_i(b6) and is_o(b7) and is_n(b8) and b9 in ~c"_" and is_r(b10) and is_e(b11) and is_g(b12) and is_e(b13) and is_x(b14), do: {:reserved, :position_regex} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_p(b1) and is_o(b2) and is_w(b3) and is_e(b4) and is_r(b5), do: {:reserved, :power} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_p(b1) and is_r(b2) and is_e(b3) and is_c(b4) and is_e(b5) and is_d(b6) and is_e(b7) and is_s(b8), do: {:reserved, :precedes} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_p(b1) and is_r(b2) and is_e(b3) and is_c(b4) and is_i(b5) and is_s(b6) and is_i(b7) and is_o(b8) and is_n(b9), do: {:reserved, :precision} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_p(b1) and is_r(b2) and is_e(b3) and is_p(b4) and is_a(b5) and is_r(b6) and is_e(b7), do: {:reserved, :prepare} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_p(b1) and is_r(b2) and is_i(b3) and is_m(b4) and is_a(b5) and is_r(b6) and is_y(b7), do: {:reserved, :primary} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_p(b1) and is_r(b2) and is_o(b3) and is_c(b4) and is_e(b5) and is_d(b6) and is_u(b7) and is_r(b8) and is_e(b9), do: {:reserved, :procedure} + + def tag([[[[], b1], b2], b3]) when is_p(b1) and is_t(b2) and is_f(b3), do: {:reserved, :ptf} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_r(b1) and is_a(b2) and is_n(b3) and is_g(b4) and is_e(b5), do: {:reserved, :range} + + def tag([[[[[], b1], b2], b3], b4]) when is_r(b1) and is_a(b2) and is_n(b3) and is_k(b4), do: {:reserved, :rank} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_r(b1) and is_e(b2) and is_a(b3) and is_d(b4) and is_s(b5), do: {:reserved, :reads} + + def tag([[[[[], b1], b2], b3], b4]) when is_r(b1) and is_e(b2) and is_a(b3) and is_l(b4), do: {:reserved, :real} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_r(b1) and is_e(b2) and is_c(b3) and is_u(b4) and is_r(b5) and is_s(b6) and is_i(b7) and is_v(b8) and is_e(b9), do: {:reserved, :recursive} + + def tag([[[[], b1], b2], b3]) when is_r(b1) and is_e(b2) and is_f(b3), do: {:reserved, :ref} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_r(b1) and is_e(b2) and is_f(b3) and is_e(b4) and is_r(b5) and is_e(b6) and is_n(b7) and is_c(b8) and is_e(b9) and is_s(b10), do: {:reserved, :references} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_r(b1) and is_e(b2) and is_f(b3) and is_e(b4) and is_r(b5) and is_e(b6) and is_n(b7) and is_c(b8) and is_i(b9) and is_n(b10) and is_g(b11), do: {:reserved, :referencing} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_r(b1) and is_e(b2) and is_g(b3) and is_r(b4) and b5 in ~c"_" and is_a(b6) and is_v(b7) and is_g(b8) and is_x(b9), do: {:reserved, :regr_avgx} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_r(b1) and is_e(b2) and is_g(b3) and is_r(b4) and b5 in ~c"_" and is_a(b6) and is_v(b7) and is_g(b8) and is_y(b9), do: {:reserved, :regr_avgy} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_r(b1) and is_e(b2) and is_g(b3) and is_r(b4) and b5 in ~c"_" and is_c(b6) and is_o(b7) and is_u(b8) and is_n(b9) and is_t(b10), do: {:reserved, :regr_count} + + def tag([[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when is_r(b1) and is_e(b2) and is_g(b3) and is_r(b4) and b5 in ~c"_" and is_i(b6) and is_n(b7) and is_t(b8) and is_e(b9) and is_r(b10) and is_c(b11) and is_e(b12) and is_p(b13) and is_t(b14), do: {:reserved, :regr_intercept} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_r(b1) and is_e(b2) and is_g(b3) and is_r(b4) and b5 in ~c"_" and is_r(b6) and b7 in ~c"2", do: {:reserved, :regr_r2} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_r(b1) and is_e(b2) and is_g(b3) and is_r(b4) and b5 in ~c"_" and is_s(b6) and is_l(b7) and is_o(b8) and is_p(b9) and is_e(b10), do: {:reserved, :regr_slope} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_r(b1) and is_e(b2) and is_g(b3) and is_r(b4) and b5 in ~c"_" and is_s(b6) and is_x(b7) and is_x(b8), do: {:reserved, :regr_sxx} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_r(b1) and is_e(b2) and is_g(b3) and is_r(b4) and b5 in ~c"_" and is_s(b6) and is_x(b7) and is_y(b8), do: {:reserved, :regr_sxy} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_r(b1) and is_e(b2) and is_g(b3) and is_r(b4) and b5 in ~c"_" and is_s(b6) and is_y(b7) and is_y(b8), do: {:reserved, :regr_syy} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_r(b1) and is_e(b2) and is_l(b3) and is_e(b4) and is_a(b5) and is_s(b6) and is_e(b7), do: {:reserved, :release} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_r(b1) and is_e(b2) and is_s(b3) and is_u(b4) and is_l(b5) and is_t(b6), do: {:reserved, :result} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_r(b1) and is_e(b2) and is_t(b3) and is_u(b4) and is_r(b5) and is_n(b6), do: {:reserved, :return} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_r(b1) and is_e(b2) and is_t(b3) and is_u(b4) and is_r(b5) and is_n(b6) and is_s(b7), do: {:reserved, :returns} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_r(b1) and is_e(b2) and is_v(b3) and is_o(b4) and is_k(b5) and is_e(b6), do: {:reserved, :revoke} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_r(b1) and is_i(b2) and is_g(b3) and is_h(b4) and is_t(b5), do: {:reserved, :right} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_r(b1) and is_o(b2) and is_l(b3) and is_l(b4) and is_b(b5) and is_a(b6) and is_c(b7) and is_k(b8), do: {:reserved, :rollback} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_r(b1) and is_o(b2) and is_l(b3) and is_l(b4) and is_u(b5) and is_p(b6), do: {:reserved, :rollup} + + def tag([[[[], b1], b2], b3]) when is_r(b1) and is_o(b2) and is_w(b3), do: {:reserved, :row} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_r(b1) and is_o(b2) and is_w(b3) and b4 in ~c"_" and is_n(b5) and is_u(b6) and is_m(b7) and is_b(b8) and is_e(b9) and is_r(b10), do: {:reserved, :row_number} + + def tag([[[[[], b1], b2], b3], b4]) when is_r(b1) and is_o(b2) and is_w(b3) and is_s(b4), do: {:reserved, :rows} + + def tag([[[[[], b1], b2], b3], b4]) when is_r(b1) and is_p(b2) and is_a(b3) and is_d(b4), do: {:reserved, :rpad} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_r(b1) and is_t(b2) and is_r(b3) and is_i(b4) and is_m(b5), do: {:reserved, :rtrim} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_r(b1) and is_u(b2) and is_n(b3) and is_n(b4) and is_i(b5) and is_n(b6) and is_g(b7), do: {:reserved, :running} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_s(b1) and is_a(b2) and is_v(b3) and is_e(b4) and is_p(b5) and is_o(b6) and is_i(b7) and is_n(b8) and is_t(b9), do: {:reserved, :savepoint} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_s(b1) and is_c(b2) and is_o(b3) and is_p(b4) and is_e(b5), do: {:reserved, :scope} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_c(b2) and is_r(b3) and is_o(b4) and is_l(b5) and is_l(b6), do: {:reserved, :scroll} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_e(b2) and is_a(b3) and is_r(b4) and is_c(b5) and is_h(b6), do: {:reserved, :search} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_e(b2) and is_c(b3) and is_o(b4) and is_n(b5) and is_d(b6), do: {:reserved, :second} + + def tag([[[[[], b1], b2], b3], b4]) when is_s(b1) and is_e(b2) and is_e(b3) and is_k(b4), do: {:reserved, :seek} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_e(b2) and is_l(b3) and is_e(b4) and is_c(b5) and is_t(b6), do: {:reserved, :select} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_s(b1) and is_e(b2) and is_n(b3) and is_s(b4) and is_i(b5) and is_t(b6) and is_i(b7) and is_v(b8) and is_e(b9), do: {:reserved, :sensitive} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_s(b1) and is_e(b2) and is_s(b3) and is_s(b4) and is_i(b5) and is_o(b6) and is_n(b7) and b8 in ~c"_" and is_u(b9) and is_s(b10) and is_e(b11) and is_r(b12), do: {:reserved, :session_user} + + def tag([[[[], b1], b2], b3]) when is_s(b1) and is_e(b2) and is_t(b3), do: {:reserved, :set} + + def tag([[[[[], b1], b2], b3], b4]) when is_s(b1) and is_h(b2) and is_o(b3) and is_w(b4), do: {:reserved, :show} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_s(b1) and is_i(b2) and is_m(b3) and is_i(b4) and is_l(b5) and is_a(b6) and is_r(b7), do: {:reserved, :similar} + + def tag([[[[], b1], b2], b3]) when is_s(b1) and is_i(b2) and is_n(b3), do: {:reserved, :sin} + + def tag([[[[[], b1], b2], b3], b4]) when is_s(b1) and is_i(b2) and is_n(b3) and is_h(b4), do: {:reserved, :sinh} + + def tag([[[[[], b1], b2], b3], b4]) when is_s(b1) and is_k(b2) and is_i(b3) and is_p(b4), do: {:reserved, :skip} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_s(b1) and is_m(b2) and is_a(b3) and is_l(b4) and is_l(b5) and is_i(b6) and is_n(b7) and is_t(b8), do: {:reserved, :smallint} + + def tag([[[[[], b1], b2], b3], b4]) when is_s(b1) and is_o(b2) and is_m(b3) and is_e(b4), do: {:reserved, :some} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_s(b1) and is_p(b2) and is_e(b3) and is_c(b4) and is_i(b5) and is_f(b6) and is_i(b7) and is_c(b8), do: {:reserved, :specific} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_s(b1) and is_p(b2) and is_e(b3) and is_c(b4) and is_i(b5) and is_f(b6) and is_i(b7) and is_c(b8) and is_t(b9) and is_y(b10) and is_p(b11) and is_e(b12), do: {:reserved, :specifictype} + + def tag([[[[], b1], b2], b3]) when is_s(b1) and is_q(b2) and is_l(b3), do: {:reserved, :sql} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_s(b1) and is_q(b2) and is_l(b3) and is_e(b4) and is_x(b5) and is_c(b6) and is_e(b7) and is_p(b8) and is_t(b9) and is_i(b10) and is_o(b11) and is_n(b12), do: {:reserved, :sqlexception} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_s(b1) and is_q(b2) and is_l(b3) and is_s(b4) and is_t(b5) and is_a(b6) and is_t(b7) and is_e(b8), do: {:reserved, :sqlstate} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_s(b1) and is_q(b2) and is_l(b3) and is_w(b4) and is_a(b5) and is_r(b6) and is_n(b7) and is_i(b8) and is_n(b9) and is_g(b10), do: {:reserved, :sqlwarning} + + def tag([[[[[], b1], b2], b3], b4]) when is_s(b1) and is_q(b2) and is_r(b3) and is_t(b4), do: {:reserved, :sqrt} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_s(b1) and is_t(b2) and is_a(b3) and is_r(b4) and is_t(b5), do: {:reserved, :start} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_t(b2) and is_a(b3) and is_t(b4) and is_i(b5) and is_c(b6), do: {:reserved, :static} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_s(b1) and is_t(b2) and is_d(b3) and is_d(b4) and is_e(b5) and is_v(b6) and b7 in ~c"_" and is_p(b8) and is_o(b9) and is_p(b10), do: {:reserved, :stddev_pop} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_s(b1) and is_t(b2) and is_d(b3) and is_d(b4) and is_e(b5) and is_v(b6) and b7 in ~c"_" and is_s(b8) and is_a(b9) and is_m(b10) and is_p(b11), do: {:reserved, :stddev_samp} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_s(b1) and is_u(b2) and is_b(b3) and is_m(b4) and is_u(b5) and is_l(b6) and is_t(b7) and is_i(b8) and is_s(b9) and is_e(b10) and is_t(b11), do: {:reserved, :submultiset} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_u(b2) and is_b(b3) and is_s(b4) and is_e(b5) and is_t(b6), do: {:reserved, :subset} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_s(b1) and is_u(b2) and is_b(b3) and is_s(b4) and is_t(b5) and is_r(b6) and is_i(b7) and is_n(b8) and is_g(b9), do: {:reserved, :substring} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_s(b1) and is_u(b2) and is_b(b3) and is_s(b4) and is_t(b5) and is_r(b6) and is_i(b7) and is_n(b8) and is_g(b9) and b10 in ~c"_" and is_r(b11) and is_e(b12) and is_g(b13) and is_e(b14) and is_x(b15), do: {:reserved, :substring_regex} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_s(b1) and is_u(b2) and is_c(b3) and is_c(b4) and is_e(b5) and is_e(b6) and is_d(b7) and is_s(b8), do: {:reserved, :succeeds} + + def tag([[[[], b1], b2], b3]) when is_s(b1) and is_u(b2) and is_m(b3), do: {:reserved, :sum} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_s(b1) and is_y(b2) and is_m(b3) and is_m(b4) and is_e(b5) and is_t(b6) and is_r(b7) and is_i(b8) and is_c(b9), do: {:reserved, :symmetric} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_y(b2) and is_s(b3) and is_t(b4) and is_e(b5) and is_m(b6), do: {:reserved, :system} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_s(b1) and is_y(b2) and is_s(b3) and is_t(b4) and is_e(b5) and is_m(b6) and b7 in ~c"_" and is_t(b8) and is_i(b9) and is_m(b10) and is_e(b11), do: {:reserved, :system_time} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_s(b1) and is_y(b2) and is_s(b3) and is_t(b4) and is_e(b5) and is_m(b6) and b7 in ~c"_" and is_u(b8) and is_s(b9) and is_e(b10) and is_r(b11), do: {:reserved, :system_user} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_t(b1) and is_a(b2) and is_b(b3) and is_l(b4) and is_e(b5), do: {:reserved, :table} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_t(b1) and is_a(b2) and is_b(b3) and is_l(b4) and is_e(b5) and is_s(b6) and is_a(b7) and is_m(b8) and is_p(b9) and is_l(b10) and is_e(b11), do: {:reserved, :tablesample} + + def tag([[[[], b1], b2], b3]) when is_t(b1) and is_a(b2) and is_n(b3), do: {:reserved, :tan} + + def tag([[[[[], b1], b2], b3], b4]) when is_t(b1) and is_a(b2) and is_n(b3) and is_h(b4), do: {:reserved, :tanh} + + def tag([[[[[], b1], b2], b3], b4]) when is_t(b1) and is_h(b2) and is_e(b3) and is_n(b4), do: {:reserved, :then} + + def tag([[[[[], b1], b2], b3], b4]) when is_t(b1) and is_i(b2) and is_m(b3) and is_e(b4), do: {:reserved, :time} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_t(b1) and is_i(b2) and is_m(b3) and is_e(b4) and is_s(b5) and is_t(b6) and is_a(b7) and is_m(b8) and is_p(b9), do: {:reserved, :timestamp} + + def tag([[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when is_t(b1) and is_i(b2) and is_m(b3) and is_e(b4) and is_z(b5) and is_o(b6) and is_n(b7) and is_e(b8) and b9 in ~c"_" and is_h(b10) and is_o(b11) and is_u(b12) and is_r(b13), do: {:reserved, :timezone_hour} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_t(b1) and is_i(b2) and is_m(b3) and is_e(b4) and is_z(b5) and is_o(b6) and is_n(b7) and is_e(b8) and b9 in ~c"_" and is_m(b10) and is_i(b11) and is_n(b12) and is_u(b13) and is_t(b14) and is_e(b15), do: {:reserved, :timezone_minute} + + def tag([[[], b1], b2]) when is_t(b1) and is_o(b2), do: {:reserved, :to} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_t(b1) and is_r(b2) and is_a(b3) and is_i(b4) and is_l(b5) and is_i(b6) and is_n(b7) and is_g(b8), do: {:reserved, :trailing} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_t(b1) and is_r(b2) and is_a(b3) and is_n(b4) and is_s(b5) and is_l(b6) and is_a(b7) and is_t(b8) and is_e(b9), do: {:reserved, :translate} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_t(b1) and is_r(b2) and is_a(b3) and is_n(b4) and is_s(b5) and is_l(b6) and is_a(b7) and is_t(b8) and is_e(b9) and b10 in ~c"_" and is_r(b11) and is_e(b12) and is_g(b13) and is_e(b14) and is_x(b15), do: {:reserved, :translate_regex} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_t(b1) and is_r(b2) and is_a(b3) and is_n(b4) and is_s(b5) and is_l(b6) and is_a(b7) and is_t(b8) and is_i(b9) and is_o(b10) and is_n(b11), do: {:reserved, :translation} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_t(b1) and is_r(b2) and is_e(b3) and is_a(b4) and is_t(b5), do: {:reserved, :treat} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_t(b1) and is_r(b2) and is_i(b3) and is_g(b4) and is_g(b5) and is_e(b6) and is_r(b7), do: {:reserved, :trigger} + + def tag([[[[[], b1], b2], b3], b4]) when is_t(b1) and is_r(b2) and is_i(b3) and is_m(b4), do: {:reserved, :trim} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_t(b1) and is_r(b2) and is_i(b3) and is_m(b4) and b5 in ~c"_" and is_a(b6) and is_r(b7) and is_r(b8) and is_a(b9) and is_y(b10), do: {:reserved, :trim_array} + + def tag([[[[[], b1], b2], b3], b4]) when is_t(b1) and is_r(b2) and is_u(b3) and is_e(b4), do: {:reserved, true} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_t(b1) and is_r(b2) and is_u(b3) and is_n(b4) and is_c(b5) and is_a(b6) and is_t(b7) and is_e(b8), do: {:reserved, :truncate} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_u(b1) and is_e(b2) and is_s(b3) and is_c(b4) and is_a(b5) and is_p(b6) and is_e(b7), do: {:reserved, :uescape} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_u(b1) and is_n(b2) and is_i(b3) and is_o(b4) and is_n(b5), do: {:reserved, :union} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_u(b1) and is_n(b2) and is_i(b3) and is_q(b4) and is_u(b5) and is_e(b6), do: {:reserved, :unique} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_u(b1) and is_n(b2) and is_k(b3) and is_n(b4) and is_o(b5) and is_w(b6) and is_n(b7), do: {:reserved, :unknown} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_u(b1) and is_n(b2) and is_n(b3) and is_e(b4) and is_s(b5) and is_t(b6), do: {:reserved, :unnest} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_u(b1) and is_p(b2) and is_d(b3) and is_a(b4) and is_t(b5) and is_e(b6), do: {:reserved, :update} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_u(b1) and is_p(b2) and is_p(b3) and is_e(b4) and is_r(b5), do: {:reserved, :upper} + + def tag([[[[[], b1], b2], b3], b4]) when is_u(b1) and is_s(b2) and is_e(b3) and is_r(b4), do: {:reserved, :user} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_u(b1) and is_s(b2) and is_i(b3) and is_n(b4) and is_g(b5), do: {:reserved, :using} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_v(b1) and is_a(b2) and is_l(b3) and is_u(b4) and is_e(b5), do: {:reserved, :value} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_v(b1) and is_a(b2) and is_l(b3) and is_u(b4) and is_e(b5) and is_s(b6), do: {:reserved, :values} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_v(b1) and is_a(b2) and is_l(b3) and is_u(b4) and is_e(b5) and b6 in ~c"_" and is_o(b7) and is_f(b8), do: {:reserved, :value_of} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_v(b1) and is_a(b2) and is_r(b3) and b4 in ~c"_" and is_p(b5) and is_o(b6) and is_p(b7), do: {:reserved, :var_pop} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_v(b1) and is_a(b2) and is_r(b3) and b4 in ~c"_" and is_s(b5) and is_a(b6) and is_m(b7) and is_p(b8), do: {:reserved, :var_samp} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_v(b1) and is_a(b2) and is_r(b3) and is_b(b4) and is_i(b5) and is_n(b6) and is_a(b7) and is_r(b8) and is_y(b9), do: {:reserved, :varbinary} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_v(b1) and is_a(b2) and is_r(b3) and is_c(b4) and is_h(b5) and is_a(b6) and is_r(b7), do: {:reserved, :varchar} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_v(b1) and is_a(b2) and is_r(b3) and is_y(b4) and is_i(b5) and is_n(b6) and is_g(b7), do: {:reserved, :varying} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_v(b1) and is_e(b2) and is_r(b3) and is_s(b4) and is_i(b5) and is_o(b6) and is_n(b7) and is_i(b8) and is_n(b9) and is_g(b10), do: {:reserved, :versioning} + + def tag([[[[[], b1], b2], b3], b4]) when is_w(b1) and is_h(b2) and is_e(b3) and is_n(b4), do: {:reserved, :when} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_w(b1) and is_h(b2) and is_e(b3) and is_n(b4) and is_e(b5) and is_v(b6) and is_e(b7) and is_r(b8), do: {:reserved, :whenever} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_w(b1) and is_h(b2) and is_e(b3) and is_r(b4) and is_e(b5), do: {:reserved, :where} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_w(b1) and is_i(b2) and is_d(b3) and is_t(b4) and is_h(b5) and b6 in ~c"_" and is_b(b7) and is_u(b8) and is_c(b9) and is_k(b10) and is_e(b11) and is_t(b12), do: {:reserved, :width_bucket} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_w(b1) and is_i(b2) and is_n(b3) and is_d(b4) and is_o(b5) and is_w(b6), do: {:reserved, :window} + + def tag([[[[[], b1], b2], b3], b4]) when is_w(b1) and is_i(b2) and is_t(b3) and is_h(b4), do: {:reserved, :with} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_w(b1) and is_i(b2) and is_t(b3) and is_h(b4) and is_i(b5) and is_n(b6), do: {:reserved, :within} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_w(b1) and is_i(b2) and is_t(b3) and is_h(b4) and is_o(b5) and is_u(b6) and is_t(b7), do: {:reserved, :without} + + def tag([[[[[], b1], b2], b3], b4]) when is_y(b1) and is_e(b2) and is_a(b3) and is_r(b4), do: {:reserved, :year} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_l(b1) and is_i(b2) and is_m(b3) and is_i(b4) and is_t(b5), do: {:reserved, :limit} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_i(b1) and is_l(b2) and is_i(b3) and is_k(b4) and is_e(b5), do: {:reserved, :ilike} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_b(b1) and is_a(b2) and is_c(b3) and is_k(b4) and is_w(b5) and is_a(b6) and is_r(b7) and is_d(b8), do: {:reserved, :backward} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_f(b1) and is_o(b2) and is_r(b3) and is_w(b4) and is_a(b5) and is_r(b6) and is_d(b7), do: {:reserved, :forward} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_i(b1) and is_s(b2) and is_n(b3) and is_u(b4) and is_l(b5) and is_l(b6), do: {:reserved, :isnull} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_n(b1) and is_o(b2) and is_t(b3) and is_n(b4) and is_u(b5) and is_l(b6) and is_l(b7), do: {:reserved, :notnull} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_d(b1) and is_a(b2) and is_t(b3) and is_e(b4) and is_t(b5) and is_i(b6) and is_m(b7) and is_e(b8), do: {:reserved, :datetime} + + def tag([[[[[], b1], b2], b3], b4]) when is_f(b1) and is_l(b2) and is_a(b3) and is_g(b4), do: {:reserved, :flag} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_k(b1) and is_e(b2) and is_y(b3) and is_v(b4) and is_a(b5) and is_l(b6) and is_u(b7) and is_e(b8), do: {:reserved, :keyvalue} + + def tag([[[[[], b1], b2], b3], b4]) when is_l(b1) and is_a(b2) and is_s(b3) and is_t(b4), do: {:reserved, :last} + + def tag([[[[], b1], b2], b3]) when is_l(b1) and is_a(b2) and is_x(b3), do: {:reserved, :lax} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_n(b1) and is_u(b2) and is_m(b3) and is_b(b4) and is_e(b5) and is_r(b6), do: {:reserved, :number} + + def tag([[[[[], b1], b2], b3], b4]) when is_s(b1) and is_i(b2) and is_z(b3) and is_e(b4), do: {:reserved, :size} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_t(b2) and is_a(b3) and is_r(b4) and is_t(b5) and is_s(b6), do: {:reserved, :starts} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_t(b2) and is_r(b3) and is_i(b4) and is_c(b5) and is_t(b6), do: {:reserved, :strict} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_t(b2) and is_r(b3) and is_i(b4) and is_n(b5) and is_g(b6), do: {:reserved, :string} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_t(b1) and is_i(b2) and is_m(b3) and is_e(b4) and b5 in ~c"_" and is_t(b6) and is_z(b7), do: {:reserved, :time_tz} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_t(b1) and is_i(b2) and is_m(b3) and is_e(b4) and is_s(b5) and is_t(b6) and is_a(b7) and is_m(b8) and is_p(b9) and b10 in ~c"_" and is_t(b11) and is_z(b12), do: {:reserved, :timestamp_tz} + + def tag([[[[[], b1], b2], b3], b4]) when is_t(b1) and is_y(b2) and is_p(b3) and is_e(b4), do: {:reserved, :type} + + + def tag([[], b1]) when is_a(b1), do: {:non_reserved, :a} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_a(b1) and is_b(b2) and is_s(b3) and is_o(b4) and is_l(b5) and is_u(b6) and is_t(b7) and is_e(b8), do: {:non_reserved, :absolute} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_a(b1) and is_c(b2) and is_t(b3) and is_i(b4) and is_o(b5) and is_n(b6), do: {:non_reserved, :action} + + def tag([[[[], b1], b2], b3]) when is_a(b1) and is_d(b2) and is_a(b3), do: {:non_reserved, :ada} + + def tag([[[[], b1], b2], b3]) when is_a(b1) and is_d(b2) and is_d(b3), do: {:non_reserved, :add} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_a(b1) and is_d(b2) and is_m(b3) and is_i(b4) and is_n(b5), do: {:non_reserved, :admin} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_a(b1) and is_f(b2) and is_t(b3) and is_e(b4) and is_r(b5), do: {:non_reserved, :after} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_a(b1) and is_l(b2) and is_w(b3) and is_a(b4) and is_y(b5) and is_s(b6), do: {:non_reserved, :always} + + def tag([[[[], b1], b2], b3]) when is_a(b1) and is_s(b2) and is_c(b3), do: {:non_reserved, :asc} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_a(b1) and is_s(b2) and is_s(b3) and is_e(b4) and is_r(b5) and is_t(b6) and is_i(b7) and is_o(b8) and is_n(b9), do: {:non_reserved, :assertion} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_a(b1) and is_s(b2) and is_s(b3) and is_i(b4) and is_g(b5) and is_n(b6) and is_m(b7) and is_e(b8) and is_n(b9) and is_t(b10), do: {:non_reserved, :assignment} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_a(b1) and is_t(b2) and is_t(b3) and is_r(b4) and is_i(b5) and is_b(b6) and is_u(b7) and is_t(b8) and is_e(b9), do: {:non_reserved, :attribute} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_a(b1) and is_t(b2) and is_t(b3) and is_r(b4) and is_i(b5) and is_b(b6) and is_u(b7) and is_t(b8) and is_e(b9) and is_s(b10), do: {:non_reserved, :attributes} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_b(b1) and is_e(b2) and is_f(b3) and is_o(b4) and is_r(b5) and is_e(b6), do: {:non_reserved, :before} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_b(b1) and is_e(b2) and is_r(b3) and is_n(b4) and is_o(b5) and is_u(b6) and is_l(b7) and is_l(b8) and is_i(b9), do: {:non_reserved, :bernoulli} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_b(b1) and is_r(b2) and is_e(b3) and is_a(b4) and is_d(b5) and is_t(b6) and is_h(b7), do: {:non_reserved, :breadth} + + def tag([[], b1]) when is_c(b1), do: {:non_reserved, :c} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_c(b1) and is_a(b2) and is_s(b3) and is_c(b4) and is_a(b5) and is_d(b6) and is_e(b7), do: {:non_reserved, :cascade} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_c(b1) and is_a(b2) and is_t(b3) and is_a(b4) and is_l(b5) and is_o(b6) and is_g(b7), do: {:non_reserved, :catalog} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_c(b1) and is_a(b2) and is_t(b3) and is_a(b4) and is_l(b5) and is_o(b6) and is_g(b7) and b8 in ~c"_" and is_n(b9) and is_a(b10) and is_m(b11) and is_e(b12), do: {:non_reserved, :catalog_name} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_c(b1) and is_h(b2) and is_a(b3) and is_i(b4) and is_n(b5), do: {:non_reserved, :chain} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_c(b1) and is_h(b2) and is_a(b3) and is_i(b4) and is_n(b5) and is_i(b6) and is_n(b7) and is_g(b8), do: {:non_reserved, :chaining} + + def tag([[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21]) when is_c(b1) and is_h(b2) and is_a(b3) and is_r(b4) and is_a(b5) and is_c(b6) and is_t(b7) and is_e(b8) and is_r(b9) and b10 in ~c"_" and is_s(b11) and is_e(b12) and is_t(b13) and b14 in ~c"_" and is_c(b15) and is_a(b16) and is_t(b17) and is_a(b18) and is_l(b19) and is_o(b20) and is_g(b21), do: {:non_reserved, :character_set_catalog} + + def tag([[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18]) when is_c(b1) and is_h(b2) and is_a(b3) and is_r(b4) and is_a(b5) and is_c(b6) and is_t(b7) and is_e(b8) and is_r(b9) and b10 in ~c"_" and is_s(b11) and is_e(b12) and is_t(b13) and b14 in ~c"_" and is_n(b15) and is_a(b16) and is_m(b17) and is_e(b18), do: {:non_reserved, :character_set_name} + + def tag([[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20]) when is_c(b1) and is_h(b2) and is_a(b3) and is_r(b4) and is_a(b5) and is_c(b6) and is_t(b7) and is_e(b8) and is_r(b9) and b10 in ~c"_" and is_s(b11) and is_e(b12) and is_t(b13) and b14 in ~c"_" and is_s(b15) and is_c(b16) and is_h(b17) and is_e(b18) and is_m(b19) and is_a(b20), do: {:non_reserved, :character_set_schema} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_c(b1) and is_h(b2) and is_a(b3) and is_r(b4) and is_a(b5) and is_c(b6) and is_t(b7) and is_e(b8) and is_r(b9) and is_i(b10) and is_s(b11) and is_t(b12) and is_i(b13) and is_c(b14) and is_s(b15), do: {:non_reserved, :characteristics} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_c(b1) and is_h(b2) and is_a(b3) and is_r(b4) and is_a(b5) and is_c(b6) and is_t(b7) and is_e(b8) and is_r(b9) and is_s(b10), do: {:non_reserved, :characters} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_c(b1) and is_l(b2) and is_a(b3) and is_s(b4) and is_s(b5) and b6 in ~c"_" and is_o(b7) and is_r(b8) and is_i(b9) and is_g(b10) and is_i(b11) and is_n(b12), do: {:non_reserved, :class_origin} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_c(b1) and is_o(b2) and is_b(b3) and is_o(b4) and is_l(b5), do: {:non_reserved, :cobol} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_c(b1) and is_o(b2) and is_l(b3) and is_l(b4) and is_a(b5) and is_t(b6) and is_i(b7) and is_o(b8) and is_n(b9), do: {:non_reserved, :collation} + + def tag([[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17]) when is_c(b1) and is_o(b2) and is_l(b3) and is_l(b4) and is_a(b5) and is_t(b6) and is_i(b7) and is_o(b8) and is_n(b9) and b10 in ~c"_" and is_c(b11) and is_a(b12) and is_t(b13) and is_a(b14) and is_l(b15) and is_o(b16) and is_g(b17), do: {:non_reserved, :collation_catalog} + + def tag([[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when is_c(b1) and is_o(b2) and is_l(b3) and is_l(b4) and is_a(b5) and is_t(b6) and is_i(b7) and is_o(b8) and is_n(b9) and b10 in ~c"_" and is_n(b11) and is_a(b12) and is_m(b13) and is_e(b14), do: {:non_reserved, :collation_name} + + def tag([[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16]) when is_c(b1) and is_o(b2) and is_l(b3) and is_l(b4) and is_a(b5) and is_t(b6) and is_i(b7) and is_o(b8) and is_n(b9) and b10 in ~c"_" and is_s(b11) and is_c(b12) and is_h(b13) and is_e(b14) and is_m(b15) and is_a(b16), do: {:non_reserved, :collation_schema} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_c(b1) and is_o(b2) and is_l(b3) and is_u(b4) and is_m(b5) and is_n(b6) and is_s(b7), do: {:non_reserved, :columns} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_c(b1) and is_o(b2) and is_l(b3) and is_u(b4) and is_m(b5) and is_n(b6) and b7 in ~c"_" and is_n(b8) and is_a(b9) and is_m(b10) and is_e(b11), do: {:non_reserved, :column_name} + + def tag([[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16]) when is_c(b1) and is_o(b2) and is_m(b3) and is_m(b4) and is_a(b5) and is_n(b6) and is_d(b7) and b8 in ~c"_" and is_f(b9) and is_u(b10) and is_n(b11) and is_c(b12) and is_t(b13) and is_i(b14) and is_o(b15) and is_n(b16), do: {:non_reserved, :command_function} + + def tag([[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21]) when is_c(b1) and is_o(b2) and is_m(b3) and is_m(b4) and is_a(b5) and is_n(b6) and is_d(b7) and b8 in ~c"_" and is_f(b9) and is_u(b10) and is_n(b11) and is_c(b12) and is_t(b13) and is_i(b14) and is_o(b15) and is_n(b16) and b17 in ~c"_" and is_c(b18) and is_o(b19) and is_d(b20) and is_e(b21), do: {:non_reserved, :command_function_code} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_c(b1) and is_o(b2) and is_m(b3) and is_m(b4) and is_i(b5) and is_t(b6) and is_t(b7) and is_e(b8) and is_d(b9), do: {:non_reserved, :committed} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_c(b1) and is_o(b2) and is_n(b3) and is_d(b4) and is_i(b5) and is_t(b6) and is_i(b7) and is_o(b8) and is_n(b9) and is_a(b10) and is_l(b11), do: {:non_reserved, :conditional} + + def tag([[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16]) when is_c(b1) and is_o(b2) and is_n(b3) and is_d(b4) and is_i(b5) and is_t(b6) and is_i(b7) and is_o(b8) and is_n(b9) and b10 in ~c"_" and is_n(b11) and is_u(b12) and is_m(b13) and is_b(b14) and is_e(b15) and is_r(b16), do: {:non_reserved, :condition_number} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_c(b1) and is_o(b2) and is_n(b3) and is_n(b4) and is_e(b5) and is_c(b6) and is_t(b7) and is_i(b8) and is_o(b9) and is_n(b10), do: {:non_reserved, :connection} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_c(b1) and is_o(b2) and is_n(b3) and is_n(b4) and is_e(b5) and is_c(b6) and is_t(b7) and is_i(b8) and is_o(b9) and is_n(b10) and b11 in ~c"_" and is_n(b12) and is_a(b13) and is_m(b14) and is_e(b15), do: {:non_reserved, :connection_name} + + def tag([[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18]) when is_c(b1) and is_o(b2) and is_n(b3) and is_s(b4) and is_t(b5) and is_r(b6) and is_a(b7) and is_i(b8) and is_n(b9) and is_t(b10) and b11 in ~c"_" and is_c(b12) and is_a(b13) and is_t(b14) and is_a(b15) and is_l(b16) and is_o(b17) and is_g(b18), do: {:non_reserved, :constraint_catalog} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_c(b1) and is_o(b2) and is_n(b3) and is_s(b4) and is_t(b5) and is_r(b6) and is_a(b7) and is_i(b8) and is_n(b9) and is_t(b10) and b11 in ~c"_" and is_n(b12) and is_a(b13) and is_m(b14) and is_e(b15), do: {:non_reserved, :constraint_name} + + def tag([[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17]) when is_c(b1) and is_o(b2) and is_n(b3) and is_s(b4) and is_t(b5) and is_r(b6) and is_a(b7) and is_i(b8) and is_n(b9) and is_t(b10) and b11 in ~c"_" and is_s(b12) and is_c(b13) and is_h(b14) and is_e(b15) and is_m(b16) and is_a(b17), do: {:non_reserved, :constraint_schema} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_c(b1) and is_o(b2) and is_n(b3) and is_s(b4) and is_t(b5) and is_r(b6) and is_a(b7) and is_i(b8) and is_n(b9) and is_t(b10) and is_s(b11), do: {:non_reserved, :constraints} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_c(b1) and is_o(b2) and is_n(b3) and is_s(b4) and is_t(b5) and is_r(b6) and is_u(b7) and is_c(b8) and is_t(b9) and is_o(b10) and is_r(b11), do: {:non_reserved, :constructor} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_c(b1) and is_o(b2) and is_n(b3) and is_t(b4) and is_i(b5) and is_n(b6) and is_u(b7) and is_e(b8), do: {:non_reserved, :continue} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_c(b1) and is_o(b2) and is_p(b3) and is_a(b4) and is_r(b5) and is_t(b6) and is_i(b7) and is_t(b8) and is_i(b9) and is_o(b10) and is_n(b11), do: {:non_reserved, :copartition} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_c(b1) and is_u(b2) and is_r(b3) and is_s(b4) and is_o(b5) and is_r(b6) and b7 in ~c"_" and is_n(b8) and is_a(b9) and is_m(b10) and is_e(b11), do: {:non_reserved, :cursor_name} + + def tag([[[[[], b1], b2], b3], b4]) when is_d(b1) and is_a(b2) and is_t(b3) and is_a(b4), do: {:non_reserved, :data} + + def tag([[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22]) when is_d(b1) and is_a(b2) and is_t(b3) and is_e(b4) and is_t(b5) and is_i(b6) and is_m(b7) and is_e(b8) and b9 in ~c"_" and is_i(b10) and is_n(b11) and is_t(b12) and is_e(b13) and is_r(b14) and is_v(b15) and is_a(b16) and is_l(b17) and b18 in ~c"_" and is_c(b19) and is_o(b20) and is_d(b21) and is_e(b22), do: {:non_reserved, :datetime_interval_code} + + def tag([[[[[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24], b25], b26], b27]) when is_d(b1) and is_a(b2) and is_t(b3) and is_e(b4) and is_t(b5) and is_i(b6) and is_m(b7) and is_e(b8) and b9 in ~c"_" and is_i(b10) and is_n(b11) and is_t(b12) and is_e(b13) and is_r(b14) and is_v(b15) and is_a(b16) and is_l(b17) and b18 in ~c"_" and is_p(b19) and is_r(b20) and is_e(b21) and is_c(b22) and is_i(b23) and is_s(b24) and is_i(b25) and is_o(b26) and is_n(b27), do: {:non_reserved, :datetime_interval_precision} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_d(b1) and is_e(b2) and is_f(b3) and is_a(b4) and is_u(b5) and is_l(b6) and is_t(b7) and is_s(b8), do: {:non_reserved, :defaults} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_d(b1) and is_e(b2) and is_f(b3) and is_e(b4) and is_r(b5) and is_r(b6) and is_a(b7) and is_b(b8) and is_l(b9) and is_e(b10), do: {:non_reserved, :deferrable} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_d(b1) and is_e(b2) and is_f(b3) and is_e(b4) and is_r(b5) and is_r(b6) and is_e(b7) and is_d(b8), do: {:non_reserved, :deferred} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_d(b1) and is_e(b2) and is_f(b3) and is_i(b4) and is_n(b5) and is_e(b6) and is_d(b7), do: {:non_reserved, :defined} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_d(b1) and is_e(b2) and is_f(b3) and is_i(b4) and is_n(b5) and is_e(b6) and is_r(b7), do: {:non_reserved, :definer} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_d(b1) and is_e(b2) and is_g(b3) and is_r(b4) and is_e(b5) and is_e(b6), do: {:non_reserved, :degree} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_d(b1) and is_e(b2) and is_p(b3) and is_t(b4) and is_h(b5), do: {:non_reserved, :depth} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_d(b1) and is_e(b2) and is_r(b3) and is_i(b4) and is_v(b5) and is_e(b6) and is_d(b7), do: {:non_reserved, :derived} + + def tag([[[[[], b1], b2], b3], b4]) when is_d(b1) and is_e(b2) and is_s(b3) and is_c(b4), do: {:non_reserved, :desc} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_d(b1) and is_e(b2) and is_s(b3) and is_c(b4) and is_r(b5) and is_i(b6) and is_p(b7) and is_t(b8) and is_o(b9) and is_r(b10), do: {:non_reserved, :descriptor} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_d(b1) and is_i(b2) and is_a(b3) and is_g(b4) and is_n(b5) and is_o(b6) and is_s(b7) and is_t(b8) and is_i(b9) and is_c(b10) and is_s(b11), do: {:non_reserved, :diagnostics} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_d(b1) and is_i(b2) and is_s(b3) and is_p(b4) and is_a(b5) and is_t(b6) and is_c(b7) and is_h(b8), do: {:non_reserved, :dispatch} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_d(b1) and is_o(b2) and is_m(b3) and is_a(b4) and is_i(b5) and is_n(b6), do: {:non_reserved, :domain} + + def tag([[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16]) when is_d(b1) and is_y(b2) and is_n(b3) and is_a(b4) and is_m(b5) and is_i(b6) and is_c(b7) and b8 in ~c"_" and is_f(b9) and is_u(b10) and is_n(b11) and is_c(b12) and is_t(b13) and is_i(b14) and is_o(b15) and is_n(b16), do: {:non_reserved, :dynamic_function} + + def tag([[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21]) when is_d(b1) and is_y(b2) and is_n(b3) and is_a(b4) and is_m(b5) and is_i(b6) and is_c(b7) and b8 in ~c"_" and is_f(b9) and is_u(b10) and is_n(b11) and is_c(b12) and is_t(b13) and is_i(b14) and is_o(b15) and is_n(b16) and b17 in ~c"_" and is_c(b18) and is_o(b19) and is_d(b20) and is_e(b21), do: {:non_reserved, :dynamic_function_code} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_e(b1) and is_n(b2) and is_c(b3) and is_o(b4) and is_d(b5) and is_i(b6) and is_n(b7) and is_g(b8), do: {:non_reserved, :encoding} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_e(b1) and is_n(b2) and is_f(b3) and is_o(b4) and is_r(b5) and is_c(b6) and is_e(b7) and is_d(b8), do: {:non_reserved, :enforced} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_e(b1) and is_r(b2) and is_r(b3) and is_o(b4) and is_r(b5), do: {:non_reserved, :error} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_e(b1) and is_x(b2) and is_c(b3) and is_l(b4) and is_u(b5) and is_d(b6) and is_e(b7), do: {:non_reserved, :exclude} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_e(b1) and is_x(b2) and is_c(b3) and is_l(b4) and is_u(b5) and is_d(b6) and is_i(b7) and is_n(b8) and is_g(b9), do: {:non_reserved, :excluding} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_e(b1) and is_x(b2) and is_p(b3) and is_r(b4) and is_e(b5) and is_s(b6) and is_s(b7) and is_i(b8) and is_o(b9) and is_n(b10), do: {:non_reserved, :expression} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_f(b1) and is_i(b2) and is_n(b3) and is_a(b4) and is_l(b5), do: {:non_reserved, :final} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_f(b1) and is_i(b2) and is_n(b3) and is_i(b4) and is_s(b5) and is_h(b6), do: {:non_reserved, :finish} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_f(b1) and is_i(b2) and is_r(b3) and is_s(b4) and is_t(b5), do: {:non_reserved, :first} + + def tag([[[[[], b1], b2], b3], b4]) when is_f(b1) and is_l(b2) and is_a(b3) and is_g(b4), do: {:non_reserved, :flag} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_f(b1) and is_o(b2) and is_l(b3) and is_l(b4) and is_o(b5) and is_w(b6) and is_i(b7) and is_n(b8) and is_g(b9), do: {:non_reserved, :following} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_f(b1) and is_o(b2) and is_r(b3) and is_m(b4) and is_a(b5) and is_t(b6), do: {:non_reserved, :format} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_f(b1) and is_o(b2) and is_r(b3) and is_t(b4) and is_r(b5) and is_a(b6) and is_n(b7), do: {:non_reserved, :fortran} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_f(b1) and is_o(b2) and is_u(b3) and is_n(b4) and is_d(b5), do: {:non_reserved, :found} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_f(b1) and is_u(b2) and is_l(b3) and is_f(b4) and is_i(b5) and is_l(b6) and is_l(b7), do: {:non_reserved, :fulfill} + + def tag([[], b1]) when is_g(b1), do: {:non_reserved, :g} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_g(b1) and is_e(b2) and is_n(b3) and is_e(b4) and is_r(b5) and is_a(b6) and is_l(b7), do: {:non_reserved, :general} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_g(b1) and is_e(b2) and is_n(b3) and is_e(b4) and is_r(b5) and is_a(b6) and is_t(b7) and is_e(b8) and is_d(b9), do: {:non_reserved, :generated} + + def tag([[[], b1], b2]) when is_g(b1) and is_o(b2), do: {:non_reserved, :go} + + def tag([[[[[], b1], b2], b3], b4]) when is_g(b1) and is_o(b2) and is_t(b3) and is_o(b4), do: {:non_reserved, :goto} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_g(b1) and is_r(b2) and is_a(b3) and is_n(b4) and is_t(b5) and is_e(b6) and is_d(b7), do: {:non_reserved, :granted} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_h(b1) and is_i(b2) and is_e(b3) and is_r(b4) and is_a(b5) and is_r(b6) and is_c(b7) and is_h(b8) and is_y(b9), do: {:non_reserved, :hierarchy} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_i(b1) and is_g(b2) and is_n(b3) and is_o(b4) and is_r(b5) and is_e(b6), do: {:non_reserved, :ignore} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_i(b1) and is_m(b2) and is_m(b3) and is_e(b4) and is_d(b5) and is_i(b6) and is_a(b7) and is_t(b8) and is_e(b9), do: {:non_reserved, :immediate} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_i(b1) and is_m(b2) and is_m(b3) and is_e(b4) and is_d(b5) and is_i(b6) and is_a(b7) and is_t(b8) and is_e(b9) and is_l(b10) and is_y(b11), do: {:non_reserved, :immediately} + + def tag([[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when is_i(b1) and is_m(b2) and is_p(b3) and is_l(b4) and is_e(b5) and is_m(b6) and is_e(b7) and is_n(b8) and is_t(b9) and is_a(b10) and is_t(b11) and is_i(b12) and is_o(b13) and is_n(b14), do: {:non_reserved, :implementation} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_i(b1) and is_n(b2) and is_c(b3) and is_l(b4) and is_u(b5) and is_d(b6) and is_i(b7) and is_n(b8) and is_g(b9), do: {:non_reserved, :including} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_i(b1) and is_n(b2) and is_c(b3) and is_r(b4) and is_e(b5) and is_m(b6) and is_e(b7) and is_n(b8) and is_t(b9), do: {:non_reserved, :increment} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_i(b1) and is_n(b2) and is_i(b3) and is_t(b4) and is_i(b5) and is_a(b6) and is_l(b7) and is_l(b8) and is_y(b9), do: {:non_reserved, :initially} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_i(b1) and is_n(b2) and is_p(b3) and is_u(b4) and is_t(b5), do: {:non_reserved, :input} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_i(b1) and is_n(b2) and is_s(b3) and is_t(b4) and is_a(b5) and is_n(b6) and is_c(b7) and is_e(b8), do: {:non_reserved, :instance} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_i(b1) and is_n(b2) and is_s(b3) and is_t(b4) and is_a(b5) and is_n(b6) and is_t(b7) and is_i(b8) and is_a(b9) and is_b(b10) and is_l(b11) and is_e(b12), do: {:non_reserved, :instantiable} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_i(b1) and is_n(b2) and is_s(b3) and is_t(b4) and is_e(b5) and is_a(b6) and is_d(b7), do: {:non_reserved, :instead} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_i(b1) and is_n(b2) and is_v(b3) and is_o(b4) and is_k(b5) and is_e(b6) and is_r(b7), do: {:non_reserved, :invoker} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_i(b1) and is_s(b2) and is_o(b3) and is_l(b4) and is_a(b5) and is_t(b6) and is_i(b7) and is_o(b8) and is_n(b9), do: {:non_reserved, :isolation} + + def tag([[], b1]) when is_k(b1), do: {:non_reserved, :k} + + def tag([[[[[], b1], b2], b3], b4]) when is_k(b1) and is_e(b2) and is_e(b3) and is_p(b4), do: {:non_reserved, :keep} + + def tag([[[[], b1], b2], b3]) when is_k(b1) and is_e(b2) and is_y(b3), do: {:non_reserved, :key} + + def tag([[[[[], b1], b2], b3], b4]) when is_k(b1) and is_e(b2) and is_y(b3) and is_s(b4), do: {:non_reserved, :keys} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_k(b1) and is_e(b2) and is_y(b3) and b4 in ~c"_" and is_m(b5) and is_e(b6) and is_m(b7) and is_b(b8) and is_e(b9) and is_r(b10), do: {:non_reserved, :key_member} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_k(b1) and is_e(b2) and is_y(b3) and b4 in ~c"_" and is_t(b5) and is_y(b6) and is_p(b7) and is_e(b8), do: {:non_reserved, :key_type} + + def tag([[[[[], b1], b2], b3], b4]) when is_l(b1) and is_a(b2) and is_s(b3) and is_t(b4), do: {:non_reserved, :last} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_l(b1) and is_e(b2) and is_n(b3) and is_g(b4) and is_t(b5) and is_h(b6), do: {:non_reserved, :length} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_l(b1) and is_e(b2) and is_v(b3) and is_e(b4) and is_l(b5), do: {:non_reserved, :level} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_l(b1) and is_o(b2) and is_c(b3) and is_a(b4) and is_t(b5) and is_o(b6) and is_r(b7), do: {:non_reserved, :locator} + + def tag([[], b1]) when is_m(b1), do: {:non_reserved, :m} + + def tag([[[[], b1], b2], b3]) when is_m(b1) and is_a(b2) and is_p(b3), do: {:non_reserved, :map} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_m(b1) and is_a(b2) and is_t(b3) and is_c(b4) and is_h(b5) and is_e(b6) and is_d(b7), do: {:non_reserved, :matched} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_m(b1) and is_a(b2) and is_x(b3) and is_v(b4) and is_a(b5) and is_l(b6) and is_u(b7) and is_e(b8), do: {:non_reserved, :maxvalue} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_m(b1) and is_e(b2) and is_a(b3) and is_s(b4) and is_u(b5) and is_r(b6) and is_e(b7) and is_s(b8), do: {:non_reserved, :measures} + + def tag([[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when is_m(b1) and is_e(b2) and is_s(b3) and is_s(b4) and is_a(b5) and is_g(b6) and is_e(b7) and b8 in ~c"_" and is_l(b9) and is_e(b10) and is_n(b11) and is_g(b12) and is_t(b13) and is_h(b14), do: {:non_reserved, :message_length} + + def tag([[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20]) when is_m(b1) and is_e(b2) and is_s(b3) and is_s(b4) and is_a(b5) and is_g(b6) and is_e(b7) and b8 in ~c"_" and is_o(b9) and is_c(b10) and is_t(b11) and is_e(b12) and is_t(b13) and b14 in ~c"_" and is_l(b15) and is_e(b16) and is_n(b17) and is_g(b18) and is_t(b19) and is_h(b20), do: {:non_reserved, :message_octet_length} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_m(b1) and is_e(b2) and is_s(b3) and is_s(b4) and is_a(b5) and is_g(b6) and is_e(b7) and b8 in ~c"_" and is_t(b9) and is_e(b10) and is_x(b11) and is_t(b12), do: {:non_reserved, :message_text} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_m(b1) and is_i(b2) and is_n(b3) and is_v(b4) and is_a(b5) and is_l(b6) and is_u(b7) and is_e(b8), do: {:non_reserved, :minvalue} + + def tag([[[[[], b1], b2], b3], b4]) when is_m(b1) and is_o(b2) and is_r(b3) and is_e(b4), do: {:non_reserved, :more} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_m(b1) and is_u(b2) and is_m(b3) and is_p(b4) and is_s(b5), do: {:non_reserved, :mumps} + + def tag([[[[[], b1], b2], b3], b4]) when is_n(b1) and is_a(b2) and is_m(b3) and is_e(b4), do: {:non_reserved, :name} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_n(b1) and is_a(b2) and is_m(b3) and is_e(b4) and is_s(b5), do: {:non_reserved, :names} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_n(b1) and is_e(b2) and is_s(b3) and is_t(b4) and is_e(b5) and is_d(b6), do: {:non_reserved, :nested} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_n(b1) and is_e(b2) and is_s(b3) and is_t(b4) and is_i(b5) and is_n(b6) and is_g(b7), do: {:non_reserved, :nesting} + + def tag([[[[[], b1], b2], b3], b4]) when is_n(b1) and is_e(b2) and is_x(b3) and is_t(b4), do: {:non_reserved, :next} + + def tag([[[[], b1], b2], b3]) when is_n(b1) and is_f(b2) and is_c(b3), do: {:non_reserved, :nfc} + + def tag([[[[], b1], b2], b3]) when is_n(b1) and is_f(b2) and is_d(b3), do: {:non_reserved, :nfd} + + def tag([[[[[], b1], b2], b3], b4]) when is_n(b1) and is_f(b2) and is_k(b3) and is_c(b4), do: {:non_reserved, :nfkc} + + def tag([[[[[], b1], b2], b3], b4]) when is_n(b1) and is_f(b2) and is_k(b3) and is_d(b4), do: {:non_reserved, :nfkd} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_n(b1) and is_o(b2) and is_r(b3) and is_m(b4) and is_a(b5) and is_l(b6) and is_i(b7) and is_z(b8) and is_e(b9) and is_d(b10), do: {:non_reserved, :normalized} + + def tag([[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when is_n(b1) and is_u(b2) and is_l(b3) and is_l(b4) and b5 in ~c"_" and is_o(b6) and is_r(b7) and is_d(b8) and is_e(b9) and is_r(b10) and is_i(b11) and is_n(b12) and is_g(b13), do: {:non_reserved, :null_ordering} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_n(b1) and is_u(b2) and is_l(b3) and is_l(b4) and is_a(b5) and is_b(b6) and is_l(b7) and is_e(b8), do: {:non_reserved, :nullable} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_n(b1) and is_u(b2) and is_l(b3) and is_l(b4) and is_s(b5), do: {:non_reserved, :nulls} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_n(b1) and is_u(b2) and is_m(b3) and is_b(b4) and is_e(b5) and is_r(b6), do: {:non_reserved, :number} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_o(b1) and is_b(b2) and is_j(b3) and is_e(b4) and is_c(b5) and is_t(b6), do: {:non_reserved, :object} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_o(b1) and is_c(b2) and is_c(b3) and is_u(b4) and is_r(b5) and is_r(b6) and is_e(b7) and is_n(b8) and is_c(b9) and is_e(b10), do: {:non_reserved, :occurrence} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_o(b1) and is_c(b2) and is_t(b3) and is_e(b4) and is_t(b5) and is_s(b6), do: {:non_reserved, :octets} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_o(b1) and is_p(b2) and is_t(b3) and is_i(b4) and is_o(b5) and is_n(b6), do: {:non_reserved, :option} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_o(b1) and is_p(b2) and is_t(b3) and is_i(b4) and is_o(b5) and is_n(b6) and is_s(b7), do: {:non_reserved, :options} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_o(b1) and is_r(b2) and is_d(b3) and is_e(b4) and is_r(b5) and is_i(b6) and is_n(b7) and is_g(b8), do: {:non_reserved, :ordering} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_o(b1) and is_r(b2) and is_d(b3) and is_i(b4) and is_n(b5) and is_a(b6) and is_l(b7) and is_i(b8) and is_t(b9) and is_y(b10), do: {:non_reserved, :ordinality} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_o(b1) and is_t(b2) and is_h(b3) and is_e(b4) and is_r(b5) and is_s(b6), do: {:non_reserved, :others} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_o(b1) and is_u(b2) and is_t(b3) and is_p(b4) and is_u(b5) and is_t(b6), do: {:non_reserved, :output} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_o(b1) and is_v(b2) and is_e(b3) and is_r(b4) and is_f(b5) and is_l(b6) and is_o(b7) and is_w(b8), do: {:non_reserved, :overflow} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_o(b1) and is_v(b2) and is_e(b3) and is_r(b4) and is_r(b5) and is_i(b6) and is_d(b7) and is_i(b8) and is_n(b9) and is_g(b10), do: {:non_reserved, :overriding} + + def tag([[], b1]) when is_p(b1), do: {:non_reserved, :p} + + def tag([[[[], b1], b2], b3]) when is_p(b1) and is_a(b2) and is_d(b3), do: {:non_reserved, :pad} + + def tag([[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when is_p(b1) and is_a(b2) and is_r(b3) and is_a(b4) and is_m(b5) and is_e(b6) and is_t(b7) and is_e(b8) and is_r(b9) and b10 in ~c"_" and is_m(b11) and is_o(b12) and is_d(b13) and is_e(b14), do: {:non_reserved, :parameter_mode} + + def tag([[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when is_p(b1) and is_a(b2) and is_r(b3) and is_a(b4) and is_m(b5) and is_e(b6) and is_t(b7) and is_e(b8) and is_r(b9) and b10 in ~c"_" and is_n(b11) and is_a(b12) and is_m(b13) and is_e(b14), do: {:non_reserved, :parameter_name} + + def tag([[[[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24], b25], b26]) when is_p(b1) and is_a(b2) and is_r(b3) and is_a(b4) and is_m(b5) and is_e(b6) and is_t(b7) and is_e(b8) and is_r(b9) and b10 in ~c"_" and is_o(b11) and is_r(b12) and is_d(b13) and is_i(b14) and is_n(b15) and is_a(b16) and is_l(b17) and b18 in ~c"_" and is_p(b19) and is_o(b20) and is_s(b21) and is_i(b22) and is_t(b23) and is_i(b24) and is_o(b25) and is_n(b26), do: {:non_reserved, :parameter_ordinal_position} + + def tag([[[[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24], b25], b26]) when is_p(b1) and is_a(b2) and is_r(b3) and is_a(b4) and is_m(b5) and is_e(b6) and is_t(b7) and is_e(b8) and is_r(b9) and b10 in ~c"_" and is_s(b11) and is_p(b12) and is_e(b13) and is_c(b14) and is_i(b15) and is_f(b16) and is_i(b17) and is_c(b18) and b19 in ~c"_" and is_c(b20) and is_a(b21) and is_t(b22) and is_a(b23) and is_l(b24) and is_o(b25) and is_g(b26), do: {:non_reserved, :parameter_specific_catalog} + + def tag([[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23]) when is_p(b1) and is_a(b2) and is_r(b3) and is_a(b4) and is_m(b5) and is_e(b6) and is_t(b7) and is_e(b8) and is_r(b9) and b10 in ~c"_" and is_s(b11) and is_p(b12) and is_e(b13) and is_c(b14) and is_i(b15) and is_f(b16) and is_i(b17) and is_c(b18) and b19 in ~c"_" and is_n(b20) and is_a(b21) and is_m(b22) and is_e(b23), do: {:non_reserved, :parameter_specific_name} + + def tag([[[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24], b25]) when is_p(b1) and is_a(b2) and is_r(b3) and is_a(b4) and is_m(b5) and is_e(b6) and is_t(b7) and is_e(b8) and is_r(b9) and b10 in ~c"_" and is_s(b11) and is_p(b12) and is_e(b13) and is_c(b14) and is_i(b15) and is_f(b16) and is_i(b17) and is_c(b18) and b19 in ~c"_" and is_s(b20) and is_c(b21) and is_h(b22) and is_e(b23) and is_m(b24) and is_a(b25), do: {:non_reserved, :parameter_specific_schema} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_p(b1) and is_a(b2) and is_r(b3) and is_t(b4) and is_i(b5) and is_a(b6) and is_l(b7), do: {:non_reserved, :partial} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_p(b1) and is_a(b2) and is_s(b3) and is_c(b4) and is_a(b5) and is_l(b6), do: {:non_reserved, :pascal} + + def tag([[[[[], b1], b2], b3], b4]) when is_p(b1) and is_a(b2) and is_s(b3) and is_s(b4), do: {:non_reserved, :pass} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_p(b1) and is_a(b2) and is_s(b3) and is_s(b4) and is_i(b5) and is_n(b6) and is_g(b7), do: {:non_reserved, :passing} + + def tag([[[[[], b1], b2], b3], b4]) when is_p(b1) and is_a(b2) and is_s(b3) and is_t(b4), do: {:non_reserved, :past} + + def tag([[[[[], b1], b2], b3], b4]) when is_p(b1) and is_a(b2) and is_t(b3) and is_h(b4), do: {:non_reserved, :path} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_p(b1) and is_e(b2) and is_r(b3) and is_m(b4) and is_u(b5) and is_t(b6) and is_e(b7), do: {:non_reserved, :permute} + + def tag([[[[[], b1], b2], b3], b4]) when is_p(b1) and is_i(b2) and is_p(b3) and is_e(b4), do: {:non_reserved, :pipe} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_p(b1) and is_l(b2) and is_a(b3) and is_c(b4) and is_i(b5) and is_n(b6) and is_g(b7), do: {:non_reserved, :placing} + + def tag([[[[[], b1], b2], b3], b4]) when is_p(b1) and is_l(b2) and is_a(b3) and is_n(b4), do: {:non_reserved, :plan} + + def tag([[[[], b1], b2], b3]) when is_p(b1) and is_l(b2) and is_i(b3), do: {:non_reserved, :pli} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_p(b1) and is_r(b2) and is_e(b3) and is_c(b4) and is_e(b5) and is_d(b6) and is_i(b7) and is_n(b8) and is_g(b9), do: {:non_reserved, :preceding} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_p(b1) and is_r(b2) and is_e(b3) and is_s(b4) and is_e(b5) and is_r(b6) and is_v(b7) and is_e(b8), do: {:non_reserved, :preserve} + + def tag([[[[[], b1], b2], b3], b4]) when is_p(b1) and is_r(b2) and is_e(b3) and is_v(b4), do: {:non_reserved, :prev} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_p(b1) and is_r(b2) and is_i(b3) and is_o(b4) and is_r(b5), do: {:non_reserved, :prior} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_p(b1) and is_r(b2) and is_i(b3) and is_v(b4) and is_a(b5) and is_t(b6) and is_e(b7), do: {:non_reserved, :private} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_p(b1) and is_r(b2) and is_i(b3) and is_v(b4) and is_i(b5) and is_l(b6) and is_e(b7) and is_g(b8) and is_e(b9) and is_s(b10), do: {:non_reserved, :privileges} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_p(b1) and is_r(b2) and is_u(b3) and is_n(b4) and is_e(b5), do: {:non_reserved, :prune} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_p(b1) and is_u(b2) and is_b(b3) and is_l(b4) and is_i(b5) and is_c(b6), do: {:non_reserved, :public} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_q(b1) and is_u(b2) and is_o(b3) and is_t(b4) and is_e(b5) and is_s(b6), do: {:non_reserved, :quotes} + + def tag([[[[[], b1], b2], b3], b4]) when is_r(b1) and is_e(b2) and is_a(b3) and is_d(b4), do: {:non_reserved, :read} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_r(b1) and is_e(b2) and is_l(b3) and is_a(b4) and is_t(b5) and is_i(b6) and is_v(b7) and is_e(b8), do: {:non_reserved, :relative} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_r(b1) and is_e(b2) and is_p(b3) and is_e(b4) and is_a(b5) and is_t(b6) and is_a(b7) and is_b(b8) and is_l(b9) and is_e(b10), do: {:non_reserved, :repeatable} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_r(b1) and is_e(b2) and is_s(b3) and is_p(b4) and is_e(b5) and is_c(b6) and is_t(b7), do: {:non_reserved, :respect} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_r(b1) and is_e(b2) and is_s(b3) and is_t(b4) and is_a(b5) and is_r(b6) and is_t(b7), do: {:non_reserved, :restart} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_r(b1) and is_e(b2) and is_s(b3) and is_t(b4) and is_r(b5) and is_i(b6) and is_c(b7) and is_t(b8), do: {:non_reserved, :restrict} + + def tag([[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20]) when is_r(b1) and is_e(b2) and is_t(b3) and is_u(b4) and is_r(b5) and is_n(b6) and is_e(b7) and is_d(b8) and b9 in ~c"_" and is_c(b10) and is_a(b11) and is_r(b12) and is_d(b13) and is_i(b14) and is_n(b15) and is_a(b16) and is_l(b17) and is_i(b18) and is_t(b19) and is_y(b20), do: {:non_reserved, :returned_cardinality} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_r(b1) and is_e(b2) and is_t(b3) and is_u(b4) and is_r(b5) and is_n(b6) and is_e(b7) and is_d(b8) and b9 in ~c"_" and is_l(b10) and is_e(b11) and is_n(b12) and is_g(b13) and is_t(b14) and is_h(b15), do: {:non_reserved, :returned_length} + + def tag([[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21]) when is_r(b1) and is_e(b2) and is_t(b3) and is_u(b4) and is_r(b5) and is_n(b6) and is_e(b7) and is_d(b8) and b9 in ~c"_" and is_o(b10) and is_c(b11) and is_t(b12) and is_e(b13) and is_t(b14) and b15 in ~c"_" and is_l(b16) and is_e(b17) and is_n(b18) and is_g(b19) and is_t(b20) and is_h(b21), do: {:non_reserved, :returned_octet_length} + + def tag([[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17]) when is_r(b1) and is_e(b2) and is_t(b3) and is_u(b4) and is_r(b5) and is_n(b6) and is_e(b7) and is_d(b8) and b9 in ~c"_" and is_s(b10) and is_q(b11) and is_l(b12) and is_s(b13) and is_t(b14) and is_a(b15) and is_t(b16) and is_e(b17), do: {:non_reserved, :returned_sqlstate} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_r(b1) and is_e(b2) and is_t(b3) and is_u(b4) and is_r(b5) and is_n(b6) and is_i(b7) and is_n(b8) and is_g(b9), do: {:non_reserved, :returning} + + def tag([[[[[], b1], b2], b3], b4]) when is_r(b1) and is_o(b2) and is_l(b3) and is_e(b4), do: {:non_reserved, :role} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_r(b1) and is_o(b2) and is_u(b3) and is_t(b4) and is_i(b5) and is_n(b6) and is_e(b7), do: {:non_reserved, :routine} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_r(b1) and is_o(b2) and is_u(b3) and is_t(b4) and is_i(b5) and is_n(b6) and is_e(b7) and b8 in ~c"_" and is_c(b9) and is_a(b10) and is_t(b11) and is_a(b12) and is_l(b13) and is_o(b14) and is_g(b15), do: {:non_reserved, :routine_catalog} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_r(b1) and is_o(b2) and is_u(b3) and is_t(b4) and is_i(b5) and is_n(b6) and is_e(b7) and b8 in ~c"_" and is_n(b9) and is_a(b10) and is_m(b11) and is_e(b12), do: {:non_reserved, :routine_name} + + def tag([[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when is_r(b1) and is_o(b2) and is_u(b3) and is_t(b4) and is_i(b5) and is_n(b6) and is_e(b7) and b8 in ~c"_" and is_s(b9) and is_c(b10) and is_h(b11) and is_e(b12) and is_m(b13) and is_a(b14), do: {:non_reserved, :routine_schema} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_r(b1) and is_o(b2) and is_w(b3) and b4 in ~c"_" and is_c(b5) and is_o(b6) and is_u(b7) and is_n(b8) and is_t(b9), do: {:non_reserved, :row_count} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_c(b2) and is_a(b3) and is_l(b4) and is_a(b5) and is_r(b6), do: {:non_reserved, :scalar} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_s(b1) and is_c(b2) and is_a(b3) and is_l(b4) and is_e(b5), do: {:non_reserved, :scale} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_c(b2) and is_h(b3) and is_e(b4) and is_m(b5) and is_a(b6), do: {:non_reserved, :schema} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_s(b1) and is_c(b2) and is_h(b3) and is_e(b4) and is_m(b5) and is_a(b6) and b7 in ~c"_" and is_n(b8) and is_a(b9) and is_m(b10) and is_e(b11), do: {:non_reserved, :schema_name} + + def tag([[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when is_s(b1) and is_c(b2) and is_o(b3) and is_p(b4) and is_e(b5) and b6 in ~c"_" and is_c(b7) and is_a(b8) and is_t(b9) and is_a(b10) and is_l(b11) and is_o(b12) and is_g(b13), do: {:non_reserved, :scope_catalog} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_s(b1) and is_c(b2) and is_o(b3) and is_p(b4) and is_e(b5) and b6 in ~c"_" and is_n(b7) and is_a(b8) and is_m(b9) and is_e(b10), do: {:non_reserved, :scope_name} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_s(b1) and is_c(b2) and is_o(b3) and is_p(b4) and is_e(b5) and b6 in ~c"_" and is_s(b7) and is_c(b8) and is_h(b9) and is_e(b10) and is_m(b11) and is_a(b12), do: {:non_reserved, :scope_schema} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_s(b1) and is_e(b2) and is_c(b3) and is_t(b4) and is_i(b5) and is_o(b6) and is_n(b7), do: {:non_reserved, :section} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_s(b1) and is_e(b2) and is_c(b3) and is_u(b4) and is_r(b5) and is_i(b6) and is_t(b7) and is_y(b8), do: {:non_reserved, :security} + + def tag([[[[[], b1], b2], b3], b4]) when is_s(b1) and is_e(b2) and is_l(b3) and is_f(b4), do: {:non_reserved, :self} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_s(b1) and is_e(b2) and is_m(b3) and is_a(b4) and is_n(b5) and is_t(b6) and is_i(b7) and is_c(b8) and is_s(b9), do: {:non_reserved, :semantics} + + def tag([[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when is_s(b1) and is_e(b2) and is_q(b3) and is_u(b4) and is_e(b5) and is_n(b6) and is_c(b7) and is_e(b8), do: {:non_reserved, :sequence} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_s(b1) and is_e(b2) and is_r(b3) and is_i(b4) and is_a(b5) and is_l(b6) and is_i(b7) and is_z(b8) and is_a(b9) and is_b(b10) and is_l(b11) and is_e(b12), do: {:non_reserved, :serializable} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_s(b1) and is_e(b2) and is_r(b3) and is_v(b4) and is_e(b5) and is_r(b6) and b7 in ~c"_" and is_n(b8) and is_a(b9) and is_m(b10) and is_e(b11), do: {:non_reserved, :server_name} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_s(b1) and is_e(b2) and is_s(b3) and is_s(b4) and is_i(b5) and is_o(b6) and is_n(b7), do: {:non_reserved, :session} + + def tag([[[[[], b1], b2], b3], b4]) when is_s(b1) and is_e(b2) and is_t(b3) and is_s(b4), do: {:non_reserved, :sets} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_i(b2) and is_m(b3) and is_p(b4) and is_l(b5) and is_e(b6), do: {:non_reserved, :simple} + + def tag([[[[[], b1], b2], b3], b4]) when is_s(b1) and is_i(b2) and is_z(b3) and is_e(b4), do: {:non_reserved, :size} + + def tag([[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when is_s(b1) and is_o(b2) and is_r(b3) and is_t(b4) and b5 in ~c"_" and is_d(b6) and is_i(b7) and is_r(b8) and is_e(b9) and is_c(b10) and is_t(b11) and is_i(b12) and is_o(b13) and is_n(b14), do: {:non_reserved, :sort_direction} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_o(b2) and is_u(b3) and is_r(b4) and is_c(b5) and is_e(b6), do: {:non_reserved, :source} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_s(b1) and is_p(b2) and is_a(b3) and is_c(b4) and is_e(b5), do: {:non_reserved, :space} + + def tag([[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when is_s(b1) and is_p(b2) and is_e(b3) and is_c(b4) and is_i(b5) and is_f(b6) and is_i(b7) and is_c(b8) and b9 in ~c"_" and is_n(b10) and is_a(b11) and is_m(b12) and is_e(b13), do: {:non_reserved, :specific_name} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_s(b1) and is_t(b2) and is_a(b3) and is_t(b4) and is_e(b5), do: {:non_reserved, :state} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_s(b1) and is_t(b2) and is_a(b3) and is_t(b4) and is_e(b5) and is_m(b6) and is_e(b7) and is_n(b8) and is_t(b9), do: {:non_reserved, :statement} + + def tag([[[[[[[], b1], b2], b3], b4], b5], b6]) when is_s(b1) and is_t(b2) and is_r(b3) and is_i(b4) and is_n(b5) and is_g(b6), do: {:non_reserved, :string} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_s(b1) and is_t(b2) and is_r(b3) and is_u(b4) and is_c(b5) and is_t(b6) and is_u(b7) and is_r(b8) and is_e(b9), do: {:non_reserved, :structure} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_s(b1) and is_t(b2) and is_y(b3) and is_l(b4) and is_e(b5), do: {:non_reserved, :style} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_s(b1) and is_u(b2) and is_b(b3) and is_c(b4) and is_l(b5) and is_a(b6) and is_s(b7) and is_s(b8) and b9 in ~c"_" and is_o(b10) and is_r(b11) and is_i(b12) and is_g(b13) and is_i(b14) and is_n(b15), do: {:non_reserved, :subclass_origin} + + def tag([[], b1]) when is_t(b1), do: {:non_reserved, :t} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_t(b1) and is_a(b2) and is_b(b3) and is_l(b4) and is_e(b5) and b6 in ~c"_" and is_n(b7) and is_a(b8) and is_m(b9) and is_e(b10), do: {:non_reserved, :table_name} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_t(b1) and is_e(b2) and is_m(b3) and is_p(b4) and is_o(b5) and is_r(b6) and is_a(b7) and is_r(b8) and is_y(b9), do: {:non_reserved, :temporary} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_t(b1) and is_h(b2) and is_r(b3) and is_o(b4) and is_u(b5) and is_g(b6) and is_h(b7), do: {:non_reserved, :through} + + def tag([[[[[], b1], b2], b3], b4]) when is_t(b1) and is_i(b2) and is_e(b3) and is_s(b4), do: {:non_reserved, :ties} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_t(b1) and is_o(b2) and is_p(b3) and b4 in ~c"_" and is_l(b5) and is_e(b6) and is_v(b7) and is_e(b8) and is_l(b9) and b10 in ~c"_" and is_c(b11) and is_o(b12) and is_u(b13) and is_n(b14) and is_t(b15), do: {:non_reserved, :top_level_count} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_t(b1) and is_r(b2) and is_a(b3) and is_n(b4) and is_s(b5) and is_a(b6) and is_c(b7) and is_t(b8) and is_i(b9) and is_o(b10) and is_n(b11), do: {:non_reserved, :transaction} + + def tag([[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18]) when is_t(b1) and is_r(b2) and is_a(b3) and is_n(b4) and is_s(b5) and is_a(b6) and is_c(b7) and is_t(b8) and is_i(b9) and is_o(b10) and is_n(b11) and b12 in ~c"_" and is_a(b13) and is_c(b14) and is_t(b15) and is_i(b16) and is_v(b17) and is_e(b18), do: {:non_reserved, :transaction_active} + + def tag([[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22]) when is_t(b1) and is_r(b2) and is_a(b3) and is_n(b4) and is_s(b5) and is_a(b6) and is_c(b7) and is_t(b8) and is_i(b9) and is_o(b10) and is_n(b11) and is_s(b12) and b13 in ~c"_" and is_c(b14) and is_o(b15) and is_m(b16) and is_m(b17) and is_i(b18) and is_t(b19) and is_t(b20) and is_e(b21) and is_d(b22), do: {:non_reserved, :transactions_committed} + + def tag([[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24]) when is_t(b1) and is_r(b2) and is_a(b3) and is_n(b4) and is_s(b5) and is_a(b6) and is_c(b7) and is_t(b8) and is_i(b9) and is_o(b10) and is_n(b11) and is_s(b12) and b13 in ~c"_" and is_r(b14) and is_o(b15) and is_l(b16) and is_l(b17) and is_e(b18) and is_d(b19) and b20 in ~c"_" and is_b(b21) and is_a(b22) and is_c(b23) and is_k(b24), do: {:non_reserved, :transactions_rolled_back} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_t(b1) and is_r(b2) and is_a(b3) and is_n(b4) and is_s(b5) and is_f(b6) and is_o(b7) and is_r(b8) and is_m(b9), do: {:non_reserved, :transform} + + def tag([[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when is_t(b1) and is_r(b2) and is_a(b3) and is_n(b4) and is_s(b5) and is_f(b6) and is_o(b7) and is_r(b8) and is_m(b9) and is_s(b10), do: {:non_reserved, :transforms} + + def tag([[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when is_t(b1) and is_r(b2) and is_i(b3) and is_g(b4) and is_g(b5) and is_e(b6) and is_r(b7) and b8 in ~c"_" and is_c(b9) and is_a(b10) and is_t(b11) and is_a(b12) and is_l(b13) and is_o(b14) and is_g(b15), do: {:non_reserved, :trigger_catalog} + + def tag([[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when is_t(b1) and is_r(b2) and is_i(b3) and is_g(b4) and is_g(b5) and is_e(b6) and is_r(b7) and b8 in ~c"_" and is_n(b9) and is_a(b10) and is_m(b11) and is_e(b12), do: {:non_reserved, :trigger_name} + + def tag([[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when is_t(b1) and is_r(b2) and is_i(b3) and is_g(b4) and is_g(b5) and is_e(b6) and is_r(b7) and b8 in ~c"_" and is_s(b9) and is_c(b10) and is_h(b11) and is_e(b12) and is_m(b13) and is_a(b14), do: {:non_reserved, :trigger_schema} + + def tag([[[[[], b1], b2], b3], b4]) when is_t(b1) and is_y(b2) and is_p(b3) and is_e(b4), do: {:non_reserved, :type} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_u(b1) and is_n(b2) and is_b(b3) and is_o(b4) and is_u(b5) and is_n(b6) and is_d(b7) and is_e(b8) and is_d(b9), do: {:non_reserved, :unbounded} + + def tag([[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when is_u(b1) and is_n(b2) and is_c(b3) and is_o(b4) and is_m(b5) and is_m(b6) and is_i(b7) and is_t(b8) and is_t(b9) and is_e(b10) and is_d(b11), do: {:non_reserved, :uncommitted} + + def tag([[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when is_u(b1) and is_n(b2) and is_c(b3) and is_o(b4) and is_n(b5) and is_d(b6) and is_i(b7) and is_t(b8) and is_i(b9) and is_o(b10) and is_n(b11) and is_a(b12) and is_l(b13), do: {:non_reserved, :unconditional} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_u(b1) and is_n(b2) and is_d(b3) and is_e(b4) and is_r(b5), do: {:non_reserved, :under} + + def tag([[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when is_u(b1) and is_n(b2) and is_m(b3) and is_a(b4) and is_t(b5) and is_c(b6) and is_h(b7) and is_e(b8) and is_d(b9), do: {:non_reserved, :unmatched} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_u(b1) and is_n(b2) and is_n(b3) and is_a(b4) and is_m(b5) and is_e(b6) and is_d(b7), do: {:non_reserved, :unnamed} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_u(b1) and is_s(b2) and is_a(b3) and is_g(b4) and is_e(b5), do: {:non_reserved, :usage} + + def tag([[[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24], b25]) when is_u(b1) and is_s(b2) and is_e(b3) and is_r(b4) and b5 in ~c"_" and is_d(b6) and is_e(b7) and is_f(b8) and is_i(b9) and is_n(b10) and is_e(b11) and is_d(b12) and b13 in ~c"_" and is_t(b14) and is_y(b15) and is_p(b16) and is_e(b17) and b18 in ~c"_" and is_c(b19) and is_a(b20) and is_t(b21) and is_a(b22) and is_l(b23) and is_o(b24) and is_g(b25), do: {:non_reserved, :user_defined_type_catalog} + + def tag([[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22]) when is_u(b1) and is_s(b2) and is_e(b3) and is_r(b4) and b5 in ~c"_" and is_d(b6) and is_e(b7) and is_f(b8) and is_i(b9) and is_n(b10) and is_e(b11) and is_d(b12) and b13 in ~c"_" and is_t(b14) and is_y(b15) and is_p(b16) and is_e(b17) and b18 in ~c"_" and is_c(b19) and is_o(b20) and is_d(b21) and is_e(b22), do: {:non_reserved, :user_defined_type_code} + + def tag([[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22]) when is_u(b1) and is_s(b2) and is_e(b3) and is_r(b4) and b5 in ~c"_" and is_d(b6) and is_e(b7) and is_f(b8) and is_i(b9) and is_n(b10) and is_e(b11) and is_d(b12) and b13 in ~c"_" and is_t(b14) and is_y(b15) and is_p(b16) and is_e(b17) and b18 in ~c"_" and is_n(b19) and is_a(b20) and is_m(b21) and is_e(b22), do: {:non_reserved, :user_defined_type_name} + + def tag([[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24]) when is_u(b1) and is_s(b2) and is_e(b3) and is_r(b4) and b5 in ~c"_" and is_d(b6) and is_e(b7) and is_f(b8) and is_i(b9) and is_n(b10) and is_e(b11) and is_d(b12) and b13 in ~c"_" and is_t(b14) and is_y(b15) and is_p(b16) and is_e(b17) and b18 in ~c"_" and is_s(b19) and is_c(b20) and is_h(b21) and is_e(b22) and is_m(b23) and is_a(b24), do: {:non_reserved, :user_defined_type_schema} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_u(b1) and is_t(b2) and is_f(b3) and b4 in ~c"1" and b5 in ~c"6", do: {:non_reserved, :utf16} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_u(b1) and is_t(b2) and is_f(b3) and b4 in ~c"3" and b5 in ~c"2", do: {:non_reserved, :utf32} + + def tag([[[[[], b1], b2], b3], b4]) when is_u(b1) and is_t(b2) and is_f(b3) and b4 in ~c"8", do: {:non_reserved, :utf8} + + def tag([[[[[], b1], b2], b3], b4]) when is_v(b1) and is_i(b2) and is_e(b3) and is_w(b4), do: {:non_reserved, :view} + + def tag([[[[[], b1], b2], b3], b4]) when is_w(b1) and is_o(b2) and is_r(b3) and is_k(b4), do: {:non_reserved, :work} + + def tag([[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when is_w(b1) and is_r(b2) and is_a(b3) and is_p(b4) and is_p(b5) and is_e(b6) and is_r(b7), do: {:non_reserved, :wrapper} + + def tag([[[[[[], b1], b2], b3], b4], b5]) when is_w(b1) and is_r(b2) and is_i(b3) and is_t(b4) and is_e(b5), do: {:non_reserved, :write} + + def tag([[[[[], b1], b2], b3], b4]) when is_z(b1) and is_o(b2) and is_n(b3) and is_e(b4), do: {:non_reserved, :zone} + + + def tag([[[[], ?^], ?-], ?=]), do: :"^-=" + + def tag([[[[], ?<], ?=], ?>]), do: :"<=>" + + def tag([[[[], ?-], ?>], ?>]), do: :"->>" + + def tag([[[[], ?|], ?|], ?/]), do: :"||/" + + def tag([[[[], ?!], ?~], ?*]), do: :"!~*" + + def tag([[[[], ?<], ?<], ?|]), do: :"<<|" + + def tag([[[[], ?|], ?>], ?>]), do: :"|>>" + + def tag([[[[], ?&], ?<], ?|]), do: :"&<|" + + def tag([[[[], ?|], ?&], ?>]), do: :"|&>" + + def tag([[[[], ??], ?-], ?|]), do: :"?-|" + + def tag([[[[], ??], ?|], ?|]), do: :"?||" + + def tag([[[[], ?<], ?<], ?=]), do: :"<<=" + + def tag([[[[], ?>], ?>], ?=]), do: :">>=" + + def tag([[[[], ?#], ?>], ?>]), do: :"#>>" + + def tag([[[[], ?-], ?|], ?-]), do: :"-|-" + + def tag([[[], ?&], ?&]), do: :&& + + def tag([[[], ?|], ?|]), do: :|| + + def tag([[[], ?&], ?=]), do: :"&=" + + def tag([[[], ?^], ?=]), do: :"^=" + + def tag([[[], ?|], ?=]), do: :"|=" + + def tag([[[[], ?|], ?*], ?=]), do: :"|*=" + + def tag([[[], ?>], ?>]), do: :">>" + + def tag([[[], ?<], ?<]), do: :"<<" + + def tag([[[], ?-], ?>]), do: :-> + + def tag([[[], ?:], ?=]), do: :":=" + + def tag([[[], ?+], ?=]), do: :"+=" + + def tag([[[], ?-], ?=]), do: :"-=" + + def tag([[[], ?*], ?=]), do: :"*=" + + def tag([[[], ?/], ?=]), do: :"/=" + + def tag([[[], ?%], ?=]), do: :"%=" + + def tag([[[], ?!], ?>]), do: :"!>" + + def tag([[[], ?!], ?<]), do: :"!<" + + def tag([[[], ?@], ?>]), do: :"@>" + + def tag([[[], ?<], ?@]), do: :"<@" + + def tag([[[], ?|], ?/]), do: :"|/" + + def tag([[[], ?^], ?@]), do: :"^@" + + def tag([[[], ?~], ?*]), do: :"~*" + + def tag([[[], ?!], ?~]), do: :"!~" + + def tag([[[], ?#], ?#]), do: :"##" + + def tag([[[], ?&], ?<]), do: :"&<" + + def tag([[[], ?&], ?>]), do: :"&>" + + def tag([[[], ?<], ?^]), do: :"<^" + + def tag([[[], ?>], ?^]), do: :">^" + + def tag([[[], ??], ?#]), do: :"?#" + + def tag([[[], ??], ?-]), do: :"?-" + + def tag([[[], ??], ?|]), do: :"?|" + + def tag([[[], ?~], ?=]), do: :"~=" + + def tag([[[], ?@], ?@]), do: :"@@" + + def tag([[[], ?!], ?!]), do: :"!!" + + def tag([[[], ?#], ?>]), do: :"#>" + + def tag([[[], ??], ?&]), do: :"?&" + + def tag([[[], ?#], ?-]), do: :"#-" + + def tag([[[], ?@], ??]), do: :"@?" + + def tag([[[], ?:], ?:]), do: :"::" + + def tag([[[], ?<], ?>]), do: :<> + + def tag([[[], ?>], ?=]), do: :>= + + def tag([[[], ?<], ?=]), do: :<= + + def tag([[[], ?!], ?=]), do: :!= + + def tag([[], ?+]), do: :+ + + def tag([[], ?-]), do: :- + + def tag([[], ?!]), do: :! + + def tag([[], ?&]), do: :& + + def tag([[], ?^]), do: :^ + + def tag([[], ?|]), do: :| + + def tag([[], ?~]), do: :"~" + + def tag([[], ?%]), do: :% + + def tag([[], ?@]), do: :@ + + def tag([[], ?#]), do: :"#" + + def tag([[], ?*]), do: :* + + def tag([[], ?/]), do: :/ + + def tag([[], ?=]), do: := + + def tag([[], ?>]), do: :> + + def tag([[], ?<]), do: :< + + def tag(_), do: nil +end diff --git a/lib/lexer.ex b/lib/lexer.ex index 463cc08..f048060 100644 --- a/lib/lexer.ex +++ b/lib/lexer.ex @@ -3,2063 +3,259 @@ defmodule SQL.Lexer do @moduledoc false - @compile {:inline, lex: 9, lex: 4, meta: 3, merge: 3, type: 2, node: 5} - - defguard is_data_type(node) when elem(node, 0) in ~w[integer float ident quote double_quote backtick bracket parens .]a - defguard is_newline(b) when b in [10, 11, 12, 13, 133, 8232, 8233] - defguard is_space(b) when b in ~c" " - defguard is_whitespace(b) when b in [9, 13, 160, 160, 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 6158, 8203, 8204, 8205, 8288, 65279] - - def opening_delimiter(:parens), do: :"(" - def opening_delimiter(:bracket), do: :"[" - def opening_delimiter(:double_quote), do: :"\"" - def opening_delimiter(:quote), do: :"'" - def opening_delimiter(:backtick), do: :"`" - def opening_delimiter(type) when type in ~w[var code braces]a, do: :"{" - - def expected_delimiter(:parens), do: :")" - def expected_delimiter(:bracket), do: :"]" - def expected_delimiter(:double_quote), do: :"\"" - def expected_delimiter(:quote), do: :"'" - def expected_delimiter(:backtick), do: :"`" - def expected_delimiter(type) when type in ~w[var code braces]a, do: :"}" - - def lex(binary, file, params \\ 0, opts \\ [metadata: true]) do - case lex(binary, binary, [{:binding, []}, {:params, params}, {:file, file} | opts], 0, 0, nil, [], [], 0) do - {"", _binary, opts, line, column, nil = type, data, acc, _n} -> - {:ok, opts, line, column, type, data, acc} - - {"", binary, _opts, end_line, end_column, type, _data, [{_, [line: line, column: column, file: file], _}|_], _n} when type in ~w[parens bracket double_quote quote backtick var code]a -> - raise TokenMissingError, file: file, snippet: binary, end_line: end_line, end_column: end_column, line: line, column: column, opening_delimiter: opening_delimiter(type), expected_delimiter: expected_delimiter(type) - - {"", _binary, opts, line, column, type, data, acc, _n} -> - {:ok, opts, line, column, type, data, insert_node(node(ident(type, data), line, column, data, opts), acc)} + import SQL.Helpers + @compile {:inline, lex: 12, update_state: 17, node: 6, type: 2, type: 1} + require Unicode.Set + def lex(binary, file \\ "nofile", params \\ 0, binding \\ [], aliases \\ []) do + case lex(binary, file, params, binding, aliases, 0, 0, nil, [], nil, [], 0) do + {:error, error} -> raise TokenMissingError, [{:snippet, binary} | error] + {"", ^file, params, binding, aliases, _line, _column, nil, [], nil, acc, 0} -> {:ok, %{params: params, binding: binding, aliases: aliases}, acc} end end - def lex("" = rest, binary, opts, line, column, type, data, acc, n) do - {rest, binary, opts, line, column, type, data, acc, n} + def lex("", file, _params, _binding, _aliases, line, column, type, _data, _meta, _acc, _n) when type in ~w[backtick quote double_quote double_braces]a do + {:error, file: file, end_line: column, end_column: line, line: line, column: column, opening_delimiter: opening_delimiter(type), expected_delimiter: expected_delimiter(type)} + end + def lex(""=rest, file, params, binding, aliases, line, column, nil=type, data, meta, acc, n) do + {rest, file, params, binding, aliases, line, column, type, data, meta, acc, n} end - def lex(<>, binary, opts, line, column, type, data, acc, n) do - lex(rest, binary, opts, line, column+2, :comment, [], insert_node(type, line, column, data, opts, acc), n) + def lex(""=rest, file, params, binding, aliases, line, column, type, data, meta, acc, n) do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column, nil, [], nil) end - def lex(<>, binary, opts, line, column, _type, data, acc, n) do - lex(rest, binary, opts, line, column+2, :comments, data, acc, n) + def lex(<>, file, params, binding, aliases, line, column, type, data, meta, acc, n) when is_comment(b) do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column+2, type(b), [], nil) end - def lex(<>, binary, opts, line, column, :comments, data, acc, n) do - lex(rest, binary, opts, line, column+2, nil, [], insert_node(node(:comments, line, column, data, opts), acc), n) + def lex(<>, file, params, binding, aliases, line, column, :comment=type, data, meta, acc, n) when is_newline(b) do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column+1, nil, [], nil) end - def lex(<>, binary, opts, line, column, :comments, data, acc, n) do - lex(rest, binary, opts, line, column+1, :comments, [data | [b]], acc, n) + def lex(<<"*/", rest::binary>>, file, params, binding, aliases, line, column, :comments=type, data, meta, acc, n) do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column+2, nil, [], nil) end - def lex(<>, binary, opts, line, column, nil, data, acc, n) do - lex(rest, binary, opts, line, column+2, :var, data, acc, n) + def lex(<>, file, params, binding, aliases, line, column, type, data, meta, acc, n) when type in ~w[comment comments]a do + lex(rest, file, params, binding, aliases, line, column+1, type, [data|[b]], meta, acc, n) end - def lex(<>, binary, [_, _, _, {:format, true}] = opts, line, column, _type, data, acc, 0 = n), do: lex(rest, binary, opts, line, column+2, nil, [], insert_node(node(:binding, line, column, data, opts), acc), n) - def lex(<>, binary, opts, line, column, type, data, acc, 0 = n) when type in ~w[code var]a do - opts = opts - |> Keyword.update!(:binding, &(&1 ++ [{type, IO.iodata_to_binary(data)}])) - |> Keyword.update!(:params, &(&1+1)) - lex(rest, binary, opts, line, column+2, nil, [], insert_node(node(:binding, line, column, Keyword.get(opts, :params), opts), acc), n) + def lex(<<"{{", rest::binary>>, file, params, binding, aliases, line, column, type, data, meta, acc, n) when type != :double_braces do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column+2, :double_braces, [], nil) end - def lex(<>, binary, opts, line, column, :code = type, data, acc, n) do - lex(rest, binary, opts, line, column+1, type, [data | [?}]], acc, n-1) + def lex(<<"}}", rest::binary>>, file, params, binding, aliases, line, column, :double_braces=type, data, meta, acc, 0=n) do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column+2, nil, [], nil) end - def lex(<>, binary, opts, line, column, type, data, acc, n) when type in ~w[var code]a and b in [?{] do - lex(rest, binary, opts, line, column+1, :code, [data | [b]], acc, n+1) + def lex(<>, file, params, binding, aliases, line, column, :double_braces=type, data, meta, acc, n) do + n = case b do + ?{ -> n+1 + ?} -> n-1 + _ -> n + end + lex(rest, file, params, binding, aliases, line, column+1, type, [data|[b]], meta, acc, n) + end + def lex(<>, file, params, binding, aliases, line, column, type, data, meta, acc, n) when is_literal(c) do + lex(<>, file, params, binding, aliases, line, column, type, [data | [?&]], meta, acc, n) + end + def lex(<>, file, params, binding, aliases, line, column, type, data, meta, acc, n) when is_literal(b) do + column = column+1 + t = type(b) + cond do + type == t -> + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column, nil, [], nil) + type == :ident -> + lex(rest, file, params, binding, aliases, line, column, t, [], data, acc, n) + true -> + lex(rest, file, params, binding, aliases, line, column, t, data, meta, acc, n) + end end - def lex(<>, binary, opts, line, column, :var = type, data, acc, n) when b in ?0..?9 and data != [] do - lex(rest, binary, opts, line, column+1, type, [data | [b]], acc, n) + def lex(<>, file, params, binding, aliases, line, column, type, data, meta, acc, n) when type in ~w[quote double_quote]a do + lex(rest, file, params, binding, aliases, line, column, type, [data|[b]], meta, acc, n) end - def lex(<>, binary, opts, line, column, :var = type, data, acc, n) when b in ?a..?z or b in ?A..?Z or (b == ?_ and data != []) do - lex(rest, binary, opts, line, column+1, type, [data | [b]], acc, n) + def lex(<>, file, params, binding, aliases, line, column, nil=_type, data, meta, acc, n) when is_delimiter(b) do + column = column+1 + update_state(rest, file, params, binding, aliases, line, column, type(b), data, meta, acc, n, line, column, nil, [], nil) end - def lex(<>, binary, opts, line, column, type, data, acc, n) when type in ~w[var code]a do - lex(rest, binary, opts, line, column+1, :code, [data | [b]], acc, n) + def lex(<>=rest, file, params, binding, aliases, line, column, type, data, meta, acc, n) when is_delimiter(b) do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column, nil, [], nil) end - def lex(<>, binary, opts, line, column, type, data, acc, n) when b in [?(, ?[] do - acc = case ident(type, data) do - nil -> acc - :ident -> insert_node(node(type, line, column, data, opts), acc) - tag -> insert_node(node(tag, line, column, [], opts), acc) - end - case lex(rest, binary, opts, line, column+1, nil, [], [], n) do - {rest, opts, line, column, value} -> - lex(rest, binary, opts, line, column, nil, [], insert_node(node(ident(type, [b]), line, column, value, opts), acc), n) - {rest, binary, o, l, c, t, d, a, _n} -> - value = if t, do: insert_node(node(t, l, c, d, o), a), else: a - lex(rest, binary, opts, l, c, (if b == ?(, do: :parens, else: :bracket), [], insert_node(node(ident(type, [b]), line, column, value, opts), acc), n) + def lex(<>, file, params, binding, aliases, line, column, type, data, meta, acc, n) when is_nested_start(b) do + tag = type(b) + column = column+1 + case lex(rest, file, params, binding, aliases, line, column, nil, [], nil, [], n) do + {rest, f, p, b, a, l, c, value} when type == nil -> update_state(rest, f, p, b, a, l, c, tag, value, meta, acc, n, l, c, nil, [], nil) + + {rest, f, p, b, a, l, c, value} when type == :ident -> + case node(type, line, column, data, meta, file) do + {:ident, _, _} = node -> + update_state(rest, f, p, b, a, line, column, :fun, [node, node(tag, l, c, value, nil, f)], nil, acc, n, l, c, nil, [], nil) + + {t, m, []=a2} -> + lex(rest, f, params, binding, aliases, l, c, nil, [], nil, [{t, m, [node(tag, l, c, value, nil, f)|a2]}|acc], n) + end + + {rest, f, p, b, a, l, c, value} -> update_state(rest, f, p, b, a, l, c, tag, value, meta, acc, n, l, c, nil, [], nil) + + {_, _, _, _, _, end_line, end_column, _, _, _, _, _} -> {:error, file: file, end_line: end_line, end_column: end_column, line: line, column: column, opening_delimiter: opening_delimiter(tag), expected_delimiter: expected_delimiter(tag)} end end - def lex(<>, _binary, opts, line, column, type, data, acc, _n) when b in [?), ?]] do - acc = if type, do: insert_node(node(type, line, column, data, opts), acc), else: acc - {rest, opts, line, column+1, acc} + def lex(<>, file, params, binding, aliases, line, column, nil=_type, _data, _meta, acc, _n) when is_nested_end(b) do + {rest, file, params, binding, aliases, line, column, acc} end - def lex(<>, binary, opts, line, column, :double_quote = type, data, acc, n) do - lex(rest, binary, opts, line, column+1, nil, [], insert_node(node(type, line, column, data, opts), acc), n) + def lex(<>=rest, file, params, binding, aliases, line, column, type, data, meta, acc, n) when is_nested_end(b) do + column = column+1 + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column, nil, [], nil) end - def lex(<>, binary, opts, line, column, :backtick = type, data, acc, n) do - lex(rest, binary, opts, line, column+1, nil, [], insert_node(node(type, line, column, data, opts), acc), n) + def lex(<>, file, params, binding, aliases, line, column, :numeric=type, data, {s, w, f}, acc, n) when is_dot(b) and is_e(e) and is_sign(c) do + lex(rest, file, params, binding, aliases, line, column+3, type, [[[data|[b]]|[e]]|[c]], {s, w, f+1}, acc, n) end - def lex(<>, binary, opts, line, column, :quote = type, data, acc, n) do - lex(rest, binary, opts, line, column+1, nil, [], insert_node(node(type, line, column, data, opts), acc), n) + def lex(<>, file, params, binding, aliases, line, column, :numeric=type, data, {s, w, f}, acc, n) when is_dot(b) do + lex(rest, file, params, binding, aliases, line, column+1, type, [data|[b]], {s, w, f+1}, acc, n) end - def lex(<>, binary, opts, line, column, type, data, acc, n) when type in ~w[double_quote quote backtick]a do - lex(rest, binary, opts, line, column+1, type, [data | [b]], acc, n) + def lex(<>, file, params, binding, aliases, line, column, :numeric=type, data, meta, acc, n) when is_e(b) and (is_sign(e) or is_digit(e)) do + lex(rest, file, params, binding, aliases, line, column+2, type, [[data|[b]]|[e]], meta, acc, n) end - def lex(<>, binary, opts, line, column, type, data, acc, n) when is_newline(b) do - if data == [] do - lex(rest, binary, opts, line+1, column, type, data, acc, n) - else - tag = ident(type, data) - lex(rest, binary, opts, line+1, column, nil, [], insert_node(node(tag, line, column, data, opts), acc), n) - end + def lex(<>, file, params, binding, aliases, line, column, nil, []=data, nil, acc, n) when is_dot(b) and is_digit(e)do + lex(rest, file, params, binding, aliases, line, column+2, :numeric, [[data|[b]]|[e]], {0, 0, 1}, acc, n) end - def lex(<>, binary, opts, line, column, type, data, acc, n) when is_space(b) do - if data == [] do - lex(rest, binary, opts, line, column+1, type, data, acc, n) - else - tag = ident(type, data) - lex(rest, binary, opts, line, column+1, nil, [], insert_node(node(tag, line, column, data, opts), acc), n) - end + def lex(<>, file, params, binding, aliases, line, column, nil, []=data, nil, acc, n) when is_sign(b) and is_dot(e) do + lex(rest, file, params, binding, aliases, line, column+2, :numeric, [[data|[b]]|[e]], {1, 0, 0}, acc, n) end - def lex(<>, binary, opts, line, column, type, data, acc, n) when is_whitespace(b) do - if data == [] do - lex(rest, binary, opts, line, column+1, type, data, acc, n) - else - tag = ident(type, data) - lex(rest, binary, opts, line, column+1, nil, [], insert_node(node(tag, line, column, data, opts), acc), n) - end + def lex(<>, file, params, binding, aliases, line, column, :numeric=type, data, {s, w, f}, acc, n) when is_dot(b) and is_digit(e) do + lex(rest, file, params, binding, aliases, line, column+2, type, [[data|[b]]|[e]], {s, w, f+1}, acc, n) end - def lex(<>, binary, opts, line, column, type, data, acc, n) when b in [?,, ?;] do - acc = if type, do: insert_node(node(ident(type, data), line, column, data, opts), acc), else: acc - lex(rest, binary, opts, line, column, nil, [], insert_node(node(type(b), line, column+1, [], opts), acc), n) + def lex(<>, file, params, binding, aliases, line, column, nil, []=data, nil, [{t, m, _}|_]=acc, n) when is_sign(b) and is_digit(c) and t not in ~w[ident numeric dot] and elem(hd(m), 0) == :keyword do + lex(rest, file, params, binding, aliases, line, column+2, :numeric, [[data|[b]]|[c]], {1, 1, 0}, acc, n) end - def lex(<>, binary, opts, line, column, type, data, acc, n) when b in ~w[^-= |*= <=> <-> >>= &<| <<| |>> |&> -|-] do - node = node(String.to_atom(b), line, column+3, [], opts) - if data == [] do - lex(rest, binary, opts, line, column+3, type, data, insert_node(node, acc), n) - else - lex(rest, binary, opts, line, column+3, nil, [], insert_node(node, insert_node(node(ident(type, data), line, column, data, opts), acc)), n) - end + def lex(<>, file, params, binding, aliases, line, column, type, data, meta, acc, n) when type in [nil, :numeric] and is_digit(b) do + lex(rest, file, params, binding, aliases, line, column+1, :numeric, [data|[b]], update_meta(meta, :numeric), acc, n) end - def lex(<>, binary, opts, line, column, type, data, acc, n) when b in ~w[:: <> != !< !> <= >= += -= *= /= %= &= || << &< && &> >> ~= @> <@ @@] do - node = node(String.to_atom(b), line, column+2, [], opts) - if data == [] do - lex(rest, binary, opts, line, column+2, type, data, insert_node(node, acc), n) - else - lex(rest, binary, opts, line, column+2, nil, [], insert_node(node, insert_node(node(ident(type, data), line, column, data, opts), acc)), n) - end + def lex(<>, file, params, binding, aliases, line, column, :special=type, data, meta, acc, n) when is_digit(b) do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column+1, :numeric, [[]|[b]], {0, 1, 0}) end - def lex(<>, binary, opts, line, column, type, data, acc, n) when type in ~w[integer float]a and b in [?E, ?e] and (e in [?-, ?+] or e in ?0..?9) do - type = :float - lex(rest, binary, opts, line, column+2, type, merge(merge(data, b, type), e, type), acc, n) + def lex(<>, file, params, binding, aliases, line, column, nil=_type, data, meta, acc, n) when is_dot(b) do + column = column+1 + update_state(rest, file, params, binding, aliases, line, column, :dot, data, meta, acc, n, line, column, nil, [], nil) end - def lex(<>, binary, opts, line, column, nil, [], acc, n) when b == ?. and e in ?0..?9 do - lex(rest, binary, opts, line, column+2, :float, [b, e], acc, n) + def lex(<>=rest, file, params, binding, aliases, line, column, type, data, meta, acc, n) when is_dot(b) do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column, nil, [], nil) end - def lex(<>, binary, opts, line, column, nil, [], acc, n) when b in [?-, ?+] and e == ?. do - lex(rest, binary, opts, line, column+2, :float, [b,e], acc, n) + def lex(<>, file, params, binding, aliases, line, column, type, data, meta, acc, n) when type != :ident and Unicode.Set.match?(b, "[[:Lu:], [:Ll:], [:Lt:], [:Lm:], [:Lo:], [:Nl:]]") do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column+1, :ident, [[]|[b]], meta) end - def lex(<>, binary, opts, line, column, :integer, data, acc, n) when b == ?. do - type = :float - lex(rest, binary, opts, line, column+1, type, merge(data, b, type), acc, n) + def lex(<>, file, params, binding, aliases, line, column, :ident=type, data, meta, acc, n) when Unicode.Set.match?(b, "[[:Mn:], [:Mc:], [:Nd:], [:Pc:], [:Cf:]]") do + lex(rest, file, params, binding, aliases, line, column+1, type, [data|[b]], meta, acc, n) end - def lex(<>, binary, opts, line, column, type, data, acc, n) when b == ?. do - node = node(List.to_atom([b]), line, column+1, [], opts) - if data == [] do - lex(rest, binary, opts, line, column+1, type, data, insert_node(node, acc), n) - else - lex(rest, binary, opts, line, column+1, nil, [], insert_node(node, insert_node(node(ident(type, data), line, column, data, opts), acc)), n) - end + def lex(<>, file, params, binding, aliases, line, column, type, data, meta, acc, n) when is_special_character(b) and type in ~w[nil special]a and not is_space(b) do + lex(rest, file, params, binding, aliases, line, column+1, :special, [data|[b]], meta, acc, n) end - def lex(<>, binary, opts, line, column, _type, [] = data, [node | _] = acc, n) when b in [?+, ?-, ?^, ?*, ?/, ?%, ?&, ?<, ?>, ?=] and is_data_type(node) do - node = node(List.to_atom([b]), line, column+1, data, opts) - lex(rest, binary, opts, line, column+1, nil, data, insert_node(node, acc), n) + def lex(<>, file, params, binding, aliases, line, column, type, data, meta, acc, n) when is_special_character(b) and not is_space(b) do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column+1, :special, [[]|[b]], nil) end - def lex(<>, binary, opts, line, column, nil, [], acc, n) when b in [?+, ?-] and c in ?0..?9 do - lex(rest, binary, opts, line, column+2, :integer, [b, c], acc, n) + def lex(<>, file, params, binding, aliases, line, column, type, []=data, meta, acc, n) when is_newline(b) do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line+1, column, type, data, meta) end - def lex(<>, binary, opts, line, column, nil = type, data, acc, n) when b in [?+, ?-, ?^, ?*, ?/, ?%, ?&, ?<, ?>, ?=] do - node = node(List.to_atom([b]), line, column+1, data, opts) - lex(rest, binary, opts, line, column+1, type, data, insert_node(node, acc), n) + def lex(<>, file, params, binding, aliases, line, column, type, []=data, meta, acc, n) when is_whitespace(b) or is_space(b) do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column+1, type, data, meta) end - def lex(<>, binary, opts, line, column, type, data, acc, n) when b in [?+, ?-, ?^, ?*, ?/, ?%, ?&, ?<, ?>, ?=] and type in ~w[integer float ident quote double_quote backtick bracket parens nil]a do - node = node(List.to_atom([b]), line, column+1, [], opts) - lex(rest, binary, opts, line, column+1, nil, [], insert_node(node, insert_node(node(ident(type, data), line, column, data, opts), acc)), n) + def lex(<>, file, params, binding, aliases, line, column, type, data, meta, acc, n) when is_newline(b) do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line+1, column, nil, [], nil) end - def lex(<>, binary, opts, line, column, type, data, acc, n) do - type = type(b, type) - lex(rest, binary, opts, line, column+1, type, merge(data, b, type), acc, n) + def lex(<>, file, params, binding, aliases, line, column, type, data, meta, acc, n) when is_whitespace(b) or is_space(b) do + update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, line, column+1, nil, [], nil) end - - def insert_node(nil, _line, _column, _data, _opts, acc) do - acc + def lex(<>, file, params, binding, aliases, line, column, type, data, meta, acc, n) do + lex(rest, file, params, binding, aliases, line, column+1, type(b, type), [data|[b]], meta, acc, n) end - def insert_node(type, line, column, data, opts, acc) do - insert_node(node(type, line, column, data, opts), acc) + + def opening_delimiter(:paren), do: :"(" + def opening_delimiter(:bracket), do: :"[" + def opening_delimiter(:double_quote), do: :"\"" + def opening_delimiter(:quote), do: :"'" + def opening_delimiter(:backtick), do: :"`" + def opening_delimiter(type) when type in ~w[brace double_braces]a, do: :"{" + + def expected_delimiter(:paren), do: :")" + def expected_delimiter(:bracket), do: :"]" + def expected_delimiter(type) when type in ~w[backtick quote double_quote]a, do: opening_delimiter(type) + def expected_delimiter(type) when type in ~w[brace double_braces]a, do: :"}" + + + def update_state(rest, file, params, binding, aliases, _line, _column, nil=_type, _data, _meta, acc, n, l, c, t, d, m) do + lex(rest, file, params, binding, aliases, l, c, t, d, m, acc, n) end - def insert_node(right, [{:. = tag, m, a}, {:., _, [_, _]} = left | acc]) do - [{tag, m, [left, right | a]} | acc] + def update_state(rest, file, params, binding, aliases, line, column, :ident=type, data, meta, [{:as=tt, mm, []=aa}, {:ident, _, a}=right|acc]=ac, n, l, c, t, d, m) do + case node(type, line, column, data, meta, file) do + {:ident, _, as} = node -> lex(rest, file, params, binding, [{as, a}|aliases], l, c, t, d, m, [{tt, mm, [right, node|aa]}|acc], n) + node -> lex(rest, file, params, binding, aliases, l, c, t, d, m, [node|ac], n) + end end - def insert_node(right, [{:. = tag, meta, [left]} | acc]) do - [{tag, meta, [left, right]} | acc] + def update_state(rest, file, params, binding, aliases, line, column, :ident=type, data, meta, [{:outer, _, []}=p, {tag, _, []}=p1, {:natural, _, []}=p2|acc], n, l, c, t, d, m) when tag in ~w[left right full]a do + {tt, mm, aa} = node(type, line, column, data, meta, file) + lex(rest, file, params, binding, aliases, l, c, t, d, m, [{tt, mm, [p2, p1, p|aa]} | acc], n) end - def insert_node({:., _, _} = node, [right, {:. = tag, m, []}, left | acc]) do - [node, {tag, m, [left, right]} | acc] + def update_state(rest, file, params, binding, aliases, line, column, :ident=type, data, meta, [{:outer, _, []}=p, {tag, _, []}=p1|acc], n, l, c, t, d, m) when tag in ~w[left right full]a do + {tt, mm, aa} = node(type, line, column, data, meta, file) + lex(rest, file, params, binding, aliases, l, c, t, d, m, [{tt, mm, [p1, p|aa]} | acc], n) end - def insert_node({:. = t, m, a}, [left | acc]) do - [{t, m, [left|a]} | acc] + def update_state(rest, file, params, binding, aliases, line, column, :ident=type, data, meta, [{:inner, _, []}=p, {:natural, _, []}=p1|acc], n, l, c, t, d, m) do + {tt, mm, aa} = node(type, line, column, data, meta, file) + lex(rest, file, params, binding, aliases, l, c, t, d, m, [{tt, mm, [p1, p|aa]} | acc], n) end - def insert_node({:join = t, m, a} = node, acc) do - case join(acc) do - {qualified, rest} -> [{t, m, [qualified|a]} | rest] - rest -> [node | rest] + def update_state(rest, file, params, binding, aliases, line, column, :ident=type, data, meta, [{tag, _, []}=p|acc], n, l, c, t, d, m) when tag in ~w[inner left right full natural cross]a do + case node(type, line, column, data, meta, file) do + {:join=tt, mm, aa} -> lex(rest, file, params, binding, aliases, l, c, t, d, m, [{tt, mm, [p|aa]}|acc], n) + node -> lex(rest, file, params, binding, aliases, l, c, t, d, m, [node, p|acc], n) end end - def insert_node(node, acc) do - [node | acc] + def update_state(rest, file, params, binding, aliases, line, column, type, data, meta, [{:dot=t2, m2, []=a}, {tag, _, _}=right|acc], n, l, c, t, d, m) when (type in ~w[ident double_quote bracket dot]a or data==[[], ?*]) and tag in ~w[ident double_quote bracket dot]a do + lex(rest, file, params, binding, aliases, l, c, t, d, m, [{t2, m2, [right, node(type, line, column, data, meta, file)|a]}|acc], n) end - - def join([{:outer, _} = r, {tag, _} = l, {:natural, _} = n | rest]) when tag in ~w[left right full]a do - {[n, l, r], rest} + def update_state(rest, file, params, [format: true]=binding, aliases, line, column, :double_braces=type, data, meta, acc, n, l, c, t, d, m) do + lex(rest, file, params, binding, aliases, l, c, t, d, m, [node(type, line, column, data, meta, file)|acc], n) end - def join([{:outer, _} = r, {tag, _} = l | rest]) when tag in ~w[left right full]a do - {[l, r], rest} + def update_state(rest, file, params, binding, aliases, line, column, :double_braces=type, data, meta, acc, n, l, c, t, d, m) do + params=params+1 + lex(rest, file, params, :lists.flatten(binding, [Code.string_to_quoted!(IO.iodata_to_binary(data), file: file, line: line, column: column, columns: true, token_metadata: true, existing_atoms_only: true)]), aliases, l, c, t, d, m, [node(type, line, column, [params], meta, file)|acc], n) end - def join([{:inner, _} = r, {:natural, _} = l| rest]) do - {[l, r], rest} + def update_state(rest, file, params, binding, aliases, line, column, type, data, meta, acc, n, l, c, t, d, m) do + lex(rest, file, params, binding, aliases, l, c, t, d, m, [node(type, line, column, data, meta, file)|acc], n) end - def join([{tag, _} = l | rest]) when tag in ~w[inner left right full natural cross]a do - {[l], rest} + + def update_meta(nil, :numeric), do: {0, 1, 0} + def update_meta({s, w, 0 = f}, :numeric), do: {s, w+1, f} + def update_meta({s, w, f}, :numeric), do: {s, w, f+1} + + + def node(:double_braces=_tag, line, column, data, _meta, file), do: {:binding, [type: :literal, line: line, column: column, file: file], data} + def node(:numeric=tag, line, column, data, {s, w, f}, file), do: {tag, [sign: s, whole: w, fractional: f, type: :literal, line: line, column: column, file: file], data} + def node(:special=type, line, column, data, meta, file) do + if tag = tag(data) do + node(tag, line, column, [], meta, file) + else + node(type, line, column, data, meta, file) + end end - def join(acc) do - acc + def node(:quote = tag, line, column, data, prefix, file) when is_list(prefix), do: {tag, [prefix: prefix, size: :erlang.iolist_size(data), type: :literal, line: line, column: column, file: file], data} + def node(tag, line, column, data, _meta, file) when tag in ~w[bracket paren brace]a, do: {tag, [type: :expression, line: line, column: column, file: file], data} + def node(tag, line, column, data, _meta, file) when tag in ~w[quote double_quote backtick]a, do: {tag, [size: :erlang.iolist_size(data), type: :literal, line: line, column: column, file: file], data} + def node(tag, line, column, []=data, _meta, file), do: {tag, [line: line, column: column, file: file], data} + def node(tag, line, column, [{_, _, _} | _]=data, _meta, file), do: {tag, [type: :expression, line: line, column: column, file: file], data} + def node(tag, line, column, data, nil, file) do + case tag(data) do + {:reserved = k, tag} -> {tag, [keyword: k, line: line, column: column, file: file], []} + {k, t} -> {tag, [keyword: k, tag: t, line: line, column: column, file: file], data} + _ -> {tag, [size: :erlang.iolist_size(data), type: :literal, line: line, column: column, file: file], data} + end end + def node(tag, line, column, data, _meta, file), do: {tag, [size: :erlang.iolist_size(data), type: :literal, line: line, column: column, file: file], data} - def merge([] = data, _b, type) when type in ~w[double_quote quote backtick]a, do: data - def merge(data, b, _type), do: [data | [b]] - - def type(?;), do: :colon - def type(?,), do: :comma def type(?"), do: :double_quote def type(?'), do: :quote def type(?`), do: :backtick - def type(?(), do: :left_paren - def type(?)), do: :right_paren - def type(?[), do: :left_bracket - def type(?]), do: :right_bracket - - def type(%param{}), do: param - def type(param) when is_float(param), do: :float - def type(param) when is_integer(param), do: :integer - def type(param) when is_map(param), do: :map - def type(param) when is_list(param), do: {:list, Enum.uniq(Enum.map(param, &type/1))} - def type(param) when is_binary(param), do: :string - def type(_param), do: nil - - def type(_, type) when type in ~w[double_quote quote backtick comment comments]a, do: type - def type(?", _type), do: :double_quote - def type(?', _type), do: :quote - def type(?`, _type), do: :backtick - def type(b, type) when b in ?0..?9 and type in ~w[nil integer float]a, do: type || :integer - def type(?., :integer), do: :float + def type(?,), do: :comma + def type(?;), do: :colon + def type(?*), do: :special + def type("--"), do: :comment + def type("\\*"), do: :comments + def type(b) when b in [?(, ?)], do: :paren + def type(b) when b in [?{, ?}], do: :brace + def type(b) when b in [?[, ?]], do: :bracket + def type(_, type) when type in ~w[comment comments double_quote quote backtick]a, do: type + def type(b, type) when is_digit(b) and type in ~w[nil numeric]a or is_dot(b) and type == :numeric, do: :numeric + def type(?*, _type), do: :special def type(_b, _type), do: :ident - - def meta(_line, _column, [_,_,_,{_,false}|_]), do: [] - def meta(line, column, [_, _, {_, file} |_]), do: [line: line, column: column, file: file] - - def node(:binding = tag, line, column, [idx], [{:binding, false}, {:params, params}|_] = opts) do - {tag, meta(line, column, opts), Enum.at(params, idx)} - end - def node(:binding = tag, line, column, data, opts) when is_integer(data), do: {tag, meta(line, column, opts), [data]} - def node(tag, line, column, data, opts) when tag in ~w[ident float integer double_quote quote backtick binding parens bracket . comment comments]a do - data = case data do - [] -> data - [{_, _, _} | _] -> data - _ -> [IO.iodata_to_binary(data)] - end - {tag, meta(line, column, opts), data} - end - def node(tag, line, column, _data, opts) when tag in ~w[asterisk inner left right full natural cross outer]a do - {tag, meta(line, column, opts)} - end - def node(tag, line, column, _data, opts) do - {tag, meta(line, column, opts), []} - end - - def ident(_type, [?*]), do: :asterisk - def ident(_type, [?(]), do: :parens - def ident(_type, [?[]), do: :bracket - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"aA" and b2 in ~c"bB" and b3 in ~c"sS", do: :abs - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"aA" and b2 in ~c"bB" and b3 in ~c"sS" and b4 in ~c"eE" and b5 in ~c"nN" and b6 in ~c"tT", do: :absent - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"aA" and b2 in ~c"cC" and b3 in ~c"oO" and b4 in ~c"sS", do: :acos - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"aA" and b2 in ~c"lL" and b3 in ~c"lL", do: :all - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"aA" and b2 in ~c"lL" and b3 in ~c"lL" and b4 in ~c"oO" and b5 in ~c"cC" and b6 in ~c"aA" and - b7 in ~c"tT" and b8 in ~c"eE", do: :allocate - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"aA" and b2 in ~c"lL" and b3 in ~c"tT" and b4 in ~c"eE" and b5 in ~c"rR", do: :alter - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"aA" and b2 in ~c"nN" and b3 in ~c"dD", do: :and - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"aA" and b2 in ~c"nN" and b3 in ~c"yY", do: :any - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"aA" and b2 in ~c"nN" and b3 in ~c"yY" and b4 in ~c"_" and b5 in ~c"vV" and b6 in ~c"aA" and - b7 in ~c"lL" and b8 in ~c"uU" and b9 in ~c"eE", do: :any_value - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"aA" and b2 in ~c"rR" and b3 in ~c"eE", do: :are - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"aA" and b2 in ~c"rR" and b3 in ~c"rR" and b4 in ~c"aA" and b5 in ~c"yY", do: :array - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"aA" and b2 in ~c"rR" and b3 in ~c"rR" and b4 in ~c"aA" and b5 in ~c"yY" and b6 in ~c"_" and - b7 in ~c"aA" and b8 in ~c"gG" and b9 in ~c"gG", do: :array_agg - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21]) when b1 in ~c"aA" and b2 in ~c"rR" and b3 in ~c"rR" and b4 in ~c"aA" and b5 in ~c"yY" and b6 in ~c"_" and - b7 in ~c"mM" and b8 in ~c"aA" and b9 in ~c"xX" and b10 in ~c"_" and b11 in ~c"cC" and - b12 in ~c"aA" and b13 in ~c"rR" and b14 in ~c"dD" and b15 in ~c"iI" and b16 in ~c"nN" and - b17 in ~c"aA" and b18 in ~c"lL" and b19 in ~c"iI" and b20 in ~c"tT" and b21 in ~c"yY", do: :array_max_cardinality - - def ident(:ident, [[[], b1], b2]) when b1 in ~c"aA" and b2 in ~c"sS", do: :as - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"aA" and b2 in ~c"sS" and b3 in ~c"eE" and b4 in ~c"nN" and b5 in ~c"sS" and b6 in ~c"iI" and - b7 in ~c"tT" and b8 in ~c"iI" and b9 in ~c"vV" and b10 in ~c"eE", do: :asensitive - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"aA" and b2 in ~c"sS" and b3 in ~c"iI" and b4 in ~c"nN", do: :asin - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"aA" and b2 in ~c"sS" and b3 in ~c"yY" and b4 in ~c"mM" and b5 in ~c"mM" and b6 in ~c"eE" and - b7 in ~c"tT" and b8 in ~c"rR" and b9 in ~c"iI" and b10 in ~c"cC", do: :asymmetric - - def ident(:ident, [[[], b1], b2]) when b1 in ~c"aA" and b2 in ~c"tT", do: :at - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"aA" and b2 in ~c"tT" and b3 in ~c"aA" and b4 in ~c"nN", do: :atan - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"aA" and b2 in ~c"tT" and b3 in ~c"oO" and b4 in ~c"mM" and b5 in ~c"iI" and b6 in ~c"cC", do: :atomic - - def ident(:ident, [[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when b1 in ~c"aA" and b2 in ~c"uU" and b3 in ~c"tT" and b4 in ~c"hH" and b5 in ~c"oO" and b6 in ~c"rR" and - b7 in ~c"iI" and b8 in ~c"zZ" and b9 in ~c"aA" and b10 in ~c"tT" and b11 in ~c"iI" and - b12 in ~c"oO" and b13 in ~c"nN", do: :authorization - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"aA" and b2 in ~c"vV" and b3 in ~c"gG", do: :avg - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"bB" and b2 in ~c"eE" and b3 in ~c"gG" and b4 in ~c"iI" and b5 in ~c"nN", do: :begin - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"bB" and b2 in ~c"eE" and b3 in ~c"gG" and b4 in ~c"iI" and b5 in ~c"nN" and b6 in ~c"_" and - b7 in ~c"fF" and b8 in ~c"rR" and b9 in ~c"aA" and b10 in ~c"mM" and b11 in ~c"eE", do: :begin_frame - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"bB" and b2 in ~c"eE" and b3 in ~c"gG" and b4 in ~c"iI" and b5 in ~c"nN" and b6 in ~c"_" and - b7 in ~c"pP" and b8 in ~c"aA" and b9 in ~c"rR" and b10 in ~c"tT" and b11 in ~c"iI" and - b12 in ~c"tT" and b13 in ~c"iI" and b14 in ~c"oO" and b15 in ~c"nN", do: :begin_partition - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"bB" and b2 in ~c"eE" and b3 in ~c"tT" and b4 in ~c"wW" and b5 in ~c"eE" and b6 in ~c"eE" and - b7 in ~c"nN", do: :between - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"bB" and b2 in ~c"iI" and b3 in ~c"gG" and b4 in ~c"iI" and b5 in ~c"nN" and b6 in ~c"tT", do: :bigint - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"bB" and b2 in ~c"iI" and b3 in ~c"nN" and b4 in ~c"aA" and b5 in ~c"rR" and b6 in ~c"yY", do: :binary - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"bB" and b2 in ~c"lL" and b3 in ~c"oO" and b4 in ~c"bB", do: :blob - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"bB" and b2 in ~c"oO" and b3 in ~c"oO" and b4 in ~c"lL" and b5 in ~c"eE" and b6 in ~c"aA" and - b7 in ~c"nN", do: :boolean - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"bB" and b2 in ~c"oO" and b3 in ~c"tT" and b4 in ~c"hH", do: :both - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"bB" and b2 in ~c"tT" and b3 in ~c"rR" and b4 in ~c"iI" and b5 in ~c"mM", do: :btrim - - def ident(:ident, [[[], b1], b2]) when b1 in ~c"bB" and b2 in ~c"yY", do: :by - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"cC" and b2 in ~c"aA" and b3 in ~c"lL" and b4 in ~c"lL", do: :call - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"cC" and b2 in ~c"aA" and b3 in ~c"lL" and b4 in ~c"lL" and b5 in ~c"eE" and b6 in ~c"dD", do: :called - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"cC" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"dD" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"aA" and b8 in ~c"lL" and b9 in ~c"iI" and b10 in ~c"tT" and b11 in ~c"yY", do: :cardinality - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"cC" and b2 in ~c"aA" and b3 in ~c"sS" and b4 in ~c"cC" and b5 in ~c"aA" and b6 in ~c"dD" and - b7 in ~c"eE" and b8 in ~c"dD", do: :cascaded - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"cC" and b2 in ~c"aA" and b3 in ~c"sS" and b4 in ~c"eE", do: :case - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"cC" and b2 in ~c"aA" and b3 in ~c"sS" and b4 in ~c"tT", do: :cast - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"cC" and b2 in ~c"eE" and b3 in ~c"iI" and b4 in ~c"lL", do: :ceil - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"cC" and b2 in ~c"eE" and b3 in ~c"iI" and b4 in ~c"lL" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"gG", do: :ceiling - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"cC" and b2 in ~c"hH" and b3 in ~c"aA" and b4 in ~c"rR", do: :char - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"cC" and b2 in ~c"hH" and b3 in ~c"aA" and b4 in ~c"rR" and b5 in ~c"_" and b6 in ~c"lL" and - b7 in ~c"eE" and b8 in ~c"nN" and b9 in ~c"gG" and b10 in ~c"tT" and b11 in ~c"hH", do: :char_length - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"cC" and b2 in ~c"hH" and b3 in ~c"aA" and b4 in ~c"rR" and b5 in ~c"aA" and b6 in ~c"cC" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"rR", do: :character - - def ident(:ident, [[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16]) when b1 in ~c"cC" and b2 in ~c"hH" and b3 in ~c"aA" and b4 in ~c"rR" and b5 in ~c"aA" and b6 in ~c"cC" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"rR" and b10 in ~c"_" and b11 in ~c"lL" and - b12 in ~c"eE" and b13 in ~c"nN" and b14 in ~c"gG" and b15 in ~c"tT" and b16 in ~c"hH", do: :character_length - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"cC" and b2 in ~c"hH" and b3 in ~c"eE" and b4 in ~c"cC" and b5 in ~c"kK", do: :check - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"cC" and b2 in ~c"lL" and b3 in ~c"aA" and b4 in ~c"sS" and b5 in ~c"sS" and b6 in ~c"iI" and - b7 in ~c"fF" and b8 in ~c"iI" and b9 in ~c"eE" and b10 in ~c"rR", do: :classifier - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"cC" and b2 in ~c"lL" and b3 in ~c"oO" and b4 in ~c"bB", do: :clob - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"cC" and b2 in ~c"lL" and b3 in ~c"oO" and b4 in ~c"sS" and b5 in ~c"eE", do: :close - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"aA" and b4 in ~c"lL" and b5 in ~c"eE" and b6 in ~c"sS" and - b7 in ~c"cC" and b8 in ~c"eE", do: :coalesce - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"lL" and b4 in ~c"lL" and b5 in ~c"aA" and b6 in ~c"tT" and - b7 in ~c"eE", do: :collate - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"lL" and b4 in ~c"lL" and b5 in ~c"eE" and b6 in ~c"cC" and - b7 in ~c"tT", do: :collect - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"lL" and b4 in ~c"uU" and b5 in ~c"mM" and b6 in ~c"nN", do: :column - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"mM" and b4 in ~c"mM" and b5 in ~c"iI" and b6 in ~c"tT", do: :commit - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"dD" and b5 in ~c"iI" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"oO" and b9 in ~c"nN", do: :condition - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"nN" and b5 in ~c"eE" and b6 in ~c"cC" and - b7 in ~c"tT", do: :connect - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"sS" and b5 in ~c"tT" and b6 in ~c"rR" and - b7 in ~c"aA" and b8 in ~c"iI" and b9 in ~c"nN" and b10 in ~c"tT", do: :constraint - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"tT" and b5 in ~c"aA" and b6 in ~c"iI" and - b7 in ~c"nN" and b8 in ~c"sS", do: :contains - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"vV" and b5 in ~c"eE" and b6 in ~c"rR" and - b7 in ~c"tT", do: :convert - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"pP" and b4 in ~c"yY", do: :copy - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"rR" and b4 in ~c"rR", do: :corr - - def ident(:ident, [[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"rR" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"sS" and - b7 in ~c"pP" and b8 in ~c"oO" and b9 in ~c"nN" and b10 in ~c"dD" and b11 in ~c"iI" and - b12 in ~c"nN" and b13 in ~c"gG", do: :corresponding - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"sS", do: :cos - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"sS" and b4 in ~c"hH", do: :cosh - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"uU" and b4 in ~c"nN" and b5 in ~c"tT", do: :count - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"vV" and b4 in ~c"aA" and b5 in ~c"rR" and b6 in ~c"_" and - b7 in ~c"pP" and b8 in ~c"oO" and b9 in ~c"pP", do: :covar_pop - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"vV" and b4 in ~c"aA" and b5 in ~c"rR" and b6 in ~c"_" and - b7 in ~c"sS" and b8 in ~c"aA" and b9 in ~c"mM" and b10 in ~c"pP", do: :covar_samp - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"cC" and b2 in ~c"rR" and b3 in ~c"eE" and b4 in ~c"aA" and b5 in ~c"tT" and b6 in ~c"eE", do: :create - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"cC" and b2 in ~c"rR" and b3 in ~c"oO" and b4 in ~c"sS" and b5 in ~c"sS", do: :cross - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"bB" and b4 in ~c"eE", do: :cube - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"mM" and b4 in ~c"eE" and b5 in ~c"_" and b6 in ~c"dD" and - b7 in ~c"iI" and b8 in ~c"sS" and b9 in ~c"tT", do: :cume_dist - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"rR" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT", do: :current - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"rR" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"_" and b9 in ~c"cC" and b10 in ~c"aA" and b11 in ~c"tT" and - b12 in ~c"aA" and b13 in ~c"lL" and b14 in ~c"oO" and b15 in ~c"gG", do: :current_catalog - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"rR" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"_" and b9 in ~c"dD" and b10 in ~c"aA" and b11 in ~c"tT" and - b12 in ~c"eE", do: :current_date - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24], b25], b26], b27], b28], b29], b30], b31]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"rR" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"_" and b9 in ~c"dD" and b10 in ~c"eE" and b11 in ~c"fF" and - b12 in ~c"aA" and b13 in ~c"uU" and b14 in ~c"lL" and b15 in ~c"tT" and b16 in ~c"_" and - b17 in ~c"tT" and b18 in ~c"rR" and b19 in ~c"aA" and b20 in ~c"nN" and b21 in ~c"sS" and - b22 in ~c"fF" and b23 in ~c"oO" and b24 in ~c"rR" and b25 in ~c"mM" and b26 in ~c"_" and - b27 in ~c"gG" and b28 in ~c"rR" and b29 in ~c"oO" and b30 in ~c"uU" and b31 in ~c"pP", do: :current_default_transform_group - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"rR" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"_" and b9 in ~c"pP" and b10 in ~c"aA" and b11 in ~c"tT" and - b12 in ~c"hH", do: :current_path - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"rR" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"_" and b9 in ~c"rR" and b10 in ~c"oO" and b11 in ~c"lL" and - b12 in ~c"eE", do: :current_role - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"rR" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"_" and b9 in ~c"rR" and b10 in ~c"oO" and b11 in ~c"wW", do: :current_row - - def ident(:ident, [[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"rR" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"_" and b9 in ~c"sS" and b10 in ~c"cC" and b11 in ~c"hH" and - b12 in ~c"eE" and b13 in ~c"mM" and b14 in ~c"aA", do: :current_schema - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"rR" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"_" and b9 in ~c"tT" and b10 in ~c"iI" and b11 in ~c"mM" and - b12 in ~c"eE", do: :current_time - - def ident(:ident, [[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"rR" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"_" and b9 in ~c"tT" and b10 in ~c"iI" and b11 in ~c"mM" and - b12 in ~c"eE" and b13 in ~c"sS" and b14 in ~c"tT" and b15 in ~c"aA" and b16 in ~c"mM" and - b17 in ~c"pP", do: :current_timestamp - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24], b25], b26], b27], b28], b29], b30], b31], b32]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"rR" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"_" and b9 in ~c"tT" and b10 in ~c"rR" and b11 in ~c"aA" and - b12 in ~c"nN" and b13 in ~c"sS" and b14 in ~c"fF" and b15 in ~c"oO" and b16 in ~c"rR" and - b17 in ~c"mM" and b18 in ~c"_" and b19 in ~c"gG" and b20 in ~c"rR" and b21 in ~c"oO" and - b22 in ~c"uU" and b23 in ~c"pP" and b24 in ~c"_" and b25 in ~c"fF" and b26 in ~c"oO" and - b27 in ~c"rR" and b28 in ~c"_" and b29 in ~c"tT" and b30 in ~c"yY" and b31 in ~c"pP" and - b32 in ~c"eE", do: :current_transform_group_for_type - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"rR" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"_" and b9 in ~c"uU" and b10 in ~c"sS" and b11 in ~c"eE" and - b12 in ~c"rR", do: :current_user - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"rR" and b4 in ~c"sS" and b5 in ~c"oO" and b6 in ~c"rR", do: :cursor - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"cC" and b2 in ~c"yY" and b3 in ~c"cC" and b4 in ~c"lL" and b5 in ~c"eE", do: :cycle - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"dD" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"eE", do: :date - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"dD" and b2 in ~c"aA" and b3 in ~c"yY", do: :day - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"aA" and b4 in ~c"lL" and b5 in ~c"lL" and b6 in ~c"oO" and - b7 in ~c"cC" and b8 in ~c"aA" and b9 in ~c"tT" and b10 in ~c"eE", do: :deallocate - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"cC", do: :dec - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"cC" and b4 in ~c"fF" and b5 in ~c"lL" and b6 in ~c"oO" and - b7 in ~c"aA" and b8 in ~c"tT", do: :decfloat - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"cC" and b4 in ~c"iI" and b5 in ~c"mM" and b6 in ~c"aA" and - b7 in ~c"lL", do: :decimal - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"cC" and b4 in ~c"lL" and b5 in ~c"aA" and b6 in ~c"rR" and - b7 in ~c"eE", do: :declare - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"fF" and b4 in ~c"aA" and b5 in ~c"uU" and b6 in ~c"lL" and - b7 in ~c"tT", do: :default - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"fF" and b4 in ~c"iI" and b5 in ~c"nN" and b6 in ~c"eE", do: :define - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"lL" and b4 in ~c"eE" and b5 in ~c"tT" and b6 in ~c"eE", do: :delete - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"nN" and b4 in ~c"sS" and b5 in ~c"eE" and b6 in ~c"_" and - b7 in ~c"rR" and b8 in ~c"aA" and b9 in ~c"nN" and b10 in ~c"kK", do: :dense_rank - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"rR" and b4 in ~c"eE" and b5 in ~c"fF", do: :deref - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"cC" and b5 in ~c"rR" and b6 in ~c"iI" and - b7 in ~c"bB" and b8 in ~c"eE", do: :describe - - def ident(:ident, [[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"tT" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"mM" and - b7 in ~c"iI" and b8 in ~c"nN" and b9 in ~c"iI" and b10 in ~c"sS" and b11 in ~c"tT" and - b12 in ~c"iI" and b13 in ~c"cC", do: :deterministic - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"dD" and b2 in ~c"iI" and b3 in ~c"sS" and b4 in ~c"cC" and b5 in ~c"oO" and b6 in ~c"nN" and - b7 in ~c"nN" and b8 in ~c"eE" and b9 in ~c"cC" and b10 in ~c"tT", do: :disconnect - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"dD" and b2 in ~c"iI" and b3 in ~c"sS" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"cC" and b8 in ~c"tT", do: :distinct - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"dD" and b2 in ~c"oO" and b3 in ~c"uU" and b4 in ~c"bB" and b5 in ~c"lL" and b6 in ~c"eE", do: :double - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"dD" and b2 in ~c"rR" and b3 in ~c"oO" and b4 in ~c"pP", do: :drop - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"dD" and b2 in ~c"yY" and b3 in ~c"nN" and b4 in ~c"aA" and b5 in ~c"mM" and b6 in ~c"iI" and - b7 in ~c"cC", do: :dynamic - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"eE" and b2 in ~c"aA" and b3 in ~c"cC" and b4 in ~c"hH", do: :each - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"eE" and b2 in ~c"lL" and b3 in ~c"eE" and b4 in ~c"mM" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT", do: :element - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"eE" and b2 in ~c"lL" and b3 in ~c"sS" and b4 in ~c"eE", do: :else - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"eE" and b2 in ~c"mM" and b3 in ~c"pP" and b4 in ~c"tT" and b5 in ~c"yY", do: :empty - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"eE" and b2 in ~c"nN" and b3 in ~c"dD", do: :end - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"eE" and b2 in ~c"nN" and b3 in ~c"dD" and b4 in ~c"_" and b5 in ~c"fF" and b6 in ~c"rR" and - b7 in ~c"aA" and b8 in ~c"mM" and b9 in ~c"eE", do: :end_frame - - def ident(:ident, [[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when b1 in ~c"eE" and b2 in ~c"nN" and b3 in ~c"dD" and b4 in ~c"_" and b5 in ~c"pP" and b6 in ~c"aA" and - b7 in ~c"rR" and b8 in ~c"tT" and b9 in ~c"iI" and b10 in ~c"tT" and b11 in ~c"iI" and - b12 in ~c"oO" and b13 in ~c"nN", do: :end_partition - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"eE" and b2 in ~c"nN" and b3 in ~c"dD" and b4 in ~c"-" and b5 in ~c"eE" and b6 in ~c"xX" and - b7 in ~c"eE" and b8 in ~c"cC", do: :"end-exec" - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"eE" and b2 in ~c"qQ" and b3 in ~c"uU" and b4 in ~c"aA" and b5 in ~c"lL" and b6 in ~c"sS", do: :equals - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"eE" and b2 in ~c"sS" and b3 in ~c"cC" and b4 in ~c"aA" and b5 in ~c"pP" and b6 in ~c"eE", do: :escape - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"eE" and b2 in ~c"vV" and b3 in ~c"eE" and b4 in ~c"rR" and b5 in ~c"yY", do: :every - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"eE" and b2 in ~c"xX" and b3 in ~c"cC" and b4 in ~c"eE" and b5 in ~c"pP" and b6 in ~c"tT", do: :except - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"eE" and b2 in ~c"xX" and b3 in ~c"eE" and b4 in ~c"cC", do: :exec - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"eE" and b2 in ~c"xX" and b3 in ~c"eE" and b4 in ~c"cC" and b5 in ~c"uU" and b6 in ~c"tT" and - b7 in ~c"eE", do: :execute - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"eE" and b2 in ~c"xX" and b3 in ~c"iI" and b4 in ~c"sS" and b5 in ~c"tT" and b6 in ~c"sS", do: :exists - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"eE" and b2 in ~c"xX" and b3 in ~c"pP", do: :exp - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"eE" and b2 in ~c"xX" and b3 in ~c"tT" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"nN" and - b7 in ~c"aA" and b8 in ~c"lL", do: :external - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"eE" and b2 in ~c"xX" and b3 in ~c"tT" and b4 in ~c"rR" and b5 in ~c"aA" and b6 in ~c"cC" and - b7 in ~c"tT", do: :extract - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"fF" and b2 in ~c"aA" and b3 in ~c"lL" and b4 in ~c"sS" and b5 in ~c"eE", do: false - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"fF" and b2 in ~c"eE" and b3 in ~c"tT" and b4 in ~c"cC" and b5 in ~c"hH", do: :fetch - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"fF" and b2 in ~c"iI" and b3 in ~c"lL" and b4 in ~c"tT" and b5 in ~c"eE" and b6 in ~c"rR", do: :filter - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"fF" and b2 in ~c"iI" and b3 in ~c"rR" and b4 in ~c"sS" and b5 in ~c"tT" and b6 in ~c"_" and - b7 in ~c"vV" and b8 in ~c"aA" and b9 in ~c"lL" and b10 in ~c"uU" and b11 in ~c"eE", do: :first_value - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"fF" and b2 in ~c"lL" and b3 in ~c"oO" and b4 in ~c"aA" and b5 in ~c"tT", do: :float - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"fF" and b2 in ~c"lL" and b3 in ~c"oO" and b4 in ~c"oO" and b5 in ~c"rR", do: :floor - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"fF" and b2 in ~c"oO" and b3 in ~c"rR", do: :for - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"fF" and b2 in ~c"oO" and b3 in ~c"rR" and b4 in ~c"eE" and b5 in ~c"iI" and b6 in ~c"gG" and - b7 in ~c"nN", do: :foreign - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"fF" and b2 in ~c"rR" and b3 in ~c"aA" and b4 in ~c"mM" and b5 in ~c"eE" and b6 in ~c"_" and - b7 in ~c"rR" and b8 in ~c"oO" and b9 in ~c"wW", do: :frame_row - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"fF" and b2 in ~c"rR" and b3 in ~c"eE" and b4 in ~c"eE", do: :free - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"fF" and b2 in ~c"rR" and b3 in ~c"oO" and b4 in ~c"mM", do: :from - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"fF" and b2 in ~c"uU" and b3 in ~c"lL" and b4 in ~c"lL", do: :full - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"fF" and b2 in ~c"uU" and b3 in ~c"nN" and b4 in ~c"cC" and b5 in ~c"tT" and b6 in ~c"iI" and - b7 in ~c"oO" and b8 in ~c"nN", do: :function - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"fF" and b2 in ~c"uU" and b3 in ~c"sS" and b4 in ~c"iI" and b5 in ~c"oO" and b6 in ~c"nN", do: :fusion - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"gG" and b2 in ~c"eE" and b3 in ~c"tT", do: :get - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"gG" and b2 in ~c"lL" and b3 in ~c"oO" and b4 in ~c"bB" and b5 in ~c"aA" and b6 in ~c"lL", do: :global - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"gG" and b2 in ~c"rR" and b3 in ~c"aA" and b4 in ~c"nN" and b5 in ~c"tT", do: :grant - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"gG" and b2 in ~c"rR" and b3 in ~c"eE" and b4 in ~c"aA" and b5 in ~c"tT" and b6 in ~c"eE" and - b7 in ~c"sS" and b8 in ~c"tT", do: :greatest - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"gG" and b2 in ~c"rR" and b3 in ~c"oO" and b4 in ~c"uU" and b5 in ~c"pP", do: :group - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"gG" and b2 in ~c"rR" and b3 in ~c"oO" and b4 in ~c"uU" and b5 in ~c"pP" and b6 in ~c"iI" and - b7 in ~c"nN" and b8 in ~c"gG", do: :grouping - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"gG" and b2 in ~c"rR" and b3 in ~c"oO" and b4 in ~c"uU" and b5 in ~c"pP" and b6 in ~c"sS", do: :groups - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"hH" and b2 in ~c"aA" and b3 in ~c"vV" and b4 in ~c"iI" and b5 in ~c"nN" and b6 in ~c"gG", do: :having - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"hH" and b2 in ~c"oO" and b3 in ~c"lL" and b4 in ~c"dD", do: :hold - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"hH" and b2 in ~c"oO" and b3 in ~c"uU" and b4 in ~c"rR", do: :hour - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"iI" and b2 in ~c"dD" and b3 in ~c"eE" and b4 in ~c"nN" and b5 in ~c"tT" and b6 in ~c"iI" and - b7 in ~c"tT" and b8 in ~c"yY", do: :identity - - def ident(:ident, [[[], b1], b2]) when b1 in ~c"iI" and b2 in ~c"nN", do: :in - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"dD" and b4 in ~c"iI" and b5 in ~c"cC" and b6 in ~c"aA" and - b7 in ~c"tT" and b8 in ~c"oO" and b9 in ~c"rR", do: :indicator - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"iI" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"aA" and - b7 in ~c"lL", do: :initial - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"nN" and b4 in ~c"eE" and b5 in ~c"rR", do: :inner - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"oO" and b4 in ~c"uU" and b5 in ~c"tT", do: :inout - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"sS" and b4 in ~c"eE" and b5 in ~c"nN" and b6 in ~c"sS" and - b7 in ~c"iI" and b8 in ~c"tT" and b9 in ~c"iI" and b10 in ~c"vV" and b11 in ~c"eE", do: :insensitive - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"sS" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"tT", do: :insert - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"tT", do: :int - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"tT" and b4 in ~c"eE" and b5 in ~c"gG" and b6 in ~c"eE" and - b7 in ~c"rR", do: :integer - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"tT" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"sS" and - b7 in ~c"eE" and b8 in ~c"cC" and b9 in ~c"tT", do: :intersect - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"tT" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"sS" and - b7 in ~c"eE" and b8 in ~c"cC" and b9 in ~c"tT" and b10 in ~c"iI" and b11 in ~c"oO" and - b12 in ~c"nN", do: :intersection - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"tT" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"vV" and - b7 in ~c"aA" and b8 in ~c"lL", do: :interval - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"tT" and b4 in ~c"oO", do: :into - - def ident(:ident, [[[], b1], b2]) when b1 in ~c"iI" and b2 in ~c"sS", do: :is - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"jJ" and b2 in ~c"oO" and b3 in ~c"iI" and b4 in ~c"nN", do: :join - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"jJ" and b2 in ~c"sS" and b3 in ~c"oO" and b4 in ~c"nN", do: :json - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"jJ" and b2 in ~c"sS" and b3 in ~c"oO" and b4 in ~c"nN" and b5 in ~c"_" and b6 in ~c"aA" and - b7 in ~c"rR" and b8 in ~c"rR" and b9 in ~c"aA" and b10 in ~c"yY", do: :json_array - - def ident(:ident, [[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when b1 in ~c"jJ" and b2 in ~c"sS" and b3 in ~c"oO" and b4 in ~c"nN" and b5 in ~c"_" and b6 in ~c"aA" and - b7 in ~c"rR" and b8 in ~c"rR" and b9 in ~c"aA" and b10 in ~c"yY" and b11 in ~c"aA" and - b12 in ~c"gG" and b13 in ~c"gG", do: :json_arrayagg - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"jJ" and b2 in ~c"sS" and b3 in ~c"oO" and b4 in ~c"nN" and b5 in ~c"_" and b6 in ~c"eE" and - b7 in ~c"xX" and b8 in ~c"iI" and b9 in ~c"sS" and b10 in ~c"tT" and b11 in ~c"sS", do: :json_exists - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"jJ" and b2 in ~c"sS" and b3 in ~c"oO" and b4 in ~c"nN" and b5 in ~c"_" and b6 in ~c"oO" and - b7 in ~c"bB" and b8 in ~c"jJ" and b9 in ~c"eE" and b10 in ~c"cC" and b11 in ~c"tT", do: :json_object - - def ident(:ident, [[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when b1 in ~c"jJ" and b2 in ~c"sS" and b3 in ~c"oO" and b4 in ~c"nN" and b5 in ~c"_" and b6 in ~c"oO" and - b7 in ~c"bB" and b8 in ~c"jJ" and b9 in ~c"eE" and b10 in ~c"cC" and b11 in ~c"tT" and - b12 in ~c"aA" and b13 in ~c"gG" and b14 in ~c"gG", do: :json_objectagg - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"jJ" and b2 in ~c"sS" and b3 in ~c"oO" and b4 in ~c"nN" and b5 in ~c"_" and b6 in ~c"qQ" and - b7 in ~c"uU" and b8 in ~c"eE" and b9 in ~c"rR" and b10 in ~c"yY", do: :json_query - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"jJ" and b2 in ~c"sS" and b3 in ~c"oO" and b4 in ~c"nN" and b5 in ~c"_" and b6 in ~c"sS" and - b7 in ~c"cC" and b8 in ~c"aA" and b9 in ~c"lL" and b10 in ~c"aA" and b11 in ~c"rR", do: :json_scalar - - def ident(:ident, [[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when b1 in ~c"jJ" and b2 in ~c"sS" and b3 in ~c"oO" and b4 in ~c"nN" and b5 in ~c"_" and b6 in ~c"sS" and - b7 in ~c"eE" and b8 in ~c"rR" and b9 in ~c"iI" and b10 in ~c"aA" and b11 in ~c"lL" and - b12 in ~c"iI" and b13 in ~c"zZ" and b14 in ~c"eE", do: :json_serialize - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"jJ" and b2 in ~c"sS" and b3 in ~c"oO" and b4 in ~c"nN" and b5 in ~c"_" and b6 in ~c"tT" and - b7 in ~c"aA" and b8 in ~c"bB" and b9 in ~c"lL" and b10 in ~c"eE", do: :json_table - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20]) when b1 in ~c"jJ" and b2 in ~c"sS" and b3 in ~c"oO" and b4 in ~c"nN" and b5 in ~c"_" and b6 in ~c"tT" and - b7 in ~c"aA" and b8 in ~c"bB" and b9 in ~c"lL" and b10 in ~c"eE" and b11 in ~c"_" and - b12 in ~c"pP" and b13 in ~c"rR" and b14 in ~c"iI" and b15 in ~c"mM" and b16 in ~c"iI" and - b17 in ~c"tT" and b18 in ~c"iI" and b19 in ~c"vV" and b20 in ~c"eE", do: :json_table_primitive - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"jJ" and b2 in ~c"sS" and b3 in ~c"oO" and b4 in ~c"nN" and b5 in ~c"_" and b6 in ~c"vV" and - b7 in ~c"aA" and b8 in ~c"lL" and b9 in ~c"uU" and b10 in ~c"eE", do: :json_value - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"lL" and b2 in ~c"aA" and b3 in ~c"gG", do: :lag - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"lL" and b2 in ~c"aA" and b3 in ~c"nN" and b4 in ~c"gG" and b5 in ~c"uU" and b6 in ~c"aA" and - b7 in ~c"gG" and b8 in ~c"eE", do: :language - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"lL" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"gG" and b5 in ~c"eE", do: :large - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"lL" and b2 in ~c"aA" and b3 in ~c"sS" and b4 in ~c"tT" and b5 in ~c"_" and b6 in ~c"vV" and - b7 in ~c"aA" and b8 in ~c"lL" and b9 in ~c"uU" and b10 in ~c"eE", do: :last_value - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"lL" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"aA" and - b7 in ~c"lL", do: :lateral - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"lL" and b2 in ~c"eE" and b3 in ~c"aA" and b4 in ~c"dD", do: :lead - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"lL" and b2 in ~c"eE" and b3 in ~c"aA" and b4 in ~c"dD" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"gG", do: :leading - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"lL" and b2 in ~c"eE" and b3 in ~c"aA" and b4 in ~c"sS" and b5 in ~c"tT", do: :least - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"lL" and b2 in ~c"eE" and b3 in ~c"fF" and b4 in ~c"tT", do: :left - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"lL" and b2 in ~c"iI" and b3 in ~c"kK" and b4 in ~c"eE", do: :like - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"lL" and b2 in ~c"iI" and b3 in ~c"kK" and b4 in ~c"eE" and b5 in ~c"_" and b6 in ~c"rR" and - b7 in ~c"eE" and b8 in ~c"gG" and b9 in ~c"eE" and b10 in ~c"xX", do: :like_regex - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"lL" and b2 in ~c"iI" and b3 in ~c"sS" and b4 in ~c"tT" and b5 in ~c"aA" and b6 in ~c"gG" and - b7 in ~c"gG", do: :listagg - - def ident(:ident, [[[], b1], b2]) when b1 in ~c"lL" and b2 in ~c"nN", do: :ln - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"lL" and b2 in ~c"oO" and b3 in ~c"cC" and b4 in ~c"aA" and b5 in ~c"lL", do: :local - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"lL" and b2 in ~c"oO" and b3 in ~c"cC" and b4 in ~c"aA" and b5 in ~c"lL" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"mM" and b9 in ~c"eE", do: :localtime - - def ident(:ident, [[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when b1 in ~c"lL" and b2 in ~c"oO" and b3 in ~c"cC" and b4 in ~c"aA" and b5 in ~c"lL" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"mM" and b9 in ~c"eE" and b10 in ~c"sS" and b11 in ~c"tT" and - b12 in ~c"aA" and b13 in ~c"mM" and b14 in ~c"pP", do: :localtimestamp - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"lL" and b2 in ~c"oO" and b3 in ~c"gG", do: :log - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"lL" and b2 in ~c"oO" and b3 in ~c"gG" and b4 in ~c"1" and b5 in ~c"0", do: :log10 - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"lL" and b2 in ~c"oO" and b3 in ~c"wW" and b4 in ~c"eE" and b5 in ~c"rR", do: :lower - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"lL" and b2 in ~c"pP" and b3 in ~c"aA" and b4 in ~c"dD", do: :lpad - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"lL" and b2 in ~c"tT" and b3 in ~c"rR" and b4 in ~c"iI" and b5 in ~c"mM", do: :ltrim - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"mM" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"cC" and b5 in ~c"hH", do: :match - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"mM" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"cC" and b5 in ~c"hH" and b6 in ~c"_" and - b7 in ~c"nN" and b8 in ~c"uU" and b9 in ~c"mM" and b10 in ~c"bB" and b11 in ~c"eE" and - b12 in ~c"rR", do: :match_number - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"mM" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"cC" and b5 in ~c"hH" and b6 in ~c"_" and - b7 in ~c"rR" and b8 in ~c"eE" and b9 in ~c"cC" and b10 in ~c"oO" and b11 in ~c"gG" and - b12 in ~c"nN" and b13 in ~c"iI" and b14 in ~c"zZ" and b15 in ~c"eE", do: :match_recognize - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"mM" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"cC" and b5 in ~c"hH" and b6 in ~c"eE" and - b7 in ~c"sS", do: :matches - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"mM" and b2 in ~c"aA" and b3 in ~c"xX", do: :max - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"mM" and b2 in ~c"eE" and b3 in ~c"mM" and b4 in ~c"bB" and b5 in ~c"eE" and b6 in ~c"rR", do: :member - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"mM" and b2 in ~c"eE" and b3 in ~c"rR" and b4 in ~c"gG" and b5 in ~c"eE", do: :merge - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"mM" and b2 in ~c"eE" and b3 in ~c"tT" and b4 in ~c"hH" and b5 in ~c"oO" and b6 in ~c"dD", do: :method - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"mM" and b2 in ~c"iI" and b3 in ~c"nN", do: :min - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"mM" and b2 in ~c"iI" and b3 in ~c"nN" and b4 in ~c"uU" and b5 in ~c"tT" and b6 in ~c"eE", do: :minute - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"mM" and b2 in ~c"oO" and b3 in ~c"dD", do: :mod - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"mM" and b2 in ~c"oO" and b3 in ~c"dD" and b4 in ~c"iI" and b5 in ~c"fF" and b6 in ~c"iI" and - b7 in ~c"eE" and b8 in ~c"sS", do: :modifies - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"mM" and b2 in ~c"oO" and b3 in ~c"dD" and b4 in ~c"uU" and b5 in ~c"lL" and b6 in ~c"eE", do: :module - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"mM" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"tT" and b5 in ~c"hH", do: :month - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"mM" and b2 in ~c"uU" and b3 in ~c"lL" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"sS" and - b7 in ~c"eE" and b8 in ~c"tT", do: :multiset - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"nN" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"iI" and b5 in ~c"oO" and b6 in ~c"nN" and - b7 in ~c"aA" and b8 in ~c"lL", do: :national - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"nN" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"uU" and b5 in ~c"rR" and b6 in ~c"aA" and - b7 in ~c"lL", do: :natural - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"nN" and b2 in ~c"cC" and b3 in ~c"hH" and b4 in ~c"aA" and b5 in ~c"rR", do: :nchar - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"nN" and b2 in ~c"cC" and b3 in ~c"lL" and b4 in ~c"oO" and b5 in ~c"bB", do: :nclob - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"nN" and b2 in ~c"eE" and b3 in ~c"wW", do: :new - - def ident(:ident, [[[], b1], b2]) when b1 in ~c"nN" and b2 in ~c"oO", do: :no - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"nN" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"eE", do: :none - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"nN" and b2 in ~c"oO" and b3 in ~c"rR" and b4 in ~c"mM" and b5 in ~c"aA" and b6 in ~c"lL" and - b7 in ~c"iI" and b8 in ~c"zZ" and b9 in ~c"eE", do: :normalize - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"nN" and b2 in ~c"oO" and b3 in ~c"tT", do: :not - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"nN" and b2 in ~c"tT" and b3 in ~c"hH" and b4 in ~c"_" and b5 in ~c"vV" and b6 in ~c"aA" and - b7 in ~c"lL" and b8 in ~c"uU" and b9 in ~c"eE", do: :nth_value - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"nN" and b2 in ~c"tT" and b3 in ~c"iI" and b4 in ~c"lL" and b5 in ~c"eE", do: :ntile - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"nN" and b2 in ~c"uU" and b3 in ~c"lL" and b4 in ~c"lL", do: :null - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"nN" and b2 in ~c"uU" and b3 in ~c"lL" and b4 in ~c"lL" and b5 in ~c"iI" and b6 in ~c"fF", do: :nullif - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"nN" and b2 in ~c"uU" and b3 in ~c"mM" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"iI" and - b7 in ~c"cC", do: :numeric - - def ident(:ident, [[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17]) when b1 in ~c"oO" and b2 in ~c"cC" and b3 in ~c"cC" and b4 in ~c"uU" and b5 in ~c"rR" and b6 in ~c"rR" and - b7 in ~c"eE" and b8 in ~c"nN" and b9 in ~c"cC" and b10 in ~c"eE" and b11 in ~c"sS" and - b12 in ~c"_" and b13 in ~c"rR" and b14 in ~c"eE" and b15 in ~c"gG" and b16 in ~c"eE" and - b17 in ~c"xX", do: :occurrences_regex - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"oO" and b2 in ~c"cC" and b3 in ~c"tT" and b4 in ~c"eE" and b5 in ~c"tT" and b6 in ~c"_" and - b7 in ~c"lL" and b8 in ~c"eE" and b9 in ~c"nN" and b10 in ~c"gG" and b11 in ~c"tT" and - b12 in ~c"hH", do: :octet_length - - def ident(:ident, [[[], b1], b2]) when b1 in ~c"oO" and b2 in ~c"fF", do: :of - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"oO" and b2 in ~c"fF" and b3 in ~c"fF" and b4 in ~c"sS" and b5 in ~c"eE" and b6 in ~c"tT", do: :offset - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"oO" and b2 in ~c"lL" and b3 in ~c"dD", do: :old - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"oO" and b2 in ~c"mM" and b3 in ~c"iI" and b4 in ~c"tT", do: :omit - - def ident(:ident, [[[], b1], b2]) when b1 in ~c"oO" and b2 in ~c"nN", do: :on - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"oO" and b2 in ~c"nN" and b3 in ~c"eE", do: :one - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"oO" and b2 in ~c"nN" and b3 in ~c"lL" and b4 in ~c"yY", do: :only - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"oO" and b2 in ~c"pP" and b3 in ~c"eE" and b4 in ~c"nN", do: :open - - def ident(:ident, [[[], b1], b2]) when b1 in ~c"oO" and b2 in ~c"rR", do: :or - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"oO" and b2 in ~c"rR" and b3 in ~c"dD" and b4 in ~c"eE" and b5 in ~c"rR", do: :order - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"oO" and b2 in ~c"uU" and b3 in ~c"tT", do: :out - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"oO" and b2 in ~c"uU" and b3 in ~c"tT" and b4 in ~c"eE" and b5 in ~c"rR", do: :outer - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"oO" and b2 in ~c"vV" and b3 in ~c"eE" and b4 in ~c"rR", do: :over - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"oO" and b2 in ~c"vV" and b3 in ~c"eE" and b4 in ~c"rR" and b5 in ~c"lL" and b6 in ~c"aA" and - b7 in ~c"pP" and b8 in ~c"sS", do: :overlaps - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"oO" and b2 in ~c"vV" and b3 in ~c"eE" and b4 in ~c"rR" and b5 in ~c"lL" and b6 in ~c"aA" and - b7 in ~c"yY", do: :overlay - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"aA" and b5 in ~c"mM" and b6 in ~c"eE" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"rR", do: :parameter - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"oO" and b9 in ~c"nN", do: :partition - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"tT" and b5 in ~c"eE" and b6 in ~c"rR" and - b7 in ~c"nN", do: :pattern - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"pP" and b2 in ~c"eE" and b3 in ~c"rR", do: :per - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"pP" and b2 in ~c"eE" and b3 in ~c"rR" and b4 in ~c"cC" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT", do: :percent - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"pP" and b2 in ~c"eE" and b3 in ~c"rR" and b4 in ~c"cC" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"_" and b9 in ~c"rR" and b10 in ~c"aA" and b11 in ~c"nN" and - b12 in ~c"kK", do: :percent_rank - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"pP" and b2 in ~c"eE" and b3 in ~c"rR" and b4 in ~c"cC" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"iI" and b9 in ~c"lL" and b10 in ~c"eE" and b11 in ~c"_" and - b12 in ~c"cC" and b13 in ~c"oO" and b14 in ~c"nN" and b15 in ~c"tT", do: :percentile_cont - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"pP" and b2 in ~c"eE" and b3 in ~c"rR" and b4 in ~c"cC" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"iI" and b9 in ~c"lL" and b10 in ~c"eE" and b11 in ~c"_" and - b12 in ~c"dD" and b13 in ~c"iI" and b14 in ~c"sS" and b15 in ~c"cC", do: :percentile_disc - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"pP" and b2 in ~c"eE" and b3 in ~c"rR" and b4 in ~c"iI" and b5 in ~c"oO" and b6 in ~c"dD", do: :period - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"pP" and b2 in ~c"oO" and b3 in ~c"rR" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"oO" and - b7 in ~c"nN", do: :portion - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"pP" and b2 in ~c"oO" and b3 in ~c"sS" and b4 in ~c"iI" and b5 in ~c"tT" and b6 in ~c"iI" and - b7 in ~c"oO" and b8 in ~c"nN", do: :position - - def ident(:ident, [[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when b1 in ~c"pP" and b2 in ~c"oO" and b3 in ~c"sS" and b4 in ~c"iI" and b5 in ~c"tT" and b6 in ~c"iI" and - b7 in ~c"oO" and b8 in ~c"nN" and b9 in ~c"_" and b10 in ~c"rR" and b11 in ~c"eE" and - b12 in ~c"gG" and b13 in ~c"eE" and b14 in ~c"xX", do: :position_regex - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"pP" and b2 in ~c"oO" and b3 in ~c"wW" and b4 in ~c"eE" and b5 in ~c"rR", do: :power - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"pP" and b2 in ~c"rR" and b3 in ~c"eE" and b4 in ~c"cC" and b5 in ~c"eE" and b6 in ~c"dD" and - b7 in ~c"eE" and b8 in ~c"sS", do: :precedes - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"pP" and b2 in ~c"rR" and b3 in ~c"eE" and b4 in ~c"cC" and b5 in ~c"iI" and b6 in ~c"sS" and - b7 in ~c"iI" and b8 in ~c"oO" and b9 in ~c"nN", do: :precision - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"pP" and b2 in ~c"rR" and b3 in ~c"eE" and b4 in ~c"pP" and b5 in ~c"aA" and b6 in ~c"rR" and - b7 in ~c"eE", do: :prepare - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"pP" and b2 in ~c"rR" and b3 in ~c"iI" and b4 in ~c"mM" and b5 in ~c"aA" and b6 in ~c"rR" and - b7 in ~c"yY", do: :primary - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"pP" and b2 in ~c"rR" and b3 in ~c"oO" and b4 in ~c"cC" and b5 in ~c"eE" and b6 in ~c"dD" and - b7 in ~c"uU" and b8 in ~c"rR" and b9 in ~c"eE", do: :procedure - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"pP" and b2 in ~c"tT" and b3 in ~c"fF", do: :ptf - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"rR" and b2 in ~c"aA" and b3 in ~c"nN" and b4 in ~c"gG" and b5 in ~c"eE", do: :range - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"rR" and b2 in ~c"aA" and b3 in ~c"nN" and b4 in ~c"kK", do: :rank - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"aA" and b4 in ~c"dD" and b5 in ~c"sS", do: :reads - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"aA" and b4 in ~c"lL", do: :real - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"cC" and b4 in ~c"uU" and b5 in ~c"rR" and b6 in ~c"sS" and - b7 in ~c"iI" and b8 in ~c"vV" and b9 in ~c"eE", do: :recursive - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"fF", do: :ref - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"fF" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"eE" and - b7 in ~c"nN" and b8 in ~c"cC" and b9 in ~c"eE" and b10 in ~c"sS", do: :references - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"fF" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"eE" and - b7 in ~c"nN" and b8 in ~c"cC" and b9 in ~c"iI" and b10 in ~c"nN" and b11 in ~c"gG", do: :referencing - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"gG" and b4 in ~c"rR" and b5 in ~c"_" and b6 in ~c"aA" and - b7 in ~c"vV" and b8 in ~c"gG" and b9 in ~c"xX", do: :regr_avgx - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"gG" and b4 in ~c"rR" and b5 in ~c"_" and b6 in ~c"aA" and - b7 in ~c"vV" and b8 in ~c"gG" and b9 in ~c"yY", do: :regr_avgy - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"gG" and b4 in ~c"rR" and b5 in ~c"_" and b6 in ~c"cC" and - b7 in ~c"oO" and b8 in ~c"uU" and b9 in ~c"nN" and b10 in ~c"tT", do: :regr_count - - def ident(:ident, [[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"gG" and b4 in ~c"rR" and b5 in ~c"_" and b6 in ~c"iI" and - b7 in ~c"nN" and b8 in ~c"tT" and b9 in ~c"eE" and b10 in ~c"rR" and b11 in ~c"cC" and - b12 in ~c"eE" and b13 in ~c"pP" and b14 in ~c"tT", do: :regr_intercept - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"gG" and b4 in ~c"rR" and b5 in ~c"_" and b6 in ~c"rR" and - b7 in ~c"2", do: :regr_r2 - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"gG" and b4 in ~c"rR" and b5 in ~c"_" and b6 in ~c"sS" and - b7 in ~c"lL" and b8 in ~c"oO" and b9 in ~c"pP" and b10 in ~c"eE", do: :regr_slope - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"gG" and b4 in ~c"rR" and b5 in ~c"_" and b6 in ~c"sS" and - b7 in ~c"xX" and b8 in ~c"xX", do: :regr_sxx - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"gG" and b4 in ~c"rR" and b5 in ~c"_" and b6 in ~c"sS" and - b7 in ~c"xX" and b8 in ~c"yY", do: :regr_sxy - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"gG" and b4 in ~c"rR" and b5 in ~c"_" and b6 in ~c"sS" and - b7 in ~c"yY" and b8 in ~c"yY", do: :regr_syy - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"lL" and b4 in ~c"eE" and b5 in ~c"aA" and b6 in ~c"sS" and - b7 in ~c"eE", do: :release - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"uU" and b5 in ~c"lL" and b6 in ~c"tT", do: :result - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"tT" and b4 in ~c"uU" and b5 in ~c"rR" and b6 in ~c"nN", do: :return - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"tT" and b4 in ~c"uU" and b5 in ~c"rR" and b6 in ~c"nN" and - b7 in ~c"sS", do: :returns - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"vV" and b4 in ~c"oO" and b5 in ~c"kK" and b6 in ~c"eE", do: :revoke - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"rR" and b2 in ~c"iI" and b3 in ~c"gG" and b4 in ~c"hH" and b5 in ~c"tT", do: :right - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"rR" and b2 in ~c"oO" and b3 in ~c"lL" and b4 in ~c"lL" and b5 in ~c"bB" and b6 in ~c"aA" and - b7 in ~c"cC" and b8 in ~c"kK", do: :rollback - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"rR" and b2 in ~c"oO" and b3 in ~c"lL" and b4 in ~c"lL" and b5 in ~c"uU" and b6 in ~c"pP", do: :rollup - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"rR" and b2 in ~c"oO" and b3 in ~c"wW", do: :row - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"rR" and b2 in ~c"oO" and b3 in ~c"wW" and b4 in ~c"_" and b5 in ~c"nN" and b6 in ~c"uU" and - b7 in ~c"mM" and b8 in ~c"bB" and b9 in ~c"eE" and b10 in ~c"rR", do: :row_number - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"rR" and b2 in ~c"oO" and b3 in ~c"wW" and b4 in ~c"sS", do: :rows - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"rR" and b2 in ~c"pP" and b3 in ~c"aA" and b4 in ~c"dD", do: :rpad - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"rR" and b2 in ~c"tT" and b3 in ~c"rR" and b4 in ~c"iI" and b5 in ~c"mM", do: :rtrim - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"rR" and b2 in ~c"uU" and b3 in ~c"nN" and b4 in ~c"nN" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"gG", do: :running - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"sS" and b2 in ~c"aA" and b3 in ~c"vV" and b4 in ~c"eE" and b5 in ~c"pP" and b6 in ~c"oO" and - b7 in ~c"iI" and b8 in ~c"nN" and b9 in ~c"tT", do: :savepoint - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"sS" and b2 in ~c"cC" and b3 in ~c"oO" and b4 in ~c"pP" and b5 in ~c"eE", do: :scope - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"sS" and b2 in ~c"cC" and b3 in ~c"rR" and b4 in ~c"oO" and b5 in ~c"lL" and b6 in ~c"lL", do: :scroll - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"aA" and b4 in ~c"rR" and b5 in ~c"cC" and b6 in ~c"hH", do: :search - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"cC" and b4 in ~c"oO" and b5 in ~c"nN" and b6 in ~c"dD", do: :second - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"eE" and b4 in ~c"kK", do: :seek - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"lL" and b4 in ~c"eE" and b5 in ~c"cC" and b6 in ~c"tT", do: :select - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"nN" and b4 in ~c"sS" and b5 in ~c"iI" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"vV" and b9 in ~c"eE", do: :sensitive - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"sS" and b5 in ~c"iI" and b6 in ~c"oO" and - b7 in ~c"nN" and b8 in ~c"_" and b9 in ~c"uU" and b10 in ~c"sS" and b11 in ~c"eE" and - b12 in ~c"rR", do: :session_user - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"tT", do: :set - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"sS" and b2 in ~c"hH" and b3 in ~c"oO" and b4 in ~c"wW", do: :show - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"sS" and b2 in ~c"iI" and b3 in ~c"mM" and b4 in ~c"iI" and b5 in ~c"lL" and b6 in ~c"aA" and - b7 in ~c"rR", do: :similar - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"sS" and b2 in ~c"iI" and b3 in ~c"nN", do: :sin - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"sS" and b2 in ~c"iI" and b3 in ~c"nN" and b4 in ~c"hH", do: :sinh - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"sS" and b2 in ~c"kK" and b3 in ~c"iI" and b4 in ~c"pP", do: :skip - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"sS" and b2 in ~c"mM" and b3 in ~c"aA" and b4 in ~c"lL" and b5 in ~c"lL" and b6 in ~c"iI" and - b7 in ~c"nN" and b8 in ~c"tT", do: :smallint - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"sS" and b2 in ~c"oO" and b3 in ~c"mM" and b4 in ~c"eE", do: :some - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"sS" and b2 in ~c"pP" and b3 in ~c"eE" and b4 in ~c"cC" and b5 in ~c"iI" and b6 in ~c"fF" and - b7 in ~c"iI" and b8 in ~c"cC", do: :specific - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"sS" and b2 in ~c"pP" and b3 in ~c"eE" and b4 in ~c"cC" and b5 in ~c"iI" and b6 in ~c"fF" and - b7 in ~c"iI" and b8 in ~c"cC" and b9 in ~c"tT" and b10 in ~c"yY" and b11 in ~c"pP" and - b12 in ~c"eE", do: :specifictype - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"sS" and b2 in ~c"qQ" and b3 in ~c"lL", do: :sql - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"sS" and b2 in ~c"qQ" and b3 in ~c"lL" and b4 in ~c"eE" and b5 in ~c"xX" and b6 in ~c"cC" and - b7 in ~c"eE" and b8 in ~c"pP" and b9 in ~c"tT" and b10 in ~c"iI" and b11 in ~c"oO" and - b12 in ~c"nN", do: :sqlexception - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"sS" and b2 in ~c"qQ" and b3 in ~c"lL" and b4 in ~c"sS" and b5 in ~c"tT" and b6 in ~c"aA" and - b7 in ~c"tT" and b8 in ~c"eE", do: :sqlstate - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"sS" and b2 in ~c"qQ" and b3 in ~c"lL" and b4 in ~c"wW" and b5 in ~c"aA" and b6 in ~c"rR" and - b7 in ~c"nN" and b8 in ~c"iI" and b9 in ~c"nN" and b10 in ~c"gG", do: :sqlwarning - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"sS" and b2 in ~c"qQ" and b3 in ~c"rR" and b4 in ~c"tT", do: :sqrt - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"sS" and b2 in ~c"tT" and b3 in ~c"aA" and b4 in ~c"rR" and b5 in ~c"tT", do: :start - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"sS" and b2 in ~c"tT" and b3 in ~c"aA" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"cC", do: :static - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"sS" and b2 in ~c"tT" and b3 in ~c"dD" and b4 in ~c"dD" and b5 in ~c"eE" and b6 in ~c"vV" and - b7 in ~c"_" and b8 in ~c"pP" and b9 in ~c"oO" and b10 in ~c"pP", do: :stddev_pop - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"sS" and b2 in ~c"tT" and b3 in ~c"dD" and b4 in ~c"dD" and b5 in ~c"eE" and b6 in ~c"vV" and - b7 in ~c"_" and b8 in ~c"sS" and b9 in ~c"aA" and b10 in ~c"mM" and b11 in ~c"pP", do: :stddev_samp - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"sS" and b2 in ~c"uU" and b3 in ~c"bB" and b4 in ~c"mM" and b5 in ~c"uU" and b6 in ~c"lL" and - b7 in ~c"tT" and b8 in ~c"iI" and b9 in ~c"sS" and b10 in ~c"eE" and b11 in ~c"tT", do: :submultiset - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"sS" and b2 in ~c"uU" and b3 in ~c"bB" and b4 in ~c"sS" and b5 in ~c"eE" and b6 in ~c"tT", do: :subset - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"sS" and b2 in ~c"uU" and b3 in ~c"bB" and b4 in ~c"sS" and b5 in ~c"tT" and b6 in ~c"rR" and - b7 in ~c"iI" and b8 in ~c"nN" and b9 in ~c"gG", do: :substring - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"sS" and b2 in ~c"uU" and b3 in ~c"bB" and b4 in ~c"sS" and b5 in ~c"tT" and b6 in ~c"rR" and - b7 in ~c"iI" and b8 in ~c"nN" and b9 in ~c"gG" and b10 in ~c"_" and b11 in ~c"rR" and - b12 in ~c"eE" and b13 in ~c"gG" and b14 in ~c"eE" and b15 in ~c"xX", do: :substring_regex - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"sS" and b2 in ~c"uU" and b3 in ~c"cC" and b4 in ~c"cC" and b5 in ~c"eE" and b6 in ~c"eE" and - b7 in ~c"dD" and b8 in ~c"sS", do: :succeeds - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"sS" and b2 in ~c"uU" and b3 in ~c"mM", do: :sum - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"sS" and b2 in ~c"yY" and b3 in ~c"mM" and b4 in ~c"mM" and b5 in ~c"eE" and b6 in ~c"tT" and - b7 in ~c"rR" and b8 in ~c"iI" and b9 in ~c"cC", do: :symmetric - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"sS" and b2 in ~c"yY" and b3 in ~c"sS" and b4 in ~c"tT" and b5 in ~c"eE" and b6 in ~c"mM", do: :system - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"sS" and b2 in ~c"yY" and b3 in ~c"sS" and b4 in ~c"tT" and b5 in ~c"eE" and b6 in ~c"mM" and - b7 in ~c"_" and b8 in ~c"tT" and b9 in ~c"iI" and b10 in ~c"mM" and b11 in ~c"eE", do: :system_time - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"sS" and b2 in ~c"yY" and b3 in ~c"sS" and b4 in ~c"tT" and b5 in ~c"eE" and b6 in ~c"mM" and - b7 in ~c"_" and b8 in ~c"uU" and b9 in ~c"sS" and b10 in ~c"eE" and b11 in ~c"rR", do: :system_user - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"tT" and b2 in ~c"aA" and b3 in ~c"bB" and b4 in ~c"lL" and b5 in ~c"eE", do: :table - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"tT" and b2 in ~c"aA" and b3 in ~c"bB" and b4 in ~c"lL" and b5 in ~c"eE" and b6 in ~c"sS" and - b7 in ~c"aA" and b8 in ~c"mM" and b9 in ~c"pP" and b10 in ~c"lL" and b11 in ~c"eE", do: :tablesample - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"tT" and b2 in ~c"aA" and b3 in ~c"nN", do: :tan - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"tT" and b2 in ~c"aA" and b3 in ~c"nN" and b4 in ~c"hH", do: :tanh - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"tT" and b2 in ~c"hH" and b3 in ~c"eE" and b4 in ~c"nN", do: :then - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"tT" and b2 in ~c"iI" and b3 in ~c"mM" and b4 in ~c"eE", do: :time - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"tT" and b2 in ~c"iI" and b3 in ~c"mM" and b4 in ~c"eE" and b5 in ~c"sS" and b6 in ~c"tT" and - b7 in ~c"aA" and b8 in ~c"mM" and b9 in ~c"pP", do: :timestamp - - def ident(:ident, [[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when b1 in ~c"tT" and b2 in ~c"iI" and b3 in ~c"mM" and b4 in ~c"eE" and b5 in ~c"zZ" and b6 in ~c"oO" and - b7 in ~c"nN" and b8 in ~c"eE" and b9 in ~c"_" and b10 in ~c"hH" and b11 in ~c"oO" and - b12 in ~c"uU" and b13 in ~c"rR", do: :timezone_hour - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"tT" and b2 in ~c"iI" and b3 in ~c"mM" and b4 in ~c"eE" and b5 in ~c"zZ" and b6 in ~c"oO" and - b7 in ~c"nN" and b8 in ~c"eE" and b9 in ~c"_" and b10 in ~c"mM" and b11 in ~c"iI" and - b12 in ~c"nN" and b13 in ~c"uU" and b14 in ~c"tT" and b15 in ~c"eE", do: :timezone_minute - - def ident(:ident, [[[], b1], b2]) when b1 in ~c"tT" and b2 in ~c"oO", do: :to - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"aA" and b4 in ~c"iI" and b5 in ~c"lL" and b6 in ~c"iI" and - b7 in ~c"nN" and b8 in ~c"gG", do: :trailing - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"aA" and b4 in ~c"nN" and b5 in ~c"sS" and b6 in ~c"lL" and - b7 in ~c"aA" and b8 in ~c"tT" and b9 in ~c"eE", do: :translate - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"aA" and b4 in ~c"nN" and b5 in ~c"sS" and b6 in ~c"lL" and - b7 in ~c"aA" and b8 in ~c"tT" and b9 in ~c"eE" and b10 in ~c"_" and b11 in ~c"rR" and - b12 in ~c"eE" and b13 in ~c"gG" and b14 in ~c"eE" and b15 in ~c"xX", do: :translate_regex - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"aA" and b4 in ~c"nN" and b5 in ~c"sS" and b6 in ~c"lL" and - b7 in ~c"aA" and b8 in ~c"tT" and b9 in ~c"iI" and b10 in ~c"oO" and b11 in ~c"nN", do: :translation - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"eE" and b4 in ~c"aA" and b5 in ~c"tT", do: :treat - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"iI" and b4 in ~c"gG" and b5 in ~c"gG" and b6 in ~c"eE" and - b7 in ~c"rR", do: :trigger - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"iI" and b4 in ~c"mM", do: :trim - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"iI" and b4 in ~c"mM" and b5 in ~c"_" and b6 in ~c"aA" and - b7 in ~c"rR" and b8 in ~c"rR" and b9 in ~c"aA" and b10 in ~c"yY", do: :trim_array - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"uU" and b4 in ~c"eE", do: true - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"uU" and b4 in ~c"nN" and b5 in ~c"cC" and b6 in ~c"aA" and - b7 in ~c"tT" and b8 in ~c"eE", do: :truncate - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"uU" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"cC" and b5 in ~c"aA" and b6 in ~c"pP" and - b7 in ~c"eE", do: :uescape - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"uU" and b2 in ~c"nN" and b3 in ~c"iI" and b4 in ~c"oO" and b5 in ~c"nN", do: :union - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"uU" and b2 in ~c"nN" and b3 in ~c"iI" and b4 in ~c"qQ" and b5 in ~c"uU" and b6 in ~c"eE", do: :unique - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"uU" and b2 in ~c"nN" and b3 in ~c"kK" and b4 in ~c"nN" and b5 in ~c"oO" and b6 in ~c"wW" and - b7 in ~c"nN", do: :unknown - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"uU" and b2 in ~c"nN" and b3 in ~c"nN" and b4 in ~c"eE" and b5 in ~c"sS" and b6 in ~c"tT", do: :unnest - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"uU" and b2 in ~c"pP" and b3 in ~c"dD" and b4 in ~c"aA" and b5 in ~c"tT" and b6 in ~c"eE", do: :update - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"uU" and b2 in ~c"pP" and b3 in ~c"pP" and b4 in ~c"eE" and b5 in ~c"rR", do: :upper - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"uU" and b2 in ~c"sS" and b3 in ~c"eE" and b4 in ~c"rR", do: :user - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"uU" and b2 in ~c"sS" and b3 in ~c"iI" and b4 in ~c"nN" and b5 in ~c"gG", do: :using - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"vV" and b2 in ~c"aA" and b3 in ~c"lL" and b4 in ~c"uU" and b5 in ~c"eE", do: :value - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"vV" and b2 in ~c"aA" and b3 in ~c"lL" and b4 in ~c"uU" and b5 in ~c"eE" and b6 in ~c"sS", do: :values - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"vV" and b2 in ~c"aA" and b3 in ~c"lL" and b4 in ~c"uU" and b5 in ~c"eE" and b6 in ~c"_" and - b7 in ~c"oO" and b8 in ~c"fF", do: :value_of - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"vV" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"_" and b5 in ~c"pP" and b6 in ~c"oO" and - b7 in ~c"pP", do: :var_pop - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"vV" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"_" and b5 in ~c"sS" and b6 in ~c"aA" and - b7 in ~c"mM" and b8 in ~c"pP", do: :var_samp - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"vV" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"bB" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"aA" and b8 in ~c"rR" and b9 in ~c"yY", do: :varbinary - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"vV" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"cC" and b5 in ~c"hH" and b6 in ~c"aA" and - b7 in ~c"rR", do: :varchar - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"vV" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"yY" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"gG", do: :varying - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"vV" and b2 in ~c"eE" and b3 in ~c"rR" and b4 in ~c"sS" and b5 in ~c"iI" and b6 in ~c"oO" and - b7 in ~c"nN" and b8 in ~c"iI" and b9 in ~c"nN" and b10 in ~c"gG", do: :versioning - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"wW" and b2 in ~c"hH" and b3 in ~c"eE" and b4 in ~c"nN", do: :when - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"wW" and b2 in ~c"hH" and b3 in ~c"eE" and b4 in ~c"nN" and b5 in ~c"eE" and b6 in ~c"vV" and - b7 in ~c"eE" and b8 in ~c"rR", do: :whenever - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"wW" and b2 in ~c"hH" and b3 in ~c"eE" and b4 in ~c"rR" and b5 in ~c"eE", do: :where - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"wW" and b2 in ~c"iI" and b3 in ~c"dD" and b4 in ~c"tT" and b5 in ~c"hH" and b6 in ~c"_" and - b7 in ~c"bB" and b8 in ~c"uU" and b9 in ~c"cC" and b10 in ~c"kK" and b11 in ~c"eE" and - b12 in ~c"tT", do: :width_bucket - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"wW" and b2 in ~c"iI" and b3 in ~c"nN" and b4 in ~c"dD" and b5 in ~c"oO" and b6 in ~c"wW", do: :window - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"wW" and b2 in ~c"iI" and b3 in ~c"tT" and b4 in ~c"hH", do: :with - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"wW" and b2 in ~c"iI" and b3 in ~c"tT" and b4 in ~c"hH" and b5 in ~c"iI" and b6 in ~c"nN", do: :within - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"wW" and b2 in ~c"iI" and b3 in ~c"tT" and b4 in ~c"hH" and b5 in ~c"oO" and b6 in ~c"uU" and - b7 in ~c"tT", do: :without - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"yY" and b2 in ~c"eE" and b3 in ~c"aA" and b4 in ~c"rR", do: :year - - def ident(:ident, [[], b1]) when b1 in ~c"aA", do: :a - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"aA" and b2 in ~c"bB" and b3 in ~c"sS" and b4 in ~c"oO" and b5 in ~c"lL" and b6 in ~c"uU" and - b7 in ~c"tT" and b8 in ~c"eE", do: :absolute - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"aA" and b2 in ~c"cC" and b3 in ~c"tT" and b4 in ~c"iI" and b5 in ~c"oO" and b6 in ~c"nN", do: :action - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"aA" and b2 in ~c"dD" and b3 in ~c"aA", do: :ada - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"aA" and b2 in ~c"dD" and b3 in ~c"dD", do: :add - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"aA" and b2 in ~c"dD" and b3 in ~c"mM" and b4 in ~c"iI" and b5 in ~c"nN", do: :admin - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"aA" and b2 in ~c"fF" and b3 in ~c"tT" and b4 in ~c"eE" and b5 in ~c"rR", do: :after - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"aA" and b2 in ~c"lL" and b3 in ~c"wW" and b4 in ~c"aA" and b5 in ~c"yY" and b6 in ~c"sS", do: :always - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"aA" and b2 in ~c"sS" and b3 in ~c"cC", do: :asc - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"aA" and b2 in ~c"sS" and b3 in ~c"sS" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"oO" and b9 in ~c"nN", do: :assertion - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"aA" and b2 in ~c"sS" and b3 in ~c"sS" and b4 in ~c"iI" and b5 in ~c"gG" and b6 in ~c"nN" and - b7 in ~c"mM" and b8 in ~c"eE" and b9 in ~c"nN" and b10 in ~c"tT", do: :assignment - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"aA" and b2 in ~c"tT" and b3 in ~c"tT" and b4 in ~c"rR" and b5 in ~c"iI" and b6 in ~c"bB" and - b7 in ~c"uU" and b8 in ~c"tT" and b9 in ~c"eE", do: :attribute - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"aA" and b2 in ~c"tT" and b3 in ~c"tT" and b4 in ~c"rR" and b5 in ~c"iI" and b6 in ~c"bB" and - b7 in ~c"uU" and b8 in ~c"tT" and b9 in ~c"eE" and b10 in ~c"sS", do: :attributes - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"bB" and b2 in ~c"eE" and b3 in ~c"fF" and b4 in ~c"oO" and b5 in ~c"rR" and b6 in ~c"eE", do: :before - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"bB" and b2 in ~c"eE" and b3 in ~c"rR" and b4 in ~c"nN" and b5 in ~c"oO" and b6 in ~c"uU" and - b7 in ~c"lL" and b8 in ~c"lL" and b9 in ~c"iI", do: :bernoulli - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"bB" and b2 in ~c"rR" and b3 in ~c"eE" and b4 in ~c"aA" and b5 in ~c"dD" and b6 in ~c"tT" and - b7 in ~c"hH", do: :breadth - - def ident(:ident, [[], b1]) when b1 in ~c"cC", do: :c - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"cC" and b2 in ~c"aA" and b3 in ~c"sS" and b4 in ~c"cC" and b5 in ~c"aA" and b6 in ~c"dD" and - b7 in ~c"eE", do: :cascade - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"cC" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"aA" and b5 in ~c"lL" and b6 in ~c"oO" and - b7 in ~c"gG", do: :catalog - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"cC" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"aA" and b5 in ~c"lL" and b6 in ~c"oO" and - b7 in ~c"gG" and b8 in ~c"_" and b9 in ~c"nN" and b10 in ~c"aA" and b11 in ~c"mM" and - b12 in ~c"eE", do: :catalog_name - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"cC" and b2 in ~c"hH" and b3 in ~c"aA" and b4 in ~c"iI" and b5 in ~c"nN", do: :chain - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"cC" and b2 in ~c"hH" and b3 in ~c"aA" and b4 in ~c"iI" and b5 in ~c"nN" and b6 in ~c"iI" and - b7 in ~c"nN" and b8 in ~c"gG", do: :chaining - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21]) when b1 in ~c"cC" and b2 in ~c"hH" and b3 in ~c"aA" and b4 in ~c"rR" and b5 in ~c"aA" and b6 in ~c"cC" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"rR" and b10 in ~c"_" and b11 in ~c"sS" and - b12 in ~c"eE" and b13 in ~c"tT" and b14 in ~c"_" and b15 in ~c"cC" and b16 in ~c"aA" and - b17 in ~c"tT" and b18 in ~c"aA" and b19 in ~c"lL" and b20 in ~c"oO" and b21 in ~c"gG", do: :character_set_catalog - - def ident(:ident, [[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18]) when b1 in ~c"cC" and b2 in ~c"hH" and b3 in ~c"aA" and b4 in ~c"rR" and b5 in ~c"aA" and b6 in ~c"cC" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"rR" and b10 in ~c"_" and b11 in ~c"sS" and - b12 in ~c"eE" and b13 in ~c"tT" and b14 in ~c"_" and b15 in ~c"nN" and b16 in ~c"aA" and - b17 in ~c"mM" and b18 in ~c"eE", do: :character_set_name - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20]) when b1 in ~c"cC" and b2 in ~c"hH" and b3 in ~c"aA" and b4 in ~c"rR" and b5 in ~c"aA" and b6 in ~c"cC" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"rR" and b10 in ~c"_" and b11 in ~c"sS" and - b12 in ~c"eE" and b13 in ~c"tT" and b14 in ~c"_" and b15 in ~c"sS" and b16 in ~c"cC" and - b17 in ~c"hH" and b18 in ~c"eE" and b19 in ~c"mM" and b20 in ~c"aA", do: :character_set_schema - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"cC" and b2 in ~c"hH" and b3 in ~c"aA" and b4 in ~c"rR" and b5 in ~c"aA" and b6 in ~c"cC" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"rR" and b10 in ~c"iI" and b11 in ~c"sS" and - b12 in ~c"tT" and b13 in ~c"iI" and b14 in ~c"cC" and b15 in ~c"sS", do: :characteristics - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"cC" and b2 in ~c"hH" and b3 in ~c"aA" and b4 in ~c"rR" and b5 in ~c"aA" and b6 in ~c"cC" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"rR" and b10 in ~c"sS", do: :characters - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"cC" and b2 in ~c"lL" and b3 in ~c"aA" and b4 in ~c"sS" and b5 in ~c"sS" and b6 in ~c"_" and - b7 in ~c"oO" and b8 in ~c"rR" and b9 in ~c"iI" and b10 in ~c"gG" and b11 in ~c"iI" and - b12 in ~c"nN", do: :class_origin - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"bB" and b4 in ~c"oO" and b5 in ~c"lL", do: :cobol - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"lL" and b4 in ~c"lL" and b5 in ~c"aA" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"oO" and b9 in ~c"nN", do: :collation - - def ident(:ident, [[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"lL" and b4 in ~c"lL" and b5 in ~c"aA" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"oO" and b9 in ~c"nN" and b10 in ~c"_" and b11 in ~c"cC" and - b12 in ~c"aA" and b13 in ~c"tT" and b14 in ~c"aA" and b15 in ~c"lL" and b16 in ~c"oO" and - b17 in ~c"gG", do: :collation_catalog - - def ident(:ident, [[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"lL" and b4 in ~c"lL" and b5 in ~c"aA" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"oO" and b9 in ~c"nN" and b10 in ~c"_" and b11 in ~c"nN" and - b12 in ~c"aA" and b13 in ~c"mM" and b14 in ~c"eE", do: :collation_name - - def ident(:ident, [[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"lL" and b4 in ~c"lL" and b5 in ~c"aA" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"oO" and b9 in ~c"nN" and b10 in ~c"_" and b11 in ~c"sS" and - b12 in ~c"cC" and b13 in ~c"hH" and b14 in ~c"eE" and b15 in ~c"mM" and b16 in ~c"aA", do: :collation_schema - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"lL" and b4 in ~c"uU" and b5 in ~c"mM" and b6 in ~c"nN" and - b7 in ~c"sS", do: :columns - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"lL" and b4 in ~c"uU" and b5 in ~c"mM" and b6 in ~c"nN" and - b7 in ~c"_" and b8 in ~c"nN" and b9 in ~c"aA" and b10 in ~c"mM" and b11 in ~c"eE", do: :column_name - - def ident(:ident, [[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"mM" and b4 in ~c"mM" and b5 in ~c"aA" and b6 in ~c"nN" and - b7 in ~c"dD" and b8 in ~c"_" and b9 in ~c"fF" and b10 in ~c"uU" and b11 in ~c"nN" and - b12 in ~c"cC" and b13 in ~c"tT" and b14 in ~c"iI" and b15 in ~c"oO" and b16 in ~c"nN", do: :command_function - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"mM" and b4 in ~c"mM" and b5 in ~c"aA" and b6 in ~c"nN" and - b7 in ~c"dD" and b8 in ~c"_" and b9 in ~c"fF" and b10 in ~c"uU" and b11 in ~c"nN" and - b12 in ~c"cC" and b13 in ~c"tT" and b14 in ~c"iI" and b15 in ~c"oO" and b16 in ~c"nN" and - b17 in ~c"_" and b18 in ~c"cC" and b19 in ~c"oO" and b20 in ~c"dD" and b21 in ~c"eE", do: :command_function_code - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"mM" and b4 in ~c"mM" and b5 in ~c"iI" and b6 in ~c"tT" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"dD", do: :committed - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"dD" and b5 in ~c"iI" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"oO" and b9 in ~c"nN" and b10 in ~c"aA" and b11 in ~c"lL", do: :conditional - - def ident(:ident, [[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"dD" and b5 in ~c"iI" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"oO" and b9 in ~c"nN" and b10 in ~c"_" and b11 in ~c"nN" and - b12 in ~c"uU" and b13 in ~c"mM" and b14 in ~c"bB" and b15 in ~c"eE" and b16 in ~c"rR", do: :condition_number - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"nN" and b5 in ~c"eE" and b6 in ~c"cC" and - b7 in ~c"tT" and b8 in ~c"iI" and b9 in ~c"oO" and b10 in ~c"nN", do: :connection - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"nN" and b5 in ~c"eE" and b6 in ~c"cC" and - b7 in ~c"tT" and b8 in ~c"iI" and b9 in ~c"oO" and b10 in ~c"nN" and b11 in ~c"_" and - b12 in ~c"nN" and b13 in ~c"aA" and b14 in ~c"mM" and b15 in ~c"eE", do: :connection_name - - def ident(:ident, [[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"sS" and b5 in ~c"tT" and b6 in ~c"rR" and - b7 in ~c"aA" and b8 in ~c"iI" and b9 in ~c"nN" and b10 in ~c"tT" and b11 in ~c"_" and - b12 in ~c"cC" and b13 in ~c"aA" and b14 in ~c"tT" and b15 in ~c"aA" and b16 in ~c"lL" and - b17 in ~c"oO" and b18 in ~c"gG", do: :constraint_catalog - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"sS" and b5 in ~c"tT" and b6 in ~c"rR" and - b7 in ~c"aA" and b8 in ~c"iI" and b9 in ~c"nN" and b10 in ~c"tT" and b11 in ~c"_" and - b12 in ~c"nN" and b13 in ~c"aA" and b14 in ~c"mM" and b15 in ~c"eE", do: :constraint_name - - def ident(:ident, [[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"sS" and b5 in ~c"tT" and b6 in ~c"rR" and - b7 in ~c"aA" and b8 in ~c"iI" and b9 in ~c"nN" and b10 in ~c"tT" and b11 in ~c"_" and - b12 in ~c"sS" and b13 in ~c"cC" and b14 in ~c"hH" and b15 in ~c"eE" and b16 in ~c"mM" and - b17 in ~c"aA", do: :constraint_schema - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"sS" and b5 in ~c"tT" and b6 in ~c"rR" and - b7 in ~c"aA" and b8 in ~c"iI" and b9 in ~c"nN" and b10 in ~c"tT" and b11 in ~c"sS", do: :constraints - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"sS" and b5 in ~c"tT" and b6 in ~c"rR" and - b7 in ~c"uU" and b8 in ~c"cC" and b9 in ~c"tT" and b10 in ~c"oO" and b11 in ~c"rR", do: :constructor - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"uU" and b8 in ~c"eE", do: :continue - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"cC" and b2 in ~c"oO" and b3 in ~c"pP" and b4 in ~c"aA" and b5 in ~c"rR" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"tT" and b9 in ~c"iI" and b10 in ~c"oO" and b11 in ~c"nN", do: :copartition - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"cC" and b2 in ~c"uU" and b3 in ~c"rR" and b4 in ~c"sS" and b5 in ~c"oO" and b6 in ~c"rR" and - b7 in ~c"_" and b8 in ~c"nN" and b9 in ~c"aA" and b10 in ~c"mM" and b11 in ~c"eE", do: :cursor_name - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"dD" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"aA", do: :data - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22]) when b1 in ~c"dD" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"eE" and b5 in ~c"tT" and b6 in ~c"iI" and - b7 in ~c"mM" and b8 in ~c"eE" and b9 in ~c"_" and b10 in ~c"iI" and b11 in ~c"nN" and - b12 in ~c"tT" and b13 in ~c"eE" and b14 in ~c"rR" and b15 in ~c"vV" and b16 in ~c"aA" and - b17 in ~c"lL" and b18 in ~c"_" and b19 in ~c"cC" and b20 in ~c"oO" and b21 in ~c"dD" and - b22 in ~c"eE", do: :datetime_interval_code - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24], b25], b26], b27]) when b1 in ~c"dD" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"eE" and b5 in ~c"tT" and b6 in ~c"iI" and - b7 in ~c"mM" and b8 in ~c"eE" and b9 in ~c"_" and b10 in ~c"iI" and b11 in ~c"nN" and - b12 in ~c"tT" and b13 in ~c"eE" and b14 in ~c"rR" and b15 in ~c"vV" and b16 in ~c"aA" and - b17 in ~c"lL" and b18 in ~c"_" and b19 in ~c"pP" and b20 in ~c"rR" and b21 in ~c"eE" and - b22 in ~c"cC" and b23 in ~c"iI" and b24 in ~c"sS" and b25 in ~c"iI" and b26 in ~c"oO" and - b27 in ~c"nN", do: :datetime_interval_precision - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"fF" and b4 in ~c"aA" and b5 in ~c"uU" and b6 in ~c"lL" and - b7 in ~c"tT" and b8 in ~c"sS", do: :defaults - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"fF" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"rR" and - b7 in ~c"aA" and b8 in ~c"bB" and b9 in ~c"lL" and b10 in ~c"eE", do: :deferrable - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"fF" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"rR" and - b7 in ~c"eE" and b8 in ~c"dD", do: :deferred - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"fF" and b4 in ~c"iI" and b5 in ~c"nN" and b6 in ~c"eE" and - b7 in ~c"dD", do: :defined - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"fF" and b4 in ~c"iI" and b5 in ~c"nN" and b6 in ~c"eE" and - b7 in ~c"rR", do: :definer - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"gG" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"eE", do: :degree - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"pP" and b4 in ~c"tT" and b5 in ~c"hH", do: :depth - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"rR" and b4 in ~c"iI" and b5 in ~c"vV" and b6 in ~c"eE" and - b7 in ~c"dD", do: :derived - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"cC", do: :desc - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"dD" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"cC" and b5 in ~c"rR" and b6 in ~c"iI" and - b7 in ~c"pP" and b8 in ~c"tT" and b9 in ~c"oO" and b10 in ~c"rR", do: :descriptor - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"dD" and b2 in ~c"iI" and b3 in ~c"aA" and b4 in ~c"gG" and b5 in ~c"nN" and b6 in ~c"oO" and - b7 in ~c"sS" and b8 in ~c"tT" and b9 in ~c"iI" and b10 in ~c"cC" and b11 in ~c"sS", do: :diagnostics - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"dD" and b2 in ~c"iI" and b3 in ~c"sS" and b4 in ~c"pP" and b5 in ~c"aA" and b6 in ~c"tT" and - b7 in ~c"cC" and b8 in ~c"hH", do: :dispatch - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"dD" and b2 in ~c"oO" and b3 in ~c"mM" and b4 in ~c"aA" and b5 in ~c"iI" and b6 in ~c"nN", do: :domain - - def ident(:ident, [[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16]) when b1 in ~c"dD" and b2 in ~c"yY" and b3 in ~c"nN" and b4 in ~c"aA" and b5 in ~c"mM" and b6 in ~c"iI" and - b7 in ~c"cC" and b8 in ~c"_" and b9 in ~c"fF" and b10 in ~c"uU" and b11 in ~c"nN" and - b12 in ~c"cC" and b13 in ~c"tT" and b14 in ~c"iI" and b15 in ~c"oO" and b16 in ~c"nN", do: :dynamic_function - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21]) when b1 in ~c"dD" and b2 in ~c"yY" and b3 in ~c"nN" and b4 in ~c"aA" and b5 in ~c"mM" and b6 in ~c"iI" and - b7 in ~c"cC" and b8 in ~c"_" and b9 in ~c"fF" and b10 in ~c"uU" and b11 in ~c"nN" and - b12 in ~c"cC" and b13 in ~c"tT" and b14 in ~c"iI" and b15 in ~c"oO" and b16 in ~c"nN" and - b17 in ~c"_" and b18 in ~c"cC" and b19 in ~c"oO" and b20 in ~c"dD" and b21 in ~c"eE", do: :dynamic_function_code - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"eE" and b2 in ~c"nN" and b3 in ~c"cC" and b4 in ~c"oO" and b5 in ~c"dD" and b6 in ~c"iI" and - b7 in ~c"nN" and b8 in ~c"gG", do: :encoding - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"eE" and b2 in ~c"nN" and b3 in ~c"fF" and b4 in ~c"oO" and b5 in ~c"rR" and b6 in ~c"cC" and - b7 in ~c"eE" and b8 in ~c"dD", do: :enforced - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"eE" and b2 in ~c"rR" and b3 in ~c"rR" and b4 in ~c"oO" and b5 in ~c"rR", do: :error - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"eE" and b2 in ~c"xX" and b3 in ~c"cC" and b4 in ~c"lL" and b5 in ~c"uU" and b6 in ~c"dD" and - b7 in ~c"eE", do: :exclude - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"eE" and b2 in ~c"xX" and b3 in ~c"cC" and b4 in ~c"lL" and b5 in ~c"uU" and b6 in ~c"dD" and - b7 in ~c"iI" and b8 in ~c"nN" and b9 in ~c"gG", do: :excluding - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"eE" and b2 in ~c"xX" and b3 in ~c"pP" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"sS" and - b7 in ~c"sS" and b8 in ~c"iI" and b9 in ~c"oO" and b10 in ~c"nN", do: :expression - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"fF" and b2 in ~c"iI" and b3 in ~c"nN" and b4 in ~c"aA" and b5 in ~c"lL", do: :final - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"fF" and b2 in ~c"iI" and b3 in ~c"nN" and b4 in ~c"iI" and b5 in ~c"sS" and b6 in ~c"hH", do: :finish - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"fF" and b2 in ~c"iI" and b3 in ~c"rR" and b4 in ~c"sS" and b5 in ~c"tT", do: :first - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"fF" and b2 in ~c"lL" and b3 in ~c"aA" and b4 in ~c"gG", do: :flag - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"fF" and b2 in ~c"oO" and b3 in ~c"lL" and b4 in ~c"lL" and b5 in ~c"oO" and b6 in ~c"wW" and - b7 in ~c"iI" and b8 in ~c"nN" and b9 in ~c"gG", do: :following - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"fF" and b2 in ~c"oO" and b3 in ~c"rR" and b4 in ~c"mM" and b5 in ~c"aA" and b6 in ~c"tT", do: :format - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"fF" and b2 in ~c"oO" and b3 in ~c"rR" and b4 in ~c"tT" and b5 in ~c"rR" and b6 in ~c"aA" and - b7 in ~c"nN", do: :fortran - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"fF" and b2 in ~c"oO" and b3 in ~c"uU" and b4 in ~c"nN" and b5 in ~c"dD", do: :found - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"fF" and b2 in ~c"uU" and b3 in ~c"lL" and b4 in ~c"fF" and b5 in ~c"iI" and b6 in ~c"lL" and - b7 in ~c"lL", do: :fulfill - - def ident(:ident, [[], b1]) when b1 in ~c"gG", do: :g - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"gG" and b2 in ~c"eE" and b3 in ~c"nN" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"aA" and - b7 in ~c"lL", do: :general - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"gG" and b2 in ~c"eE" and b3 in ~c"nN" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"aA" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"dD", do: :generated - - def ident(:ident, [[[], b1], b2]) when b1 in ~c"gG" and b2 in ~c"oO", do: :go - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"gG" and b2 in ~c"oO" and b3 in ~c"tT" and b4 in ~c"oO", do: :goto - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"gG" and b2 in ~c"rR" and b3 in ~c"aA" and b4 in ~c"nN" and b5 in ~c"tT" and b6 in ~c"eE" and - b7 in ~c"dD", do: :granted - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"hH" and b2 in ~c"iI" and b3 in ~c"eE" and b4 in ~c"rR" and b5 in ~c"aA" and b6 in ~c"rR" and - b7 in ~c"cC" and b8 in ~c"hH" and b9 in ~c"yY", do: :hierarchy - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"iI" and b2 in ~c"gG" and b3 in ~c"nN" and b4 in ~c"oO" and b5 in ~c"rR" and b6 in ~c"eE", do: :ignore - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"iI" and b2 in ~c"mM" and b3 in ~c"mM" and b4 in ~c"eE" and b5 in ~c"dD" and b6 in ~c"iI" and - b7 in ~c"aA" and b8 in ~c"tT" and b9 in ~c"eE", do: :immediate - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"iI" and b2 in ~c"mM" and b3 in ~c"mM" and b4 in ~c"eE" and b5 in ~c"dD" and b6 in ~c"iI" and - b7 in ~c"aA" and b8 in ~c"tT" and b9 in ~c"eE" and b10 in ~c"lL" and b11 in ~c"yY", do: :immediately - - def ident(:ident, [[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when b1 in ~c"iI" and b2 in ~c"mM" and b3 in ~c"pP" and b4 in ~c"lL" and b5 in ~c"eE" and b6 in ~c"mM" and - b7 in ~c"eE" and b8 in ~c"nN" and b9 in ~c"tT" and b10 in ~c"aA" and b11 in ~c"tT" and - b12 in ~c"iI" and b13 in ~c"oO" and b14 in ~c"nN", do: :implementation - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"cC" and b4 in ~c"lL" and b5 in ~c"uU" and b6 in ~c"dD" and - b7 in ~c"iI" and b8 in ~c"nN" and b9 in ~c"gG", do: :including - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"cC" and b4 in ~c"rR" and b5 in ~c"eE" and b6 in ~c"mM" and - b7 in ~c"eE" and b8 in ~c"nN" and b9 in ~c"tT", do: :increment - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"iI" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"aA" and - b7 in ~c"lL" and b8 in ~c"lL" and b9 in ~c"yY", do: :initially - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"pP" and b4 in ~c"uU" and b5 in ~c"tT", do: :input - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"sS" and b4 in ~c"tT" and b5 in ~c"aA" and b6 in ~c"nN" and - b7 in ~c"cC" and b8 in ~c"eE", do: :instance - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"sS" and b4 in ~c"tT" and b5 in ~c"aA" and b6 in ~c"nN" and - b7 in ~c"tT" and b8 in ~c"iI" and b9 in ~c"aA" and b10 in ~c"bB" and b11 in ~c"lL" and - b12 in ~c"eE", do: :instantiable - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"sS" and b4 in ~c"tT" and b5 in ~c"eE" and b6 in ~c"aA" and - b7 in ~c"dD", do: :instead - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"iI" and b2 in ~c"nN" and b3 in ~c"vV" and b4 in ~c"oO" and b5 in ~c"kK" and b6 in ~c"eE" and - b7 in ~c"rR", do: :invoker - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"iI" and b2 in ~c"sS" and b3 in ~c"oO" and b4 in ~c"lL" and b5 in ~c"aA" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"oO" and b9 in ~c"nN", do: :isolation - - def ident(:ident, [[], b1]) when b1 in ~c"kK", do: :k - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"kK" and b2 in ~c"eE" and b3 in ~c"eE" and b4 in ~c"pP", do: :keep - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"kK" and b2 in ~c"eE" and b3 in ~c"yY", do: :key - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"kK" and b2 in ~c"eE" and b3 in ~c"yY" and b4 in ~c"sS", do: :keys - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"kK" and b2 in ~c"eE" and b3 in ~c"yY" and b4 in ~c"_" and b5 in ~c"mM" and b6 in ~c"eE" and - b7 in ~c"mM" and b8 in ~c"bB" and b9 in ~c"eE" and b10 in ~c"rR", do: :key_member - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"kK" and b2 in ~c"eE" and b3 in ~c"yY" and b4 in ~c"_" and b5 in ~c"tT" and b6 in ~c"yY" and - b7 in ~c"pP" and b8 in ~c"eE", do: :key_type - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"lL" and b2 in ~c"aA" and b3 in ~c"sS" and b4 in ~c"tT", do: :last - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"lL" and b2 in ~c"eE" and b3 in ~c"nN" and b4 in ~c"gG" and b5 in ~c"tT" and b6 in ~c"hH", do: :length - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"lL" and b2 in ~c"eE" and b3 in ~c"vV" and b4 in ~c"eE" and b5 in ~c"lL", do: :level - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"lL" and b2 in ~c"oO" and b3 in ~c"cC" and b4 in ~c"aA" and b5 in ~c"tT" and b6 in ~c"oO" and - b7 in ~c"rR", do: :locator - - def ident(:ident, [[], b1]) when b1 in ~c"mM", do: :m - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"mM" and b2 in ~c"aA" and b3 in ~c"pP", do: :map - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"mM" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"cC" and b5 in ~c"hH" and b6 in ~c"eE" and - b7 in ~c"dD", do: :matched - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"mM" and b2 in ~c"aA" and b3 in ~c"xX" and b4 in ~c"vV" and b5 in ~c"aA" and b6 in ~c"lL" and - b7 in ~c"uU" and b8 in ~c"eE", do: :maxvalue - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"mM" and b2 in ~c"eE" and b3 in ~c"aA" and b4 in ~c"sS" and b5 in ~c"uU" and b6 in ~c"rR" and - b7 in ~c"eE" and b8 in ~c"sS", do: :measures - - def ident(:ident, [[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when b1 in ~c"mM" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"sS" and b5 in ~c"aA" and b6 in ~c"gG" and - b7 in ~c"eE" and b8 in ~c"_" and b9 in ~c"lL" and b10 in ~c"eE" and b11 in ~c"nN" and - b12 in ~c"gG" and b13 in ~c"tT" and b14 in ~c"hH", do: :message_length - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20]) when b1 in ~c"mM" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"sS" and b5 in ~c"aA" and b6 in ~c"gG" and - b7 in ~c"eE" and b8 in ~c"_" and b9 in ~c"oO" and b10 in ~c"cC" and b11 in ~c"tT" and - b12 in ~c"eE" and b13 in ~c"tT" and b14 in ~c"_" and b15 in ~c"lL" and b16 in ~c"eE" and - b17 in ~c"nN" and b18 in ~c"gG" and b19 in ~c"tT" and b20 in ~c"hH", do: :message_octet_length - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"mM" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"sS" and b5 in ~c"aA" and b6 in ~c"gG" and - b7 in ~c"eE" and b8 in ~c"_" and b9 in ~c"tT" and b10 in ~c"eE" and b11 in ~c"xX" and - b12 in ~c"tT", do: :message_text - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"mM" and b2 in ~c"iI" and b3 in ~c"nN" and b4 in ~c"vV" and b5 in ~c"aA" and b6 in ~c"lL" and - b7 in ~c"uU" and b8 in ~c"eE", do: :minvalue - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"mM" and b2 in ~c"oO" and b3 in ~c"rR" and b4 in ~c"eE", do: :more - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"mM" and b2 in ~c"uU" and b3 in ~c"mM" and b4 in ~c"pP" and b5 in ~c"sS", do: :mumps - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"nN" and b2 in ~c"aA" and b3 in ~c"mM" and b4 in ~c"eE", do: :name - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"nN" and b2 in ~c"aA" and b3 in ~c"mM" and b4 in ~c"eE" and b5 in ~c"sS", do: :names - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"nN" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"tT" and b5 in ~c"eE" and b6 in ~c"dD", do: :nested - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"nN" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"gG", do: :nesting - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"nN" and b2 in ~c"eE" and b3 in ~c"xX" and b4 in ~c"tT", do: :next - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"nN" and b2 in ~c"fF" and b3 in ~c"cC", do: :nfc - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"nN" and b2 in ~c"fF" and b3 in ~c"dD", do: :nfd - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"nN" and b2 in ~c"fF" and b3 in ~c"kK" and b4 in ~c"cC", do: :nfkc - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"nN" and b2 in ~c"fF" and b3 in ~c"kK" and b4 in ~c"dD", do: :nfkd - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"nN" and b2 in ~c"oO" and b3 in ~c"rR" and b4 in ~c"mM" and b5 in ~c"aA" and b6 in ~c"lL" and - b7 in ~c"iI" and b8 in ~c"zZ" and b9 in ~c"eE" and b10 in ~c"dD", do: :normalized - - def ident(:ident, [[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when b1 in ~c"nN" and b2 in ~c"uU" and b3 in ~c"lL" and b4 in ~c"lL" and b5 in ~c"_" and b6 in ~c"oO" and - b7 in ~c"rR" and b8 in ~c"dD" and b9 in ~c"eE" and b10 in ~c"rR" and b11 in ~c"iI" and - b12 in ~c"nN" and b13 in ~c"gG", do: :null_ordering - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"nN" and b2 in ~c"uU" and b3 in ~c"lL" and b4 in ~c"lL" and b5 in ~c"aA" and b6 in ~c"bB" and - b7 in ~c"lL" and b8 in ~c"eE", do: :nullable - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"nN" and b2 in ~c"uU" and b3 in ~c"lL" and b4 in ~c"lL" and b5 in ~c"sS", do: :nulls - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"nN" and b2 in ~c"uU" and b3 in ~c"mM" and b4 in ~c"bB" and b5 in ~c"eE" and b6 in ~c"rR", do: :number - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"oO" and b2 in ~c"bB" and b3 in ~c"jJ" and b4 in ~c"eE" and b5 in ~c"cC" and b6 in ~c"tT", do: :object - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"oO" and b2 in ~c"cC" and b3 in ~c"cC" and b4 in ~c"uU" and b5 in ~c"rR" and b6 in ~c"rR" and - b7 in ~c"eE" and b8 in ~c"nN" and b9 in ~c"cC" and b10 in ~c"eE", do: :occurrence - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"oO" and b2 in ~c"cC" and b3 in ~c"tT" and b4 in ~c"eE" and b5 in ~c"tT" and b6 in ~c"sS", do: :octets - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"oO" and b2 in ~c"pP" and b3 in ~c"tT" and b4 in ~c"iI" and b5 in ~c"oO" and b6 in ~c"nN", do: :option - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"oO" and b2 in ~c"pP" and b3 in ~c"tT" and b4 in ~c"iI" and b5 in ~c"oO" and b6 in ~c"nN" and - b7 in ~c"sS", do: :options - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"oO" and b2 in ~c"rR" and b3 in ~c"dD" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"iI" and - b7 in ~c"nN" and b8 in ~c"gG", do: :ordering - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"oO" and b2 in ~c"rR" and b3 in ~c"dD" and b4 in ~c"iI" and b5 in ~c"nN" and b6 in ~c"aA" and - b7 in ~c"lL" and b8 in ~c"iI" and b9 in ~c"tT" and b10 in ~c"yY", do: :ordinality - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"oO" and b2 in ~c"tT" and b3 in ~c"hH" and b4 in ~c"eE" and b5 in ~c"rR" and b6 in ~c"sS", do: :others - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"oO" and b2 in ~c"uU" and b3 in ~c"tT" and b4 in ~c"pP" and b5 in ~c"uU" and b6 in ~c"tT", do: :output - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"oO" and b2 in ~c"vV" and b3 in ~c"eE" and b4 in ~c"rR" and b5 in ~c"fF" and b6 in ~c"lL" and - b7 in ~c"oO" and b8 in ~c"wW", do: :overflow - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"oO" and b2 in ~c"vV" and b3 in ~c"eE" and b4 in ~c"rR" and b5 in ~c"rR" and b6 in ~c"iI" and - b7 in ~c"dD" and b8 in ~c"iI" and b9 in ~c"nN" and b10 in ~c"gG", do: :overriding - - def ident(:ident, [[], b1]) when b1 in ~c"pP", do: :p - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"dD", do: :pad - - def ident(:ident, [[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"aA" and b5 in ~c"mM" and b6 in ~c"eE" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"rR" and b10 in ~c"_" and b11 in ~c"mM" and - b12 in ~c"oO" and b13 in ~c"dD" and b14 in ~c"eE", do: :parameter_mode - - def ident(:ident, [[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"aA" and b5 in ~c"mM" and b6 in ~c"eE" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"rR" and b10 in ~c"_" and b11 in ~c"nN" and - b12 in ~c"aA" and b13 in ~c"mM" and b14 in ~c"eE", do: :parameter_name - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24], b25], b26]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"aA" and b5 in ~c"mM" and b6 in ~c"eE" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"rR" and b10 in ~c"_" and b11 in ~c"oO" and - b12 in ~c"rR" and b13 in ~c"dD" and b14 in ~c"iI" and b15 in ~c"nN" and b16 in ~c"aA" and - b17 in ~c"lL" and b18 in ~c"_" and b19 in ~c"pP" and b20 in ~c"oO" and b21 in ~c"sS" and - b22 in ~c"iI" and b23 in ~c"tT" and b24 in ~c"iI" and b25 in ~c"oO" and b26 in ~c"nN", do: :parameter_ordinal_position - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24], b25], b26]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"aA" and b5 in ~c"mM" and b6 in ~c"eE" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"rR" and b10 in ~c"_" and b11 in ~c"sS" and - b12 in ~c"pP" and b13 in ~c"eE" and b14 in ~c"cC" and b15 in ~c"iI" and b16 in ~c"fF" and - b17 in ~c"iI" and b18 in ~c"cC" and b19 in ~c"_" and b20 in ~c"cC" and b21 in ~c"aA" and - b22 in ~c"tT" and b23 in ~c"aA" and b24 in ~c"lL" and b25 in ~c"oO" and b26 in ~c"gG", do: :parameter_specific_catalog - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"aA" and b5 in ~c"mM" and b6 in ~c"eE" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"rR" and b10 in ~c"_" and b11 in ~c"sS" and - b12 in ~c"pP" and b13 in ~c"eE" and b14 in ~c"cC" and b15 in ~c"iI" and b16 in ~c"fF" and - b17 in ~c"iI" and b18 in ~c"cC" and b19 in ~c"_" and b20 in ~c"nN" and b21 in ~c"aA" and - b22 in ~c"mM" and b23 in ~c"eE", do: :parameter_specific_name - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24], b25]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"aA" and b5 in ~c"mM" and b6 in ~c"eE" and - b7 in ~c"tT" and b8 in ~c"eE" and b9 in ~c"rR" and b10 in ~c"_" and b11 in ~c"sS" and - b12 in ~c"pP" and b13 in ~c"eE" and b14 in ~c"cC" and b15 in ~c"iI" and b16 in ~c"fF" and - b17 in ~c"iI" and b18 in ~c"cC" and b19 in ~c"_" and b20 in ~c"sS" and b21 in ~c"cC" and - b22 in ~c"hH" and b23 in ~c"eE" and b24 in ~c"mM" and b25 in ~c"aA", do: :parameter_specific_schema - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"rR" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"aA" and - b7 in ~c"lL", do: :partial - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"sS" and b4 in ~c"cC" and b5 in ~c"aA" and b6 in ~c"lL", do: :pascal - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"sS" and b4 in ~c"sS", do: :pass - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"sS" and b4 in ~c"sS" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"gG", do: :passing - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"sS" and b4 in ~c"tT", do: :past - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"pP" and b2 in ~c"aA" and b3 in ~c"tT" and b4 in ~c"hH", do: :path - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"pP" and b2 in ~c"eE" and b3 in ~c"rR" and b4 in ~c"mM" and b5 in ~c"uU" and b6 in ~c"tT" and - b7 in ~c"eE", do: :permute - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"pP" and b2 in ~c"iI" and b3 in ~c"pP" and b4 in ~c"eE", do: :pipe - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"pP" and b2 in ~c"lL" and b3 in ~c"aA" and b4 in ~c"cC" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"gG", do: :placing - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"pP" and b2 in ~c"lL" and b3 in ~c"aA" and b4 in ~c"nN", do: :plan - - def ident(:ident, [[[[], b1], b2], b3]) when b1 in ~c"pP" and b2 in ~c"lL" and b3 in ~c"iI", do: :pli - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"pP" and b2 in ~c"rR" and b3 in ~c"eE" and b4 in ~c"cC" and b5 in ~c"eE" and b6 in ~c"dD" and - b7 in ~c"iI" and b8 in ~c"nN" and b9 in ~c"gG", do: :preceding - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"pP" and b2 in ~c"rR" and b3 in ~c"eE" and b4 in ~c"sS" and b5 in ~c"eE" and b6 in ~c"rR" and - b7 in ~c"vV" and b8 in ~c"eE", do: :preserve - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"pP" and b2 in ~c"rR" and b3 in ~c"eE" and b4 in ~c"vV", do: :prev - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"pP" and b2 in ~c"rR" and b3 in ~c"iI" and b4 in ~c"oO" and b5 in ~c"rR", do: :prior - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"pP" and b2 in ~c"rR" and b3 in ~c"iI" and b4 in ~c"vV" and b5 in ~c"aA" and b6 in ~c"tT" and - b7 in ~c"eE", do: :private - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"pP" and b2 in ~c"rR" and b3 in ~c"iI" and b4 in ~c"vV" and b5 in ~c"iI" and b6 in ~c"lL" and - b7 in ~c"eE" and b8 in ~c"gG" and b9 in ~c"eE" and b10 in ~c"sS", do: :privileges - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"pP" and b2 in ~c"rR" and b3 in ~c"uU" and b4 in ~c"nN" and b5 in ~c"eE", do: :prune - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"pP" and b2 in ~c"uU" and b3 in ~c"bB" and b4 in ~c"lL" and b5 in ~c"iI" and b6 in ~c"cC", do: :public - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"qQ" and b2 in ~c"uU" and b3 in ~c"oO" and b4 in ~c"tT" and b5 in ~c"eE" and b6 in ~c"sS", do: :quotes - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"aA" and b4 in ~c"dD", do: :read - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"lL" and b4 in ~c"aA" and b5 in ~c"tT" and b6 in ~c"iI" and - b7 in ~c"vV" and b8 in ~c"eE", do: :relative - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"pP" and b4 in ~c"eE" and b5 in ~c"aA" and b6 in ~c"tT" and - b7 in ~c"aA" and b8 in ~c"bB" and b9 in ~c"lL" and b10 in ~c"eE", do: :repeatable - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"pP" and b5 in ~c"eE" and b6 in ~c"cC" and - b7 in ~c"tT", do: :respect - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"tT" and b5 in ~c"aA" and b6 in ~c"rR" and - b7 in ~c"tT", do: :restart - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"tT" and b5 in ~c"rR" and b6 in ~c"iI" and - b7 in ~c"cC" and b8 in ~c"tT", do: :restrict - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"tT" and b4 in ~c"uU" and b5 in ~c"rR" and b6 in ~c"nN" and - b7 in ~c"eE" and b8 in ~c"dD" and b9 in ~c"_" and b10 in ~c"cC" and b11 in ~c"aA" and - b12 in ~c"rR" and b13 in ~c"dD" and b14 in ~c"iI" and b15 in ~c"nN" and b16 in ~c"aA" and - b17 in ~c"lL" and b18 in ~c"iI" and b19 in ~c"tT" and b20 in ~c"yY", do: :returned_cardinality - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"tT" and b4 in ~c"uU" and b5 in ~c"rR" and b6 in ~c"nN" and - b7 in ~c"eE" and b8 in ~c"dD" and b9 in ~c"_" and b10 in ~c"lL" and b11 in ~c"eE" and - b12 in ~c"nN" and b13 in ~c"gG" and b14 in ~c"tT" and b15 in ~c"hH", do: :returned_length - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"tT" and b4 in ~c"uU" and b5 in ~c"rR" and b6 in ~c"nN" and - b7 in ~c"eE" and b8 in ~c"dD" and b9 in ~c"_" and b10 in ~c"oO" and b11 in ~c"cC" and - b12 in ~c"tT" and b13 in ~c"eE" and b14 in ~c"tT" and b15 in ~c"_" and b16 in ~c"lL" and - b17 in ~c"eE" and b18 in ~c"nN" and b19 in ~c"gG" and b20 in ~c"tT" and b21 in ~c"hH", do: :returned_octet_length - - def ident(:ident, [[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"tT" and b4 in ~c"uU" and b5 in ~c"rR" and b6 in ~c"nN" and - b7 in ~c"eE" and b8 in ~c"dD" and b9 in ~c"_" and b10 in ~c"sS" and b11 in ~c"qQ" and - b12 in ~c"lL" and b13 in ~c"sS" and b14 in ~c"tT" and b15 in ~c"aA" and b16 in ~c"tT" and - b17 in ~c"eE", do: :returned_sqlstate - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"rR" and b2 in ~c"eE" and b3 in ~c"tT" and b4 in ~c"uU" and b5 in ~c"rR" and b6 in ~c"nN" and - b7 in ~c"iI" and b8 in ~c"nN" and b9 in ~c"gG", do: :returning - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"rR" and b2 in ~c"oO" and b3 in ~c"lL" and b4 in ~c"eE", do: :role - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"rR" and b2 in ~c"oO" and b3 in ~c"uU" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"eE", do: :routine - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"rR" and b2 in ~c"oO" and b3 in ~c"uU" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"eE" and b8 in ~c"_" and b9 in ~c"cC" and b10 in ~c"aA" and b11 in ~c"tT" and - b12 in ~c"aA" and b13 in ~c"lL" and b14 in ~c"oO" and b15 in ~c"gG", do: :routine_catalog - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"rR" and b2 in ~c"oO" and b3 in ~c"uU" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"eE" and b8 in ~c"_" and b9 in ~c"nN" and b10 in ~c"aA" and b11 in ~c"mM" and - b12 in ~c"eE", do: :routine_name - - def ident(:ident, [[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when b1 in ~c"rR" and b2 in ~c"oO" and b3 in ~c"uU" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"nN" and - b7 in ~c"eE" and b8 in ~c"_" and b9 in ~c"sS" and b10 in ~c"cC" and b11 in ~c"hH" and - b12 in ~c"eE" and b13 in ~c"mM" and b14 in ~c"aA", do: :routine_schema - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"rR" and b2 in ~c"oO" and b3 in ~c"wW" and b4 in ~c"_" and b5 in ~c"cC" and b6 in ~c"oO" and - b7 in ~c"uU" and b8 in ~c"nN" and b9 in ~c"tT", do: :row_count - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"sS" and b2 in ~c"cC" and b3 in ~c"aA" and b4 in ~c"lL" and b5 in ~c"aA" and b6 in ~c"rR", do: :scalar - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"sS" and b2 in ~c"cC" and b3 in ~c"aA" and b4 in ~c"lL" and b5 in ~c"eE", do: :scale - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"sS" and b2 in ~c"cC" and b3 in ~c"hH" and b4 in ~c"eE" and b5 in ~c"mM" and b6 in ~c"aA", do: :schema - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"sS" and b2 in ~c"cC" and b3 in ~c"hH" and b4 in ~c"eE" and b5 in ~c"mM" and b6 in ~c"aA" and - b7 in ~c"_" and b8 in ~c"nN" and b9 in ~c"aA" and b10 in ~c"mM" and b11 in ~c"eE", do: :schema_name - - def ident(:ident, [[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when b1 in ~c"sS" and b2 in ~c"cC" and b3 in ~c"oO" and b4 in ~c"pP" and b5 in ~c"eE" and b6 in ~c"_" and - b7 in ~c"cC" and b8 in ~c"aA" and b9 in ~c"tT" and b10 in ~c"aA" and b11 in ~c"lL" and - b12 in ~c"oO" and b13 in ~c"gG", do: :scope_catalog - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"sS" and b2 in ~c"cC" and b3 in ~c"oO" and b4 in ~c"pP" and b5 in ~c"eE" and b6 in ~c"_" and - b7 in ~c"nN" and b8 in ~c"aA" and b9 in ~c"mM" and b10 in ~c"eE", do: :scope_name - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"sS" and b2 in ~c"cC" and b3 in ~c"oO" and b4 in ~c"pP" and b5 in ~c"eE" and b6 in ~c"_" and - b7 in ~c"sS" and b8 in ~c"cC" and b9 in ~c"hH" and b10 in ~c"eE" and b11 in ~c"mM" and - b12 in ~c"aA", do: :scope_schema - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"cC" and b4 in ~c"tT" and b5 in ~c"iI" and b6 in ~c"oO" and - b7 in ~c"nN", do: :section - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"cC" and b4 in ~c"uU" and b5 in ~c"rR" and b6 in ~c"iI" and - b7 in ~c"tT" and b8 in ~c"yY", do: :security - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"lL" and b4 in ~c"fF", do: :self - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"mM" and b4 in ~c"aA" and b5 in ~c"nN" and b6 in ~c"tT" and - b7 in ~c"iI" and b8 in ~c"cC" and b9 in ~c"sS", do: :semantics - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"qQ" and b4 in ~c"uU" and b5 in ~c"eE" and b6 in ~c"nN" and - b7 in ~c"cC" and b8 in ~c"eE", do: :sequence - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"rR" and b4 in ~c"iI" and b5 in ~c"aA" and b6 in ~c"lL" and - b7 in ~c"iI" and b8 in ~c"zZ" and b9 in ~c"aA" and b10 in ~c"bB" and b11 in ~c"lL" and - b12 in ~c"eE", do: :serializable - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"rR" and b4 in ~c"vV" and b5 in ~c"eE" and b6 in ~c"rR" and - b7 in ~c"_" and b8 in ~c"nN" and b9 in ~c"aA" and b10 in ~c"mM" and b11 in ~c"eE", do: :server_name - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"sS" and b4 in ~c"sS" and b5 in ~c"iI" and b6 in ~c"oO" and - b7 in ~c"nN", do: :session - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"sS" and b2 in ~c"eE" and b3 in ~c"tT" and b4 in ~c"sS", do: :sets - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"sS" and b2 in ~c"iI" and b3 in ~c"mM" and b4 in ~c"pP" and b5 in ~c"lL" and b6 in ~c"eE", do: :simple - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"sS" and b2 in ~c"iI" and b3 in ~c"zZ" and b4 in ~c"eE", do: :size - - def ident(:ident, [[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when b1 in ~c"sS" and b2 in ~c"oO" and b3 in ~c"rR" and b4 in ~c"tT" and b5 in ~c"_" and b6 in ~c"dD" and - b7 in ~c"iI" and b8 in ~c"rR" and b9 in ~c"eE" and b10 in ~c"cC" and b11 in ~c"tT" and - b12 in ~c"iI" and b13 in ~c"oO" and b14 in ~c"nN", do: :sort_direction - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"sS" and b2 in ~c"oO" and b3 in ~c"uU" and b4 in ~c"rR" and b5 in ~c"cC" and b6 in ~c"eE", do: :source - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"sS" and b2 in ~c"pP" and b3 in ~c"aA" and b4 in ~c"cC" and b5 in ~c"eE", do: :space - - def ident(:ident, [[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when b1 in ~c"sS" and b2 in ~c"pP" and b3 in ~c"eE" and b4 in ~c"cC" and b5 in ~c"iI" and b6 in ~c"fF" and - b7 in ~c"iI" and b8 in ~c"cC" and b9 in ~c"_" and b10 in ~c"nN" and b11 in ~c"aA" and - b12 in ~c"mM" and b13 in ~c"eE", do: :specific_name - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"sS" and b2 in ~c"tT" and b3 in ~c"aA" and b4 in ~c"tT" and b5 in ~c"eE", do: :state - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"sS" and b2 in ~c"tT" and b3 in ~c"aA" and b4 in ~c"tT" and b5 in ~c"eE" and b6 in ~c"mM" and - b7 in ~c"eE" and b8 in ~c"nN" and b9 in ~c"tT", do: :statement - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"sS" and b2 in ~c"tT" and b3 in ~c"rR" and b4 in ~c"iI" and b5 in ~c"nN" and b6 in ~c"gG", do: :string - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"sS" and b2 in ~c"tT" and b3 in ~c"rR" and b4 in ~c"uU" and b5 in ~c"cC" and b6 in ~c"tT" and - b7 in ~c"uU" and b8 in ~c"rR" and b9 in ~c"eE", do: :structure - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"sS" and b2 in ~c"tT" and b3 in ~c"yY" and b4 in ~c"lL" and b5 in ~c"eE", do: :style - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"sS" and b2 in ~c"uU" and b3 in ~c"bB" and b4 in ~c"cC" and b5 in ~c"lL" and b6 in ~c"aA" and - b7 in ~c"sS" and b8 in ~c"sS" and b9 in ~c"_" and b10 in ~c"oO" and b11 in ~c"rR" and - b12 in ~c"iI" and b13 in ~c"gG" and b14 in ~c"iI" and b15 in ~c"nN", do: :subclass_origin - - def ident(:ident, [[], b1]) when b1 in ~c"tT", do: :t - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"tT" and b2 in ~c"aA" and b3 in ~c"bB" and b4 in ~c"lL" and b5 in ~c"eE" and b6 in ~c"_" and - b7 in ~c"nN" and b8 in ~c"aA" and b9 in ~c"mM" and b10 in ~c"eE", do: :table_name - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"tT" and b2 in ~c"eE" and b3 in ~c"mM" and b4 in ~c"pP" and b5 in ~c"oO" and b6 in ~c"rR" and - b7 in ~c"aA" and b8 in ~c"rR" and b9 in ~c"yY", do: :temporary - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"tT" and b2 in ~c"hH" and b3 in ~c"rR" and b4 in ~c"oO" and b5 in ~c"uU" and b6 in ~c"gG" and - b7 in ~c"hH", do: :through - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"tT" and b2 in ~c"iI" and b3 in ~c"eE" and b4 in ~c"sS", do: :ties - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"tT" and b2 in ~c"oO" and b3 in ~c"pP" and b4 in ~c"_" and b5 in ~c"lL" and b6 in ~c"eE" and - b7 in ~c"vV" and b8 in ~c"eE" and b9 in ~c"lL" and b10 in ~c"_" and b11 in ~c"cC" and - b12 in ~c"oO" and b13 in ~c"uU" and b14 in ~c"nN" and b15 in ~c"tT", do: :top_level_count - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"aA" and b4 in ~c"nN" and b5 in ~c"sS" and b6 in ~c"aA" and - b7 in ~c"cC" and b8 in ~c"tT" and b9 in ~c"iI" and b10 in ~c"oO" and b11 in ~c"nN", do: :transaction - - def ident(:ident, [[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"aA" and b4 in ~c"nN" and b5 in ~c"sS" and b6 in ~c"aA" and - b7 in ~c"cC" and b8 in ~c"tT" and b9 in ~c"iI" and b10 in ~c"oO" and b11 in ~c"nN" and - b12 in ~c"_" and b13 in ~c"aA" and b14 in ~c"cC" and b15 in ~c"tT" and b16 in ~c"iI" and - b17 in ~c"vV" and b18 in ~c"eE", do: :transaction_active - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"aA" and b4 in ~c"nN" and b5 in ~c"sS" and b6 in ~c"aA" and - b7 in ~c"cC" and b8 in ~c"tT" and b9 in ~c"iI" and b10 in ~c"oO" and b11 in ~c"nN" and - b12 in ~c"sS" and b13 in ~c"_" and b14 in ~c"cC" and b15 in ~c"oO" and b16 in ~c"mM" and - b17 in ~c"mM" and b18 in ~c"iI" and b19 in ~c"tT" and b20 in ~c"tT" and b21 in ~c"eE" and - b22 in ~c"dD", do: :transactions_committed - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"aA" and b4 in ~c"nN" and b5 in ~c"sS" and b6 in ~c"aA" and - b7 in ~c"cC" and b8 in ~c"tT" and b9 in ~c"iI" and b10 in ~c"oO" and b11 in ~c"nN" and - b12 in ~c"sS" and b13 in ~c"_" and b14 in ~c"rR" and b15 in ~c"oO" and b16 in ~c"lL" and - b17 in ~c"lL" and b18 in ~c"eE" and b19 in ~c"dD" and b20 in ~c"_" and b21 in ~c"bB" and - b22 in ~c"aA" and b23 in ~c"cC" and b24 in ~c"kK", do: :transactions_rolled_back - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"aA" and b4 in ~c"nN" and b5 in ~c"sS" and b6 in ~c"fF" and - b7 in ~c"oO" and b8 in ~c"rR" and b9 in ~c"mM", do: :transform - - def ident(:ident, [[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"aA" and b4 in ~c"nN" and b5 in ~c"sS" and b6 in ~c"fF" and - b7 in ~c"oO" and b8 in ~c"rR" and b9 in ~c"mM" and b10 in ~c"sS", do: :transforms - - def ident(:ident, [[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"iI" and b4 in ~c"gG" and b5 in ~c"gG" and b6 in ~c"eE" and - b7 in ~c"rR" and b8 in ~c"_" and b9 in ~c"cC" and b10 in ~c"aA" and b11 in ~c"tT" and - b12 in ~c"aA" and b13 in ~c"lL" and b14 in ~c"oO" and b15 in ~c"gG", do: :trigger_catalog - - def ident(:ident, [[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"iI" and b4 in ~c"gG" and b5 in ~c"gG" and b6 in ~c"eE" and - b7 in ~c"rR" and b8 in ~c"_" and b9 in ~c"nN" and b10 in ~c"aA" and b11 in ~c"mM" and - b12 in ~c"eE", do: :trigger_name - - def ident(:ident, [[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14]) when b1 in ~c"tT" and b2 in ~c"rR" and b3 in ~c"iI" and b4 in ~c"gG" and b5 in ~c"gG" and b6 in ~c"eE" and - b7 in ~c"rR" and b8 in ~c"_" and b9 in ~c"sS" and b10 in ~c"cC" and b11 in ~c"hH" and - b12 in ~c"eE" and b13 in ~c"mM" and b14 in ~c"aA", do: :trigger_schema - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"tT" and b2 in ~c"yY" and b3 in ~c"pP" and b4 in ~c"eE", do: :type - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"uU" and b2 in ~c"nN" and b3 in ~c"bB" and b4 in ~c"oO" and b5 in ~c"uU" and b6 in ~c"nN" and - b7 in ~c"dD" and b8 in ~c"eE" and b9 in ~c"dD", do: :unbounded - - def ident(:ident, [[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11]) when b1 in ~c"uU" and b2 in ~c"nN" and b3 in ~c"cC" and b4 in ~c"oO" and b5 in ~c"mM" and b6 in ~c"mM" and - b7 in ~c"iI" and b8 in ~c"tT" and b9 in ~c"tT" and b10 in ~c"eE" and b11 in ~c"dD", do: :uncommitted - - def ident(:ident, [[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13]) when b1 in ~c"uU" and b2 in ~c"nN" and b3 in ~c"cC" and b4 in ~c"oO" and b5 in ~c"nN" and b6 in ~c"dD" and - b7 in ~c"iI" and b8 in ~c"tT" and b9 in ~c"iI" and b10 in ~c"oO" and b11 in ~c"nN" and - b12 in ~c"aA" and b13 in ~c"lL", do: :unconditional - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"uU" and b2 in ~c"nN" and b3 in ~c"dD" and b4 in ~c"eE" and b5 in ~c"rR", do: :under - - def ident(:ident, [[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9]) when b1 in ~c"uU" and b2 in ~c"nN" and b3 in ~c"mM" and b4 in ~c"aA" and b5 in ~c"tT" and b6 in ~c"cC" and - b7 in ~c"hH" and b8 in ~c"eE" and b9 in ~c"dD", do: :unmatched - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"uU" and b2 in ~c"nN" and b3 in ~c"nN" and b4 in ~c"aA" and b5 in ~c"mM" and b6 in ~c"eE" and - b7 in ~c"dD", do: :unnamed - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"uU" and b2 in ~c"sS" and b3 in ~c"aA" and b4 in ~c"gG" and b5 in ~c"eE", do: :usage - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24], b25]) when b1 in ~c"uU" and b2 in ~c"sS" and b3 in ~c"eE" and b4 in ~c"rR" and b5 in ~c"_" and b6 in ~c"dD" and - b7 in ~c"eE" and b8 in ~c"fF" and b9 in ~c"iI" and b10 in ~c"nN" and b11 in ~c"eE" and - b12 in ~c"dD" and b13 in ~c"_" and b14 in ~c"tT" and b15 in ~c"yY" and b16 in ~c"pP" and - b17 in ~c"eE" and b18 in ~c"_" and b19 in ~c"cC" and b20 in ~c"aA" and b21 in ~c"tT" and - b22 in ~c"aA" and b23 in ~c"lL" and b24 in ~c"oO" and b25 in ~c"gG", do: :user_defined_type_catalog - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22]) when b1 in ~c"uU" and b2 in ~c"sS" and b3 in ~c"eE" and b4 in ~c"rR" and b5 in ~c"_" and b6 in ~c"dD" and - b7 in ~c"eE" and b8 in ~c"fF" and b9 in ~c"iI" and b10 in ~c"nN" and b11 in ~c"eE" and - b12 in ~c"dD" and b13 in ~c"_" and b14 in ~c"tT" and b15 in ~c"yY" and b16 in ~c"pP" and - b17 in ~c"eE" and b18 in ~c"_" and b19 in ~c"cC" and b20 in ~c"oO" and b21 in ~c"dD" and - b22 in ~c"eE", do: :user_defined_type_code - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22]) when b1 in ~c"uU" and b2 in ~c"sS" and b3 in ~c"eE" and b4 in ~c"rR" and b5 in ~c"_" and b6 in ~c"dD" and - b7 in ~c"eE" and b8 in ~c"fF" and b9 in ~c"iI" and b10 in ~c"nN" and b11 in ~c"eE" and - b12 in ~c"dD" and b13 in ~c"_" and b14 in ~c"tT" and b15 in ~c"yY" and b16 in ~c"pP" and - b17 in ~c"eE" and b18 in ~c"_" and b19 in ~c"nN" and b20 in ~c"aA" and b21 in ~c"mM" and - b22 in ~c"eE", do: :user_defined_type_name - - def ident(:ident, [[[[[[[[[[[[[[[[[[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8], b9], b10], b11], b12], b13], b14], b15], b16], b17], b18], b19], b20], b21], b22], b23], b24]) when b1 in ~c"uU" and b2 in ~c"sS" and b3 in ~c"eE" and b4 in ~c"rR" and b5 in ~c"_" and b6 in ~c"dD" and - b7 in ~c"eE" and b8 in ~c"fF" and b9 in ~c"iI" and b10 in ~c"nN" and b11 in ~c"eE" and - b12 in ~c"dD" and b13 in ~c"_" and b14 in ~c"tT" and b15 in ~c"yY" and b16 in ~c"pP" and - b17 in ~c"eE" and b18 in ~c"_" and b19 in ~c"sS" and b20 in ~c"cC" and b21 in ~c"hH" and - b22 in ~c"eE" and b23 in ~c"mM" and b24 in ~c"aA", do: :user_defined_type_schema - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"uU" and b2 in ~c"tT" and b3 in ~c"fF" and b4 in ~c"1" and b5 in ~c"6", do: :utf16 - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"uU" and b2 in ~c"tT" and b3 in ~c"fF" and b4 in ~c"3" and b5 in ~c"2", do: :utf32 - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"uU" and b2 in ~c"tT" and b3 in ~c"fF" and b4 in ~c"8", do: :utf8 - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"vV" and b2 in ~c"iI" and b3 in ~c"eE" and b4 in ~c"wW", do: :view - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"wW" and b2 in ~c"oO" and b3 in ~c"rR" and b4 in ~c"kK", do: :work - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"wW" and b2 in ~c"rR" and b3 in ~c"aA" and b4 in ~c"pP" and b5 in ~c"pP" and b6 in ~c"eE" and - b7 in ~c"rR", do: :wrapper - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"wW" and b2 in ~c"rR" and b3 in ~c"iI" and b4 in ~c"tT" and b5 in ~c"eE", do: :write - - def ident(:ident, [[[[[], b1], b2], b3], b4]) when b1 in ~c"zZ" and b2 in ~c"oO" and b3 in ~c"nN" and b4 in ~c"eE", do: :zone - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"lL" and b2 in ~c"iI" and b3 in ~c"mM" and b4 in ~c"iI" and b5 in ~c"tT", do: :limit - - def ident(:ident, [[[[[[], b1], b2], b3], b4], b5]) when b1 in ~c"iI" and b2 in ~c"lL" and b3 in ~c"iI" and b4 in ~c"kK" and b5 in ~c"eE", do: :ilike - - def ident(:ident, [[[[[[[[[], b1], b2], b3], b4], b5], b6], b7], b8]) when b1 in ~c"bB" and b2 in ~c"aA" and b3 in ~c"cC" and b4 in ~c"kK" and b5 in ~c"wW" and b6 in ~c"aA" and - b7 in ~c"rR" and b8 in ~c"dD", do: :backward - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"fF" and b2 in ~c"oO" and b3 in ~c"rR" and b4 in ~c"wW" and b5 in ~c"aA" and b6 in ~c"rR" and - b7 in ~c"dD", do: :forward - - def ident(:ident, [[[[[[[], b1], b2], b3], b4], b5], b6]) when b1 in ~c"iI" and b2 in ~c"sS" and b3 in ~c"nN" and b4 in ~c"uU" and b5 in ~c"lL" and b6 in ~c"lL", do: :isnull - - def ident(:ident, [[[[[[[[], b1], b2], b3], b4], b5], b6], b7]) when b1 in ~c"nN" and b2 in ~c"oO" and b3 in ~c"tT" and b4 in ~c"nN" and b5 in ~c"uU" and b6 in ~c"lL" and - b7 in ~c"lL", do: :notnull - - def ident(type, _), do: type end diff --git a/lib/mix/tasks/sql.gen.helpers.ex b/lib/mix/tasks/sql.gen.helpers.ex new file mode 100644 index 0000000..2761651 --- /dev/null +++ b/lib/mix/tasks/sql.gen.helpers.ex @@ -0,0 +1,145 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 DBVisor + +defmodule Mix.Tasks.Sql.Gen.Helpers do + use Mix.Task + import Mix.Generator + @moduledoc since: "0.2.0" + + @shortdoc "Generates a helpers from the BNF rules" + def run(_args) do + operators = [ + {:plus, [type: :mysql], ["+"]}, + {:minus, [type: :mysql], ["-"]}, + {:not, [type: :mysql], ["!"]}, + {:logical_and, [type: :mysql], ["&&"]}, + {:logical_or, [type: :mysql], ["||"]}, + {:bitwise_and, [type: :mysql], ["&"]}, + {:bitwise_and_assignment, [type: :tds], ["&="]}, + {:bitwise_xor, [type: :mysql], ["^"]}, + {:bitwise_xor_assignment, [type: :tds], ["^="]}, + {:bitwise_or, [type: :mysql], ["|"]}, + {:bitwise_or_assignment, [type: :tds], ["|=", "|*="]}, + {:bitwise_exclusive_assignment, [type: :sql], ["^-="]}, + {:bitwise_invasion, [type: :mysql], ["~"]}, + {:right_shift, [type: :mysql], [">>"]}, + {:left_shift, [type: :mysql], ["<<"]}, + {:null_safe_equals_operator, [type: :mysql], ["<=>"]}, + {:mod, [type: :mysql], ["%"]}, + {:json_extract, [type: :mysql], ["->"]}, + {:json_unquote_json_extract, [type: :mysql], ["->>"]}, + {:assign_value, [type: :mysql], [":="]}, + {:add_assignment, [type: :tds], ["+="]}, + {:subtract_assignment, [type: :tds], ["-="]}, + {:multiply_assignment, [type: :tds], ["*="]}, + {:divide_assignment, [type: :tds], ["/="]}, + {:mod_assignment, [type: :tds], ["%="]}, + {:not_greater_then, [type: :tds], ["!>"]}, + {:not_less_then, [type: :tds], ["!<"]}, + {:right_containment, [type: :postgres], ["@>"]}, + {:left_containment, [type: :postgres], ["<@"]}, + {:sqaure_root, [type: :postgres], ["|/"]}, + {:cube_root, [type: :postgres], ["||/"]}, + {:abs, [type: :postgres], ["@"]}, + {:bitwise_exclusive_or, [type: :postgres], ["#"]}, + {:starts_with, [type: :postgres], ["^@"]}, + {:regex_match, [type: :postgres], ["~*"]}, + {:not_regex_match_case, [type: :postgres], ["!~"]}, + {:not_regex_match, [type: :postgres], ["!~*"]}, + {:bitwise_exclusive_or, [type: :postgres], ["##"]}, + {:right_extend, [type: :postgres], ["&<"]}, + {:left_extend, [type: :postgres], ["&>"]}, + {:right_below, [type: :postgres], ["<<|"]}, + {:left_below, [type: :postgres], ["|>>"]}, + {:not_right_extend, [type: :postgres], ["&<|"]}, + {:not_left_extend, [type: :postgres], ["|&>"]}, + {:right_below, [type: :postgres], ["<^"]}, + {:left_below, [type: :postgres], [">^"]}, + {:object_intersect, [type: :postgres], ["?#"]}, + {:horizontal_line, [type: :postgres], ["?-"]}, + {:vertical_line, [type: :postgres], ["?|"]}, + {:perpendicular_line, [type: :postgres], ["?-|"]}, + {:parallel_line, [type: :postgres], ["?||"]}, + {:regex_match, [type: :postgres], ["~="]}, + {:right_containment, [type: :postgres], ["<<="]}, + {:left_containment, [type: :postgres], [">>="]}, + {:tsvector_match, [type: :postgres], ["@@"]}, + {:negate_tsquery, [type: :postgres], ["!!"]}, + {:json_extract, [type: :postgres], ["#>"]}, + {:json_extract_text, [type: :postgres], ["#>>"]}, + {:json_array_containment, [type: :postgres], ["?&"]}, + {:json_delete, [type: :postgres], ["#-"]}, + {:json_path_return, [type: :postgres], ["@?"]}, + {:ranges_adjacent, [type: :postgres], ["-|-"]}, + {:cast, [type: :postgres], ["::"]}, + ] + rules = SQL.BNF.parse(%{ + "" => ~w[| LIMIT | ILIKE | BACKWARD | FORWARD | ISNULL | NOTNULL], + operators: operators + }) + enclosed = [ + {:double_quote, [type: :literal], ["\"", "\""]}, + {:quote, [type: :literal], ["'", "'"]}, + # {:double_dollar, [type: :literal], ["$$", "$$"]}, + # {:dollar, [type: :literal], ["$", "$"]}, + # {:unicode_escape, [type: :literal], ["U&'", "'"]}, + {:backtick, [type: :literal], ["`", "`"]}, + # {:bit_string, [type: :literal], ["B'", "'"]}, + {:brace, [type: :expr], ["{", "}"]}, + {:bracket, [type: :expr], ["[", "]"]}, + {:paren, [type: :expr], ["(", ")"]}, + # {:comment, [type: :literal], ["--", "\n"]}, + # {:comments, [type: :literal], ["/*", "*/"]}, + ] + exprs = for {n, [type: :expr], [f, l]} <- enclosed, reduce: {[], [], []} do + {name, first, last} -> {[n|name], [f|first], [l|last]} + end + space = Enum.map(rules.terminals[""], fn <> -> c end) + whitespace = Enum.map(rules.terminals[""], fn <> -> c end) + newline = Enum.map(rules.terminals[""], fn <> -> c end) + reserved = rules.keywords[""] ++ rules.keywords[""] + create_file("lib/helpers.ex", helpers_template([mod: SQL.Lexer, reserved: Enum.uniq(reserved), non_reserved: Enum.uniq(rules.keywords[""]), nested_start: ~c"#{elem(exprs, 1)}", nested_end: ~c"#{elem(exprs, 2)}", special_characters: ~c"#{Enum.map(rules.special_characters, &elem(&1, 1))}*/", operators: Enum.uniq(Enum.flat_map(rules.operators, &elem(&1, 1))), digits: ~c"#{rules.digits[""]}", exprs: exprs, space: space, whitespace: whitespace, newline: newline])) + end + + embed_template(:helpers, """ + # SPDX-License-Identifier: Apache-2.0 + # SPDX-FileCopyrightText: 2025 DBVisor + + defmodule SQL.Helpers do + @moduledoc false + + defguard is_newline(b) when b in <%= inspect @newline %> + defguard is_space(b) when b in <%= inspect @space %> + defguard is_whitespace(b) when b in <%= inspect @whitespace %> + defguard is_literal(b) when b in ~c{"'`} + defguard is_expr(b) when b in <%= inspect elem(@exprs, 0) %> + defguard is_nested_start(b) when b in <%= inspect @nested_start %> + defguard is_nested_end(b) when b in <%= inspect @nested_end %> + defguard is_special_character(b) when b in <%= inspect @special_characters %> + defguard is_digit(b) when b in <%= inspect @digits %> + defguard is_comment(b) when b in ["--", "/*"] + defguard is_sign(b) when b in ~c"-+" + defguard is_dot(b) when b == ?. + defguard is_delimiter(b) when b in ~c";," + # defguard is_operator(node) when elem(node, 0) in ~w"<%= Enum.map_join(@operators, " ", &Atom.to_string(elem(&1, 0))) %>"a + defguard is_operator(node) when elem(hd(elem(node, 1)), 0) == :operator + <%= for letter <- Enum.to_list(?a..?z) do %> + defguard is_<%= [letter] %>(b) when b in <%= inspect [letter | :string.uppercase([letter])] %> + <% end %> + <%= for {atom, _, _} <- Enum.uniq(@reserved ++ @non_reserved) do %> + defguard is_kw_<%= String.replace(Atom.to_string(atom), "-", "_") %>(node) when elem(hd(elem(node, 1)), 1) == <%= inspect(atom) %> + <% end %> + + <%= for {atom, match, guard} <- @reserved do %> + def tag(<%= match %>) when <%= guard %>, do: {:reserved, <%= inspect(atom) %>} + <% end %> + <%= for {atom, match, guard} <- @non_reserved do %> + def tag(<%= match %>) when <%= guard %>, do: {:non_reserved, <%= inspect(atom) %>} + <% end %> + <%= for {atom, match} <- @operators do %> + def tag(<%= match %>), do: {:operator, <%= inspect(atom) %>} + <% end %> + def tag(_), do: nil + end + """) +end diff --git a/lib/mix/tasks/sql.gen.parser.ex b/lib/mix/tasks/sql.gen.parser.ex deleted file mode 100644 index 61667e1..0000000 --- a/lib/mix/tasks/sql.gen.parser.ex +++ /dev/null @@ -1,579 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: 2025 DBVisor - -defmodule Mix.Tasks.Sql.Gen.Parser do - use Mix.Task - import Mix.Generator - @moduledoc since: "0.2.0" - - @shortdoc "Generates a lexer and parser from the BNF rules" - def run(_args) do - rules = SQL.BNF.parse() - space = Enum.map(rules[""], fn <> -> c end) - whitespace = Enum.map(rules[""], fn <> -> c end) - newline = Enum.map(rules[""], fn <> -> c end) - - keywords = String.split(rules[""], "|") ++ String.split(rules[""], "|") |> Enum.map(&String.trim/1) |> Enum.reject(&(&1 == "")) - keywords = keywords ++ ~w[LIMIT ILIKE BACKWARD FORWARD ISNULL NOTNULL] - create_file("lib/lexer.ex", lexer_template([mod: SQL.Lexer, keywords: keywords, space: space, whitespace: whitespace, newline: newline])) - create_file("lib/parser.ex", parser_template([mod: SQL.Parser, keywords: Enum.map(keywords, &String.to_atom(String.downcase(&1)))])) - end - - def guard(keyword) do - {value, _n} = for <>, reduce: {[], 1} do - {[], n} -> {{:in, [context: Elixir, imports: [{2, Kernel}]], [{:"b#{n}", [], Elixir}, Enum.uniq(~c"#{<>}#{String.upcase(<>)}")]}, n+1} - {left, n} -> {{:and, [context: Elixir, imports: [{2, Kernel}]], [left, {:in, [context: Elixir, imports: [{2, Kernel}]], [{:"b#{n}", [], Elixir}, Enum.uniq(~c"#{<>}#{String.upcase(<>)}")]}]}, n+1} - end - Macro.to_string(value) - end - - embed_template(:parser, """ - # SPDX-License-Identifier: Apache-2.0 - # SPDX-FileCopyrightText: 2025 DBVisor - - defmodule <%= inspect @mod %> do - @moduledoc false - @compile {:inline, parse: 1, parse: 5, predicate: 1, insert_node: 5} - - import Kernel, except: [is_boolean: 1] - - defguard is_and(node) when elem(node, 0) == :and - defguard is_between(node) when elem(node, 0) == :between - defguard is_boolean(node) when elem(node, 0) in ~w[and or <> <= >= != < > !< !> = true false unknown like ilike in all any is isnull notnull between]a - defguard is_combinator(node) when elem(node, 0) in ~w[except intersect union]a and elem(node, 2) == [] - defguard is_comma(node) when elem(node, 0) == :comma - defguard is_comment(node) when elem(node, 0) in ~w[comment comments]a - defguard is_conditional(node) when elem(node, 0) in ~w[and or]a and elem(node, 2) == [] - defguard is_colon(node) when elem(node, 0) == :colon - defguard is_distinct(node) when elem(node, 0) == :distinct - defguard is_declare(node) when elem(node, 0) == :declare - defguard is_data_type(node) when elem(node, 0) in ~w[integer float ident quote double_quote backtick bracket parens . binding]a - defguard is_fetch(node) when elem(node, 0) == :fetch - defguard is_fetch_dir(node) when elem(node, 0) in ~w[absolute backward forward relative]a - defguard is_from(node) when elem(node, 0) == :from - defguard is_for(node) when elem(node, 0) == :for - defguard is_grant(node) when elem(node, 0) == :grant - defguard is_revoke(node) when elem(node, 0) == :revoke - defguard is_keyword(node) when elem(node, 0) in <%= inspect(@keywords, limit: :infinity) %> - defguard is_not(node) when elem(node, 0) == :not and elem(node, 2) == [] - defguard is_join(node) when elem(node, 0) == :join - defguard is_parens(node) when elem(node, 0) == :parens - defguard is_operator(node) when elem(node, 0) in ~w[operator :: + - * / ^ % & += -= *= /= %= &= ^-= |*= <=> || as <> <= >= != < > !< !> = like ilike in all any is isnull notnull between]a - defguard is_of(node) when elem(node, 0) == :of - defguard is_is(node) when elem(node, 0) == :is - defguard is_on(node) when elem(node, 0) == :on - defguard is_select(node) when elem(node, 0) == :select - - def predicate([l, c, r]) when is_boolean(l) and is_conditional(c) and is_boolean(r) do - {elem(c, 0), elem(c, 1), [l, r]} - end - def predicate([l, b]) when is_boolean(b) do - [{elem(b, 0), elem(b, 1), [l | elem(b, 2)]}] - end - def predicate([l, b, r | rest]) when is_boolean(b) or is_operator(b) do - predicate([{elem(b, 0), elem(b, 1), [l, r]} | rest]) - end - def predicate([{_, _, _}, node | _] = unit) when is_comma(node) do - unit - end - def predicate([l, b, r, c | rest]) when is_comma(c) and (is_boolean(b) or is_operator(b)) do - [{elem(b, 0), elem(b, 1), [l, r]}, c | rest] - end - def predicate([l, c, r, c2 | rest]) when is_boolean(l) and is_conditional(c) and is_boolean(r) and is_conditional(c2) do - predicate([{elem(c, 0), elem(c, 1), [l, r]}, c2 | rest]) - end - def predicate([f, c, l, b, r, c2 | rest]) when is_boolean(b) and is_conditional(c) and is_conditional(c2) do - predicate([f, c, {elem(b, 0), elem(b, 1), [l, r]}, c2 | rest]) - end - def predicate([f, c, l, b, r]) when is_boolean(b) and is_conditional(c) do - predicate([f, c, {elem(b, 0), elem(b, 1), [l, r]}]) - end - def predicate([l, b, r, c | rest]) when is_boolean(b) and is_conditional(c) do - predicate([{elem(b, 0), elem(b, 1), [l, r]}, c | rest]) - end - def predicate(unit) do - unit - end - - - def insert_node(node, unit, acc, context, root) when is_parens(node) do - {[{elem(node, 0), elem(node, 1), parse(elem(node, 2))} | unit], acc, context, root} - end - def insert_node(node, [{:in = tag, meta, []}, right, {:using, _, _} = using | unit], acc, context, root) do - {[{tag, meta, [node, [right, using | unit]]}], acc, context, root} - end - def insert_node({:in, _, _} = node, [_, {:using, _, _}|_] = unit, acc, context, root) do - {[node | unit], acc, context, root} - end - def insert_node({:into = tag, meta, _}, [_] = unit, acc, context, root) do - {[{tag, meta, unit}], acc, context, root} - end - def insert_node(node, [n, b, r, c, l | unit], acc, context, root) when is_between(b) and is_and(c) and is_not(n) and is_data_type(r) and is_data_type(l) and is_data_type(node) do - {[{elem(b, 0), elem(b, 1), [{elem(n, 0), elem(n, 1), [node]}, {elem(c, 0), elem(c, 1), [r, l]}]} | unit], acc, context, root} - end - def insert_node(node, [n, b, s, r, c, l | unit], acc, context, root) when is_between(b) and is_and(c) and is_not(n) and is_data_type(r) and is_data_type(l) and is_data_type(node) do - {[{elem(b, 0), elem(b, 1), [{elem(n, 0), elem(n, 1), [node]}, {elem(s, 0), elem(s, 1), [{elem(c, 0), elem(c, 1), [r, l]}]}]} | unit], acc, context, root} - end - def insert_node(node, [b, s, r, c, l | unit], acc, context, root) when is_between(b) and is_and(c) and is_data_type(r) and is_data_type(l) and is_data_type(node) do - {[{elem(b, 0), elem(b, 1), [node, {elem(s, 0), elem(s, 1), [{elem(c, 0), elem(c, 1), [r, l]}]}]} | unit], acc, context, root} - end - def insert_node(node, [b, r, c, l | unit], acc, context, root) when is_between(b) and is_and(c) and is_data_type(r) and is_data_type(l) and is_data_type(node) do - {[{elem(b, 0), elem(b, 1), [node, {elem(c, 0), elem(c, 1), [r, l]}]} | unit], acc, context, root} - end - def insert_node(node, [b, l, c | unit], acc, context, root) when is_data_type(node) and is_operator(b) and is_data_type(l) and is_conditional(c) do - {[{elem(b, 0), elem(b, 1), [node, l]}, c | unit], acc, context, root} - end - def insert_node(node, [r, b, l | unit], acc, context, root) when is_conditional(node) and is_data_type(r) and is_operator(b) and is_data_type(l) do - {[node, {elem(b, 0), elem(b, 1), [r, l]} | unit], acc, context, root} - end - def insert_node(node, [o, l], acc, context, root) when is_data_type(node) and is_operator(o) and is_data_type(l) do - {[{elem(o, 0), elem(o, 1), [node, l]}], acc, context, root} - end - def insert_node(node, [u | unit], acc, context, root) when is_not(node) and elem(u, 0) in ~w[false true unknown null]a do - {[{elem(node, 0), elem(node, 1), [u]} | unit], acc, context, root} - end - def insert_node(node, [u | unit], acc, context, root) when is_not(u) and is_data_type(node) do - {[{elem(u, 0), elem(u, 1), [node | unit]}], acc, context, root} - end - def insert_node({:into = tag, meta, []}, [ident, parens, values], acc, context, root) do - {[], [{tag, meta, [ident, parens, values]} | acc], context, root} - end - def insert_node({tag, meta, []}, [ident, parens], acc, context, root) when tag in ~w[into table]a do - {[], [{tag, meta, [ident, parens]} | acc], context, root} - end - def insert_node({:add = tag, meta, []}, [ident, type], acc, context, root) do - {[], [{tag, meta, [ident, type]} | acc], context, root} - end - def insert_node({:type = tag, meta, []}, [ident, as, type], acc, context, root) do - {[], [{tag, meta, [{elem(as, 0), elem(as, 1), [ident, type]}]} | acc], context, root} - end - def insert_node({tag, meta, []}, [ident], acc, context, root) when tag in ~w[type table]a do - {[], [{tag, meta, [ident]} | acc], context, root} - end - def insert_node({:with = tag, meta, []}, [{:recursive = t, m, []}, {:ident, _, _} = l, {:parens, _, _} = r, {:as = t2, m2, a}], [], context, root) do - {[], [], context, root ++ [{tag, meta, [{t2, m2, [{t, m, [l, r]} | a]}]}]} - end - def insert_node({:with = tag, meta, []}, [{:ident, _, _} = l, {:parens, _, _} = r, {:as = t2, m2, a}], [], context, root) do - {[], [], context, root ++ [{tag, meta, [{t2, m2, [[l, r] | a]}]}]} - end - def insert_node({:with = tag, meta, []}, [{:ident, _, _}, {:as, _, _}] = unit, acc, context, root) do - {[], [], context, root ++ [{tag, meta, unit ++ acc}]} - end - def insert_node({tag, meta, []}, unit, acc, context, root) when tag in ~w[by in references]a do - {[{tag, meta, predicate(unit ++ acc)}], [], context, root} - end - def insert_node(node, [n|_] = unit, acc, context, root) when (is_on(n) or is_of(n)) and elem(node, 0) in ~w[select insert update delete truncate references trigger create connect temporary execute usage set alter system maintain]a do - {[node|unit], acc, context, root} - end - def insert_node(node, [_, n|_] = unit, acc, context, root) when is_for(n) and is_from(node) do - {[node|unit], acc, context, root} - end - def insert_node(node, [_, _, _, n|_] = unit, acc, context, root) when is_for(n) and is_select(node) do - {[node|unit], acc, context, root} - end - def insert_node(node, [] = unit, [] = acc, [] = context, root) when elem(node, 0) in ~w[create drop insert alter update delete start set open close commit rollback]a do - {[node | unit], acc, context, root} - end - def insert_node({tag, meta, []}, unit, acc, context, root) when tag in ~w[create drop insert alter update delete start set open close commit rollback]a do - {[], [], context, [{tag, meta, List.wrap(predicate(unit ++ acc))} | root]} - end - def insert_node(node, [n |_] = unit, acc, context, root) when is_grant(node) and elem(n, 0) == :option do - {[node | unit], acc, context, root} - end - def insert_node(node, unit, acc, context, root) when is_grant(node) or is_revoke(node) or is_declare(node) do - {[], [], context, [{elem(node, 0), elem(node, 1), unit ++ acc ++ root}]} - end - def insert_node({:distinct = tag, meta, []}, [{:on, _, _} = on | unit], acc, context, root) do - {[{tag, meta, [on]} | unit], acc, context, root} - end - def insert_node(node, [u | unit], acc, context, root) when is_fetch_dir(node) and elem(u, 0) != :in do - {[{elem(node, 0), elem(node, 1), [u]}], unit++acc, context, root} - end - def insert_node(node, [u | unit], acc, context, root) when is_fetch(node) do - {[], [], context, [{elem(node, 0), elem(node, 1), [u]} | unit ++ acc ++ root]} - end - def insert_node(node, [on], [], context, root) when is_join(node) and is_on(on) do - {[], [], context, [{elem(node, 0), elem(node, 1), elem(node, 2) ++ [on]} | root]} - end - def insert_node(node, [ident, on], [] = acc, context, root) when is_join(node) and is_on(on) do - {[], acc, context, [{elem(node, 0), elem(node, 1), elem(node, 2) ++ [{elem(on, 0), elem(on, 1), [ident | elem(on, 2)]}]} | root]} - end - def insert_node(node, [ident, as, on | unit], [] = acc, context, root) when is_join(node) and is_on(on) do - {[], acc, context, [{elem(node, 0), elem(node, 1), elem(node, 2) ++ [{elem(on, 0), elem(on, 1), [[ident, as]] ++ elem(on, 2) ++ unit}]} | root]} - end - def insert_node(node, [ident, on | unit], [] = acc, context, root) when is_join(node) and is_on(on) do - {[], acc, context, [{elem(node, 0), elem(node, 1), elem(node, 2) ++ [{elem(on, 0), elem(on, 1), [ident] ++ elem(on, 2) ++ unit}]} | root]} - end - def insert_node(node, unit, acc, context, root) when is_join(node) do - a = elem(node, 2) - acc = unit ++ acc - acc = if a == [], do: acc, else: a ++ [acc] - {[], [], context, [{elem(node, 0), elem(node, 1), acc} | root]} - end - def insert_node({tag, meta, []}, unit, acc, context, root) when tag in ~w[select from where group having order limit offset]a do - {[], [], context, [{tag, meta, List.wrap(predicate(unit ++ acc))} | root]} - end - def insert_node(node, unit, acc, context, {:colon, meta, []}) do - {unit, acc, context, {:colon, meta, [node]}} - end - def insert_node(node, [parens | unit], acc, context, root) when is_parens(parens) and is_keyword(node) do - {[{elem(node, 0), elem(node, 1), [parens]} | unit], acc, context, root} - end - def insert_node(node, unit, acc, context, root) do - {[node | unit], acc, context, root} - end - - def parse(tokens) do - parse(tokens, [], [], [], []) - end - def parse([], [], [], [], root) do - root - end - def parse([], unit, acc, [], []) do - predicate(unit ++ acc) - end - def parse([], unit, acc, [], root) do - predicate(unit ++ acc) ++ root - end - def parse([], unit, acc, context, root) when is_tuple(context) do - [{elem(context, 0), elem(context, 1), [unit ++ acc ++ root, elem(context, 2)]}] - end - def parse([node | rest], unit, acc, context, root) when is_comment(node) do - parse(rest, unit, acc, context, [node | root]) - end - def parse([{:all, m, _}, node | rest], unit, acc, [], root) when is_combinator(node) do - parse(rest, [], [], {elem(node, 0), elem(node, 1), [{:all, m, unit ++ acc ++ root}]}, []) - end - def parse([node | rest], unit, acc, [], root) when is_combinator(node) do - parse(rest, [], [], {elem(node, 0), elem(node, 1), unit ++ acc ++ root}, []) - end - def parse([node | rest], unit, acc, context, root) when is_colon(node) do - parse(rest, [], [], context, [{elem(node, 0), elem(node, 1), unit ++ acc ++ root}]) - end - def parse([ident, from, distinct, n, is, left | rest], unit, acc, context, root) when is_is(is) and is_from(from) and is_distinct(distinct) do - node = {elem(is, 0), elem(is, 1), [left, {elem(n, 0), elem(n, 1), [{elem(distinct, 0), elem(distinct, 1), [{elem(from, 0), elem(from, 1), [ident]}]}]}]} - {unit, acc, context, root} = insert_node(node, unit, acc, context, root) - parse(rest, unit, acc, context, root) - end - def parse([ident, from, distinct, is, left | rest], unit, acc, context, root) when is_is(is) and is_from(from) and is_distinct(distinct) do - node = {elem(is, 0), elem(is, 1), [left, {elem(distinct, 0), elem(distinct, 1), [{elem(from, 0), elem(from, 1), [ident]}]}]} - {unit, acc, context, root} = insert_node(node, unit, acc, context, root) - parse(rest, unit, acc, context, root) - end - def parse([node | rest], unit, acc, context, root) when is_colon(node) do - parse(rest, [], [], context, [{elem(node, 0), elem(node, 1), unit ++ acc ++ root}]) - end - def parse([parens, node | rest], unit, acc, [], root) when is_parens(parens) and is_combinator(node) do - parse(rest, unit, acc, {elem(node, 0), elem(node, 1), [{elem(parens, 0), elem(parens, 1), parse(elem(parens, 2))}]}, root) - end - def parse([node | rest], unit, acc, context, root) when is_comma(node) do - parse(rest, [], [{elem(node, 0), elem(node, 1), predicate(unit)} | acc], context, root) - end - def parse([node | rest], unit, acc, context, root) do - {unit, acc, context, root} = insert_node(node, unit, acc, context, root) - parse(rest, unit, acc, context, root) - end - end - """) - - - embed_template(:lexer, """ - # SPDX-License-Identifier: Apache-2.0 - # SPDX-FileCopyrightText: 2025 DBVisor - - defmodule <%= inspect @mod %> do - @moduledoc false - @compile {:inline, lex: 9, lex: 4, meta: 3, merge: 3, type: 2, node: 5} - - defguard is_data_type(node) when elem(node, 0) in ~w[integer float ident quote double_quote backtick bracket parens .]a - defguard is_newline(b) when b in <%= inspect(@newline) %> - defguard is_space(b) when b in <%= inspect(@space) %> - defguard is_whitespace(b) when b in <%= inspect(@whitespace) %> - - def opening_delimiter(:parens), do: :"(" - def opening_delimiter(:bracket), do: :"[" - def opening_delimiter(:double_quote), do: :"\\"" - def opening_delimiter(:quote), do: :"'" - def opening_delimiter(:backtick), do: :"`" - def opening_delimiter(type) when type in ~w[var code braces]a, do: :"{" - - def expected_delimiter(:parens), do: :")" - def expected_delimiter(:bracket), do: :"]" - def expected_delimiter(:double_quote), do: :"\\"" - def expected_delimiter(:quote), do: :"'" - def expected_delimiter(:backtick), do: :"`" - def expected_delimiter(type) when type in ~w[var code braces]a, do: :"}" - - def lex(binary, file, params \\\\ 0, opts \\\\ [metadata: true]) do - case lex(binary, binary, [{:binding, []}, {:params, params}, {:file, file} | opts], 0, 0, nil, [], [], 0) do - {"", _binary, opts, line, column, nil = type, data, acc, _n} -> - {:ok, opts, line, column, type, data, acc} - - {"", binary, _opts, end_line, end_column, type, _data, [{_, [line: line, column: column, file: file], _}|_], _n} when type in ~w[parens bracket double_quote quote backtick var code]a -> - raise TokenMissingError, file: file, snippet: binary, end_line: end_line, end_column: end_column, line: line, column: column, opening_delimiter: opening_delimiter(type), expected_delimiter: expected_delimiter(type) - - {"", _binary, opts, line, column, type, data, acc, _n} -> - {:ok, opts, line, column, type, data, insert_node(node(ident(type, data), line, column, data, opts), acc)} - end - end - def lex("" = rest, binary, opts, line, column, type, data, acc, n) do - {rest, binary, opts, line, column, type, data, acc, n} - end - def lex(<>, binary, opts, line, column, type, data, acc, n) do - lex(rest, binary, opts, line, column+2, :comment, [], insert_node(type, line, column, data, opts, acc), n) - end - def lex(<>, binary, opts, line, column, _type, data, acc, n) do - lex(rest, binary, opts, line, column+2, :comments, data, acc, n) - end - def lex(<>, binary, opts, line, column, :comments, data, acc, n) do - lex(rest, binary, opts, line, column+2, nil, [], insert_node(node(:comments, line, column, data, opts), acc), n) - end - def lex(<>, binary, opts, line, column, :comments, data, acc, n) do - lex(rest, binary, opts, line, column+1, :comments, [data | [b]], acc, n) - end - def lex(<>, binary, opts, line, column, nil, data, acc, n) do - lex(rest, binary, opts, line, column+2, :var, data, acc, n) - end - def lex(<>, binary, [_, _, _, {:format, true}] = opts, line, column, _type, data, acc, 0 = n), do: lex(rest, binary, opts, line, column+2, nil, [], insert_node(node(:binding, line, column, data, opts), acc), n) - def lex(<>, binary, opts, line, column, type, data, acc, 0 = n) when type in ~w[code var]a do - opts = opts - |> Keyword.update!(:binding, &(&1 ++ [{type, IO.iodata_to_binary(data)}])) - |> Keyword.update!(:params, &(&1+1)) - lex(rest, binary, opts, line, column+2, nil, [], insert_node(node(:binding, line, column, Keyword.get(opts, :params), opts), acc), n) - end - def lex(<>, binary, opts, line, column, :code = type, data, acc, n) do - lex(rest, binary, opts, line, column+1, type, [data | [?}]], acc, n-1) - end - def lex(<>, binary, opts, line, column, type, data, acc, n) when type in ~w[var code]a and b in [?{] do - lex(rest, binary, opts, line, column+1, :code, [data | [b]], acc, n+1) - end - def lex(<>, binary, opts, line, column, :var = type, data, acc, n) when b in ?0..?9 and data != [] do - lex(rest, binary, opts, line, column+1, type, [data | [b]], acc, n) - end - def lex(<>, binary, opts, line, column, :var = type, data, acc, n) when b in ?a..?z or b in ?A..?Z or (b == ?_ and data != []) do - lex(rest, binary, opts, line, column+1, type, [data | [b]], acc, n) - end - def lex(<>, binary, opts, line, column, type, data, acc, n) when type in ~w[var code]a do - lex(rest, binary, opts, line, column+1, :code, [data | [b]], acc, n) - end - def lex(<>, binary, opts, line, column, type, data, acc, n) when b in [?(, ?[] do - acc = case ident(type, data) do - nil -> acc - :ident -> insert_node(node(type, line, column, data, opts), acc) - tag -> insert_node(node(tag, line, column, [], opts), acc) - end - case lex(rest, binary, opts, line, column+1, nil, [], [], n) do - {rest, opts, line, column, value} -> - lex(rest, binary, opts, line, column, nil, [], insert_node(node(ident(type, [b]), line, column, value, opts), acc), n) - {rest, binary, o, l, c, t, d, a, _n} -> - value = if t, do: insert_node(node(t, l, c, d, o), a), else: a - lex(rest, binary, opts, l, c, (if b == ?(, do: :parens, else: :bracket), [], insert_node(node(ident(type, [b]), line, column, value, opts), acc), n) - end - end - def lex(<>, _binary, opts, line, column, type, data, acc, _n) when b in [?), ?]] do - acc = if type, do: insert_node(node(type, line, column, data, opts), acc), else: acc - {rest, opts, line, column+1, acc} - end - def lex(<>, binary, opts, line, column, :double_quote = type, data, acc, n) do - lex(rest, binary, opts, line, column+1, nil, [], insert_node(node(type, line, column, data, opts), acc), n) - end - def lex(<>, binary, opts, line, column, :backtick = type, data, acc, n) do - lex(rest, binary, opts, line, column+1, nil, [], insert_node(node(type, line, column, data, opts), acc), n) - end - def lex(<>, binary, opts, line, column, :quote = type, data, acc, n) do - lex(rest, binary, opts, line, column+1, nil, [], insert_node(node(type, line, column, data, opts), acc), n) - end - def lex(<>, binary, opts, line, column, type, data, acc, n) when type in ~w[double_quote quote backtick]a do - lex(rest, binary, opts, line, column+1, type, [data | [b]], acc, n) - end - def lex(<>, binary, opts, line, column, type, data, acc, n) when is_newline(b) do - if data == [] do - lex(rest, binary, opts, line+1, column, type, data, acc, n) - else - tag = ident(type, data) - lex(rest, binary, opts, line+1, column, nil, [], insert_node(node(tag, line, column, data, opts), acc), n) - end - end - def lex(<>, binary, opts, line, column, type, data, acc, n) when is_space(b) do - if data == [] do - lex(rest, binary, opts, line, column+1, type, data, acc, n) - else - tag = ident(type, data) - lex(rest, binary, opts, line, column+1, nil, [], insert_node(node(tag, line, column, data, opts), acc), n) - end - end - def lex(<>, binary, opts, line, column, type, data, acc, n) when is_whitespace(b) do - if data == [] do - lex(rest, binary, opts, line, column+1, type, data, acc, n) - else - tag = ident(type, data) - lex(rest, binary, opts, line, column+1, nil, [], insert_node(node(tag, line, column, data, opts), acc), n) - end - end - def lex(<>, binary, opts, line, column, type, data, acc, n) when b in [?,, ?;] do - acc = if type, do: insert_node(node(ident(type, data), line, column, data, opts), acc), else: acc - lex(rest, binary, opts, line, column, nil, [], insert_node(node(type(b), line, column+1, [], opts), acc), n) - end - def lex(<>, binary, opts, line, column, type, data, acc, n) when b in ~w[^-= |*= <=> <-> >>= &<| <<| |>> |&> -|-] do - node = node(String.to_atom(b), line, column+3, [], opts) - if data == [] do - lex(rest, binary, opts, line, column+3, type, data, insert_node(node, acc), n) - else - lex(rest, binary, opts, line, column+3, nil, [], insert_node(node, insert_node(node(ident(type, data), line, column, data, opts), acc)), n) - end - end - def lex(<>, binary, opts, line, column, type, data, acc, n) when b in ~w[:: <> != !< !> <= >= += -= *= /= %= &= || << &< && &> >> ~= @> <@ @@] do - node = node(String.to_atom(b), line, column+2, [], opts) - if data == [] do - lex(rest, binary, opts, line, column+2, type, data, insert_node(node, acc), n) - else - lex(rest, binary, opts, line, column+2, nil, [], insert_node(node, insert_node(node(ident(type, data), line, column, data, opts), acc)), n) - end - end - def lex(<>, binary, opts, line, column, type, data, acc, n) when type in ~w[integer float]a and b in [?E, ?e] and (e in [?-, ?+] or e in ?0..?9) do - type = :float - lex(rest, binary, opts, line, column+2, type, merge(merge(data, b, type), e, type), acc, n) - end - def lex(<>, binary, opts, line, column, nil, [], acc, n) when b == ?. and e in ?0..?9 do - lex(rest, binary, opts, line, column+2, :float, [b, e], acc, n) - end - def lex(<>, binary, opts, line, column, nil, [], acc, n) when b in [?-, ?+] and e == ?. do - lex(rest, binary, opts, line, column+2, :float, [b,e], acc, n) - end - def lex(<>, binary, opts, line, column, :integer, data, acc, n) when b == ?. do - type = :float - lex(rest, binary, opts, line, column+1, type, merge(data, b, type), acc, n) - end - def lex(<>, binary, opts, line, column, type, data, acc, n) when b == ?. do - node = node(List.to_atom([b]), line, column+1, [], opts) - if data == [] do - lex(rest, binary, opts, line, column+1, type, data, insert_node(node, acc), n) - else - lex(rest, binary, opts, line, column+1, nil, [], insert_node(node, insert_node(node(ident(type, data), line, column, data, opts), acc)), n) - end - end - def lex(<>, binary, opts, line, column, _type, [] = data, [node | _] = acc, n) when b in [?+, ?-, ?^, ?*, ?/, ?%, ?&, ?<, ?>, ?=] and is_data_type(node) do - node = node(List.to_atom([b]), line, column+1, data, opts) - lex(rest, binary, opts, line, column+1, nil, data, insert_node(node, acc), n) - end - def lex(<>, binary, opts, line, column, nil, [], acc, n) when b in [?+, ?-] and c in ?0..?9 do - lex(rest, binary, opts, line, column+2, :integer, [b, c], acc, n) - end - def lex(<>, binary, opts, line, column, nil = type, data, acc, n) when b in [?+, ?-, ?^, ?*, ?/, ?%, ?&, ?<, ?>, ?=] do - node = node(List.to_atom([b]), line, column+1, data, opts) - lex(rest, binary, opts, line, column+1, type, data, insert_node(node, acc), n) - end - def lex(<>, binary, opts, line, column, type, data, acc, n) when b in [?+, ?-, ?^, ?*, ?/, ?%, ?&, ?<, ?>, ?=] and type in ~w[integer float ident quote double_quote backtick bracket parens nil]a do - node = node(List.to_atom([b]), line, column+1, [], opts) - lex(rest, binary, opts, line, column+1, nil, [], insert_node(node, insert_node(node(ident(type, data), line, column, data, opts), acc)), n) - end - def lex(<>, binary, opts, line, column, type, data, acc, n) do - type = type(b, type) - lex(rest, binary, opts, line, column+1, type, merge(data, b, type), acc, n) - end - - def insert_node(nil, _line, _column, _data, _opts, acc) do - acc - end - def insert_node(type, line, column, data, opts, acc) do - insert_node(node(type, line, column, data, opts), acc) - end - def insert_node(right, [{:. = tag, m, a}, {:., _, [_, _]} = left | acc]) do - [{tag, m, [left, right | a]} | acc] - end - def insert_node(right, [{:. = tag, meta, [left]} | acc]) do - [{tag, meta, [left, right]} | acc] - end - def insert_node({:., _, _} = node, [right, {:. = tag, m, []}, left | acc]) do - [node, {tag, m, [left, right]} | acc] - end - def insert_node({:. = t, m, a}, [left | acc]) do - [{t, m, [left|a]} | acc] - end - def insert_node({:join = t, m, a} = node, acc) do - case join(acc) do - {qualified, rest} -> [{t, m, [qualified|a]} | rest] - rest -> [node | rest] - end - end - def insert_node(node, acc) do - [node | acc] - end - - def join([{:outer, _} = r, {tag, _} = l, {:natural, _} = n | rest]) when tag in ~w[left right full]a do - {[n, l, r], rest} - end - def join([{:outer, _} = r, {tag, _} = l | rest]) when tag in ~w[left right full]a do - {[l, r], rest} - end - def join([{:inner, _} = r, {:natural, _} = l| rest]) do - {[l, r], rest} - end - def join([{tag, _} = l | rest]) when tag in ~w[inner left right full natural cross]a do - {[l], rest} - end - def join(acc) do - acc - end - - def merge([] = data, _b, type) when type in ~w[double_quote quote backtick]a, do: data - def merge(data, b, _type), do: [data | [b]] - - def type(?;), do: :colon - def type(?,), do: :comma - def type(?"), do: :double_quote - def type(?'), do: :quote - def type(?`), do: :backtick - def type(?(), do: :left_paren - def type(?)), do: :right_paren - def type(?[), do: :left_bracket - def type(?]), do: :right_bracket - - def type(%param{}), do: param - def type(param) when is_float(param), do: :float - def type(param) when is_integer(param), do: :integer - def type(param) when is_map(param), do: :map - def type(param) when is_list(param), do: {:list, Enum.uniq(Enum.map(param, &type/1))} - def type(param) when is_binary(param), do: :string - def type(_param), do: nil - - def type(_, type) when type in ~w[double_quote quote backtick comment comments]a, do: type - def type(?", _type), do: :double_quote - def type(?', _type), do: :quote - def type(?`, _type), do: :backtick - def type(b, type) when b in ?0..?9 and type in ~w[nil integer float]a, do: type || :integer - def type(?., :integer), do: :float - def type(_b, _type), do: :ident - - def meta(_line, _column, [_,_,_,{_,false}|_]), do: [] - def meta(line, column, [_, _, {_, file} |_]), do: [line: line, column: column, file: file] - - def node(:binding = tag, line, column, [idx], [{:binding, false}, {:params, params}|_] = opts) do - {tag, meta(line, column, opts), Enum.at(params, idx)} - end - def node(:binding = tag, line, column, data, opts) when is_integer(data), do: {tag, meta(line, column, opts), [data]} - def node(tag, line, column, data, opts) when tag in ~w[ident float integer double_quote quote backtick binding parens bracket . comment comments]a do - data = case data do - [] -> data - [{_, _, _} | _] -> data - _ -> [IO.iodata_to_binary(data)] - end - {tag, meta(line, column, opts), data} - end - def node(tag, line, column, _data, opts) when tag in ~w[asterisk inner left right full natural cross outer]a do - {tag, meta(line, column, opts)} - end - def node(tag, line, column, _data, opts) do - {tag, meta(line, column, opts), []} - end - - def ident(_type, [?*]), do: :asterisk - def ident(_type, [?(]), do: :parens - def ident(_type, [?[]), do: :bracket - <%= for keyword <- @keywords do %> - def ident(:ident, <%= Enum.reduce(1..byte_size(keyword), "[]", fn n, acc -> "[\#{acc}, b\#{n}]" end) %>) when <%= guard(keyword) %>, do: <%= inspect(String.to_atom(String.downcase(keyword))) %> - <% end %> - def ident(type, _), do: type - end - """) -end diff --git a/lib/parser.ex b/lib/parser.ex index cbc277b..327e168 100644 --- a/lib/parser.ex +++ b/lib/parser.ex @@ -3,10 +3,10 @@ defmodule SQL.Parser do @moduledoc false - @compile {:inline, parse: 1, parse: 5, predicate: 1, insert_node: 5} - + @compile {:inline, parse: 2, parse: 5, predicate: 1, insert_node: 5} import Kernel, except: [is_boolean: 1] + defguard is_and(node) when elem(node, 0) == :and defguard is_between(node) when elem(node, 0) == :between defguard is_boolean(node) when elem(node, 0) in ~w[and or <> <= >= != < > !< !> = true false unknown like ilike in all any is isnull notnull between]a @@ -17,22 +17,22 @@ defmodule SQL.Parser do defguard is_colon(node) when elem(node, 0) == :colon defguard is_distinct(node) when elem(node, 0) == :distinct defguard is_declare(node) when elem(node, 0) == :declare - defguard is_data_type(node) when elem(node, 0) in ~w[integer float ident quote double_quote backtick bracket parens . binding]a + defguard is_data_type(node) when elem(node, 0) in ~w[numeric ident quote double_quote backtick bracket paren dot binding]a defguard is_fetch(node) when elem(node, 0) == :fetch - defguard is_fetch_dir(node) when elem(node, 0) in ~w[absolute backward forward relative]a + defguard is_fetch_dir(node) when elem(node, 0) in ~w[absolute backward forward relative]a or elem(hd(tl(elem(node, 1))), 1) in ~w[absolute backward forward relative]a defguard is_from(node) when elem(node, 0) == :from defguard is_for(node) when elem(node, 0) == :for defguard is_grant(node) when elem(node, 0) == :grant defguard is_revoke(node) when elem(node, 0) == :revoke - defguard is_keyword(node) when elem(node, 0) in [:abs, :absent, :acos, :all, :allocate, :alter, :and, :any, :any_value, :are, :array, :array_agg, :array_max_cardinality, :as, :asensitive, :asin, :asymmetric, :at, :atan, :atomic, :authorization, :avg, :begin, :begin_frame, :begin_partition, :between, :bigint, :binary, :blob, :boolean, :both, :btrim, :by, :call, :called, :cardinality, :cascaded, :case, :cast, :ceil, :ceiling, :char, :char_length, :character, :character_length, :check, :classifier, :clob, :close, :coalesce, :collate, :collect, :column, :commit, :condition, :connect, :constraint, :contains, :convert, :copy, :corr, :corresponding, :cos, :cosh, :count, :covar_pop, :covar_samp, :create, :cross, :cube, :cume_dist, :current, :current_catalog, :current_date, :current_default_transform_group, :current_path, :current_role, :current_row, :current_schema, :current_time, :current_timestamp, :current_transform_group_for_type, :current_user, :cursor, :cycle, :date, :day, :deallocate, :dec, :decfloat, :decimal, :declare, :default, :define, :delete, :dense_rank, :deref, :describe, :deterministic, :disconnect, :distinct, :double, :drop, :dynamic, :each, :element, :else, :empty, :end, :end_frame, :end_partition, :"end-exec", :equals, :escape, :every, :except, :exec, :execute, :exists, :exp, :external, :extract, false, :fetch, :filter, :first_value, :float, :floor, :for, :foreign, :frame_row, :free, :from, :full, :function, :fusion, :get, :global, :grant, :greatest, :group, :grouping, :groups, :having, :hold, :hour, :identity, :in, :indicator, :initial, :inner, :inout, :insensitive, :insert, :int, :integer, :intersect, :intersection, :interval, :into, :is, :join, :json, :json_array, :json_arrayagg, :json_exists, :json_object, :json_objectagg, :json_query, :json_scalar, :json_serialize, :json_table, :json_table_primitive, :json_value, :lag, :language, :large, :last_value, :lateral, :lead, :leading, :least, :left, :like, :like_regex, :listagg, :ln, :local, :localtime, :localtimestamp, :log, :log10, :lower, :lpad, :ltrim, :match, :match_number, :match_recognize, :matches, :max, :member, :merge, :method, :min, :minute, :mod, :modifies, :module, :month, :multiset, :national, :natural, :nchar, :nclob, :new, :no, :none, :normalize, :not, :nth_value, :ntile, :null, :nullif, :numeric, :occurrences_regex, :octet_length, :of, :offset, :old, :omit, :on, :one, :only, :open, :or, :order, :out, :outer, :over, :overlaps, :overlay, :parameter, :partition, :pattern, :per, :percent, :percent_rank, :percentile_cont, :percentile_disc, :period, :portion, :position, :position_regex, :power, :precedes, :precision, :prepare, :primary, :procedure, :ptf, :range, :rank, :reads, :real, :recursive, :ref, :references, :referencing, :regr_avgx, :regr_avgy, :regr_count, :regr_intercept, :regr_r2, :regr_slope, :regr_sxx, :regr_sxy, :regr_syy, :release, :result, :return, :returns, :revoke, :right, :rollback, :rollup, :row, :row_number, :rows, :rpad, :rtrim, :running, :savepoint, :scope, :scroll, :search, :second, :seek, :select, :sensitive, :session_user, :set, :show, :similar, :sin, :sinh, :skip, :smallint, :some, :specific, :specifictype, :sql, :sqlexception, :sqlstate, :sqlwarning, :sqrt, :start, :static, :stddev_pop, :stddev_samp, :submultiset, :subset, :substring, :substring_regex, :succeeds, :sum, :symmetric, :system, :system_time, :system_user, :table, :tablesample, :tan, :tanh, :then, :time, :timestamp, :timezone_hour, :timezone_minute, :to, :trailing, :translate, :translate_regex, :translation, :treat, :trigger, :trim, :trim_array, true, :truncate, :uescape, :union, :unique, :unknown, :unnest, :update, :upper, :user, :using, :value, :values, :value_of, :var_pop, :var_samp, :varbinary, :varchar, :varying, :versioning, :when, :whenever, :where, :width_bucket, :window, :with, :within, :without, :year, :a, :absolute, :action, :ada, :add, :admin, :after, :always, :asc, :assertion, :assignment, :attribute, :attributes, :before, :bernoulli, :breadth, :c, :cascade, :catalog, :catalog_name, :chain, :chaining, :character_set_catalog, :character_set_name, :character_set_schema, :characteristics, :characters, :class_origin, :cobol, :collation, :collation_catalog, :collation_name, :collation_schema, :columns, :column_name, :command_function, :command_function_code, :committed, :conditional, :condition_number, :connection, :connection_name, :constraint_catalog, :constraint_name, :constraint_schema, :constraints, :constructor, :continue, :copartition, :cursor_name, :data, :datetime_interval_code, :datetime_interval_precision, :defaults, :deferrable, :deferred, :defined, :definer, :degree, :depth, :derived, :desc, :descriptor, :diagnostics, :dispatch, :domain, :dynamic_function, :dynamic_function_code, :encoding, :enforced, :error, :exclude, :excluding, :expression, :final, :finish, :first, :flag, :following, :format, :fortran, :found, :fulfill, :g, :general, :generated, :go, :goto, :granted, :hierarchy, :ignore, :immediate, :immediately, :implementation, :including, :increment, :initially, :input, :instance, :instantiable, :instead, :invoker, :isolation, :k, :keep, :key, :keys, :key_member, :key_type, :last, :length, :level, :locator, :m, :map, :matched, :maxvalue, :measures, :message_length, :message_octet_length, :message_text, :minvalue, :more, :mumps, :name, :names, :nested, :nesting, :next, :nfc, :nfd, :nfkc, :nfkd, :normalized, :null_ordering, :nullable, :nulls, :number, :object, :occurrence, :octets, :option, :options, :ordering, :ordinality, :others, :output, :overflow, :overriding, :p, :pad, :parameter_mode, :parameter_name, :parameter_ordinal_position, :parameter_specific_catalog, :parameter_specific_name, :parameter_specific_schema, :partial, :pascal, :pass, :passing, :past, :path, :permute, :pipe, :placing, :plan, :pli, :preceding, :preserve, :prev, :prior, :private, :privileges, :prune, :public, :quotes, :read, :relative, :repeatable, :respect, :restart, :restrict, :returned_cardinality, :returned_length, :returned_octet_length, :returned_sqlstate, :returning, :role, :routine, :routine_catalog, :routine_name, :routine_schema, :row_count, :scalar, :scale, :schema, :schema_name, :scope_catalog, :scope_name, :scope_schema, :section, :security, :self, :semantics, :sequence, :serializable, :server_name, :session, :sets, :simple, :size, :sort_direction, :source, :space, :specific_name, :state, :statement, :string, :structure, :style, :subclass_origin, :t, :table_name, :temporary, :through, :ties, :top_level_count, :transaction, :transaction_active, :transactions_committed, :transactions_rolled_back, :transform, :transforms, :trigger_catalog, :trigger_name, :trigger_schema, :type, :unbounded, :uncommitted, :unconditional, :under, :unmatched, :unnamed, :usage, :user_defined_type_catalog, :user_defined_type_code, :user_defined_type_name, :user_defined_type_schema, :utf16, :utf32, :utf8, :view, :work, :wrapper, :write, :zone, :limit, :ilike, :backward, :forward, :isnull, :notnull] defguard is_not(node) when elem(node, 0) == :not and elem(node, 2) == [] defguard is_join(node) when elem(node, 0) == :join - defguard is_parens(node) when elem(node, 0) == :parens - defguard is_operator(node) when elem(node, 0) in ~w[operator :: + - * / ^ % & += -= *= /= %= &= ^-= |*= <=> || as <> <= >= != < > !< !> = like ilike in all any is isnull notnull between]a + defguard is_paren(node) when elem(node, 0) == :paren + defguard is_operator(node) when elem(node, 0) in ~w[:: + - * / ^ % & += -= *= /= %= &= ^-= |*= <=> <-> >>= || as <> <= >= != < > !< !> = like ilike in all any is isnull notnull between]a defguard is_of(node) when elem(node, 0) == :of defguard is_is(node) when elem(node, 0) == :is defguard is_on(node) when elem(node, 0) == :on defguard is_select(node) when elem(node, 0) == :select + defguard is_keyword(node) when elem(hd(elem(node, 1)), 0) == :keyword def predicate([l, c, r]) when is_boolean(l) and is_conditional(c) and is_boolean(r) do {elem(c, 0), elem(c, 1), [l, r]} @@ -65,9 +65,9 @@ defmodule SQL.Parser do unit end - - def insert_node(node, unit, acc, context, root) when is_parens(node) do - {[{elem(node, 0), elem(node, 1), parse(elem(node, 2))} | unit], acc, context, root} + def insert_node(node, unit, acc, context, root) when is_paren(node) do + {:ok, _context, tokens} = parse(elem(node, 2), []) + {[{elem(node, 0), elem(node, 1), tokens} | unit], acc, context, root} end def insert_node(node, [{:in = tag, meta, []}, right, {:using, _, _} = using | unit], acc, context, root) do {[{tag, meta, [node, [right, using | unit]]}], acc, context, root} @@ -105,11 +105,11 @@ defmodule SQL.Parser do def insert_node(node, [u | unit], acc, context, root) when is_not(u) and is_data_type(node) do {[{elem(u, 0), elem(u, 1), [node | unit]}], acc, context, root} end - def insert_node({:into = tag, meta, []}, [ident, parens, values], acc, context, root) do - {[], [{tag, meta, [ident, parens, values]} | acc], context, root} + def insert_node({:into = tag, meta, []}, [ident, paren, values], acc, context, root) do + {[], [{tag, meta, [ident, paren, values]} | acc], context, root} end - def insert_node({tag, meta, []}, [ident, parens], acc, context, root) when tag in ~w[into table]a do - {[], [{tag, meta, [ident, parens]} | acc], context, root} + def insert_node({tag, meta, []}, [ident, paren], acc, context, root) when tag in ~w[into table]a do + {[], [{tag, meta, [ident, paren]} | acc], context, root} end def insert_node({:add = tag, meta, []}, [ident, type], acc, context, root) do {[], [{tag, meta, [ident, type]} | acc], context, root} @@ -120,15 +120,28 @@ defmodule SQL.Parser do def insert_node({tag, meta, []}, [ident], acc, context, root) when tag in ~w[type table]a do {[], [{tag, meta, [ident]} | acc], context, root} end - def insert_node({:with = tag, meta, []}, [{:recursive = t, m, []}, {:ident, _, _} = l, {:parens, _, _} = r, {:as = t2, m2, a}], [], context, root) do + def insert_node({:with = tag, meta, []}, [{:recursive = t, m, []}, {:fun, _, _} = l, {:as = t2, m2, a}], [], context, root) do + {[], [], context, root ++ [{tag, meta, [{t2, m2, [{t, m, [l]} | a]}]}]} + end + def insert_node({:with = tag, meta, []}, [{:recursive = t, m, []}, {:ident, _, _} = l, {:paren, _, _} = r, {:as = t2, m2, a}], [], context, root) do + # {[], [], context, [{tag, meta, [{t2, m2, [{t, m, [l, r]} | a]}]}] ++ root} {[], [], context, root ++ [{tag, meta, [{t2, m2, [{t, m, [l, r]} | a]}]}]} end - def insert_node({:with = tag, meta, []}, [{:ident, _, _} = l, {:parens, _, _} = r, {:as = t2, m2, a}], [], context, root) do + def insert_node({:with = tag, meta, []}, [{:ident, _, _} = l, {:paren, _, _} = r, {:as = t2, m2, a}], [], context, root) do + # {[], [], context, [{tag, meta, [{t2, m2, [[l, r] | a]}]}] ++ root} {[], [], context, root ++ [{tag, meta, [{t2, m2, [[l, r] | a]}]}]} end def insert_node({:with = tag, meta, []}, [{:ident, _, _}, {:as, _, _}] = unit, acc, context, root) do {[], [], context, root ++ [{tag, meta, unit ++ acc}]} end + + # def insert_node({:with = tag, meta, []}, [{:recursive = t, m, []}, {:ident, _, _} = l, {:paren, _, _} = r, {:as = t2, m2, []}, {:paren, _, _} = l2], [], context, root) do + # {[], [], context, root ++ [{tag, meta, [{t2, m2, [{t, m, [l, r]}, l2]}]}]} + # end + # def insert_node({:with = tag, meta, []}, [{:ident, _, _} = l, {:paren, _, _} = r, {:as = t2, m2, []}, {:paren, _, _} = l2], [], context, root) do + # {[], [], context, root ++ [{tag, meta, [{t2, m2, [[l, r], l2]}]}]} + # end + def insert_node({tag, meta, []}, unit, acc, context, root) when tag in ~w[by in references]a do {[{tag, meta, predicate(unit ++ acc)}], [], context, root} end @@ -186,15 +199,15 @@ defmodule SQL.Parser do def insert_node(node, unit, acc, context, {:colon, meta, []}) do {unit, acc, context, {:colon, meta, [node]}} end - def insert_node(node, [parens | unit], acc, context, root) when is_parens(parens) and is_keyword(node) do - {[{elem(node, 0), elem(node, 1), [parens]} | unit], acc, context, root} + def insert_node({tag,_,value}=node, [paren | unit], acc, context, root) when is_paren(paren) and tag == :as and value == [] or is_paren(paren) and is_keyword(node) and tag != :as do + {[{elem(node, 0), elem(node, 1), [paren]} | unit], acc, context, root} end def insert_node(node, unit, acc, context, root) do {[node | unit], acc, context, root} end - def parse(tokens) do - parse(tokens, [], [], [], []) + def parse(tokens, context) do + {:ok, context, parse(tokens, [], [], [], [])} end def parse([], [], [], [], root) do root @@ -211,6 +224,14 @@ defmodule SQL.Parser do def parse([node | rest], unit, acc, context, root) when is_comment(node) do parse(rest, unit, acc, context, [node | root]) end + def parse([{t, m, [{t2, m2, tokens} = paren]} | rest], unit, acc, context, root) when is_paren(paren) do + {:ok, _context, tokens} = parse(tokens, []) + parse(rest, [{t, m, [{t2, m2, tokens}]} | unit], acc, context, root) + end + def parse([{t, m, [l, {t2, m2, tokens} = paren]} | rest], unit, acc, context, root) when is_paren(paren) do + {:ok, _context, tokens} = parse(tokens, []) + parse(rest, [{t, m, [l, {t2, m2, tokens}]} | unit], acc, context, root) + end def parse([{:all, m, _}, node | rest], unit, acc, [], root) when is_combinator(node) do parse(rest, [], [], {elem(node, 0), elem(node, 1), [{:all, m, unit ++ acc ++ root}]}, []) end @@ -233,8 +254,9 @@ defmodule SQL.Parser do def parse([node | rest], unit, acc, context, root) when is_colon(node) do parse(rest, [], [], context, [{elem(node, 0), elem(node, 1), unit ++ acc ++ root}]) end - def parse([parens, node | rest], unit, acc, [], root) when is_parens(parens) and is_combinator(node) do - parse(rest, unit, acc, {elem(node, 0), elem(node, 1), [{elem(parens, 0), elem(parens, 1), parse(elem(parens, 2))}]}, root) + def parse([paren, node | rest], unit, acc, [], root) when is_paren(paren) and is_combinator(node) do + {:ok, _context, tokens} = parse(elem(paren, 2), []) + parse(rest, unit, acc, {elem(node, 0), elem(node, 1), [{elem(paren, 0), elem(paren, 1), tokens}]}, root) end def parse([node | rest], unit, acc, context, root) when is_comma(node) do parse(rest, [], [{elem(node, 0), elem(node, 1), predicate(unit)} | acc], context, root) diff --git a/lib/sql.ex b/lib/sql.ex index 94b1e0e..bd8ad33 100644 --- a/lib/sql.ex +++ b/lib/sql.ex @@ -9,6 +9,7 @@ defmodule SQL do @moduledoc since: "0.1.0" @adapters [SQL.Adapters.ANSI, SQL.Adapters.MySQL, SQL.Adapters.Postgres, SQL.Adapters.TDS] + @compile {:inline, cast_params: 4} defmacro __using__(opts) do quote bind_quoted: [opts: opts] do @@ -30,7 +31,7 @@ defmodule SQL do @doc deprecated: "Use SQL.Token.token_to_string/1 instead" @callback token_to_sql(token :: {atom, keyword, list}) :: String.t() - defstruct [:tokens, :params, :module, :id, :string, :inspect] + defstruct [tokens: [], params: [], module: nil, id: nil, string: nil, inspect: nil] defimpl Inspect, for: SQL do def inspect(sql, _opts), do: Inspect.Algebra.concat(["~SQL\"\"\"\n", sql.inspect, "\n\"\"\""]) @@ -70,29 +71,29 @@ defmodule SQL do @doc false @doc since: "0.1.0" def parse(binary) do - {:ok, _opts, _, _, _, _, tokens} = SQL.Lexer.lex(binary, __ENV__.file, 0, [format: true]) + {:ok, context, tokens} = SQL.Lexer.lex(binary, __ENV__.file, 0, [format: true]) + {:ok, context, tokens} = SQL.Parser.parse(tokens, context) tokens - |> SQL.Parser.parse() - |> to_query() + |> to_query(context) |> to_string(SQL.Adapters.ANSI) end @doc false - @doc since: "0.1.0" + @doc since: "0.3.0" @acc ~w[for create drop insert alter with update delete select set fetch from join where group having window except intersect union order limit offset lock colon in declare start grant revoke commit rollback open close comment comments into]a - def to_query([value | _] = tokens) when is_tuple(value) and elem(value, 0) in @acc do - Enum.reduce(@acc, [], fn key, acc -> acc ++ for {k, meta, v} <- Enum.filter(tokens, &(elem(&1, 0) == key)), do: {k, meta, Enum.map(v, &to_query/1)} end) + def to_query([value | _] = tokens, context) when is_tuple(value) and elem(value, 0) in @acc do + Enum.reduce(@acc, [], fn key, acc -> acc ++ for {k, meta, v} <- Enum.filter(tokens, &(elem(&1, 0) == key)), do: {k, meta, Enum.map(v, &to_query(&1, context))} end) end - def to_query({:parens = tag, meta, values}) do - {tag, meta, to_query(values)} + def to_query({:paren = tag, meta, values}, context) do + {tag, meta, to_query(values, context)} end - def to_query({tag, meta, values}) do - {tag, meta, Enum.map(values, &to_query/1)} + def to_query({tag, meta, values}, context) do + {tag, meta, Enum.map(values, &to_query(&1, context))} end - def to_query(tokens) when is_list(tokens) do - Enum.map(tokens, &to_query/1) + def to_query(tokens, context) when is_list(tokens) do + Enum.map(tokens, &to_query(&1, context)) end - def to_query(token) do + def to_query(token, _context) do token end @@ -103,7 +104,7 @@ defmodule SQL do token, [] = acc -> [acc | module.token_to_string(token)] token, acc -> case module.token_to_string(token) do - <<";", _::binary>> = v -> [acc | v] + <> = v -> [acc | v] v -> [acc, " " | v] end end) @@ -120,7 +121,7 @@ defmodule SQL do token, [] = acc -> [acc | fun.(token)] token, acc -> case fun.(token) do - <<";", _::binary>> = v -> [acc | v] + <> = v -> [acc | v] v -> [acc, " " | v] end end) @@ -129,30 +130,30 @@ defmodule SQL do @doc false def build(left, {:<<>>, _, _} = right, _modifiers, env) do + module = if env.module, do: Module.get_attribute(env.module, :sql_adapter, SQL.Adapters.ANSI), else: SQL.Adapters.ANSI case build(left, right) do {:static, data} -> - {:ok, opts, _, _, _, _, tokens} = SQL.Lexer.lex(data, env.file) - tokens = SQL.to_query(SQL.Parser.parse(tokens)) - string = if mod = env.module do - SQL.to_string(tokens, Module.get_attribute(mod, :sql_adapter)) - else - SQL.to_string(tokens, SQL.Adapters.ANSI) - end - sql = struct(SQL, tokens: tokens, string: string, module: env.module, inspect: data, id: id(data)) - quote bind_quoted: [params: opts[:binding], sql: Macro.escape(sql)] do - %{sql | params: cast_params(params, [], binding())} + {:ok, context, tokens} = SQL.Lexer.lex(data, env.file) + {:ok, context, t} = SQL.Parser.parse(tokens, context) + sql = struct(SQL, tokens: tokens, string: SQL.to_string(SQL.to_query(t, context), module), module: env.module, inspect: data, id: id(data)) + case context.binding do + [] -> Macro.escape(sql) + params -> + quote bind_quoted: [params: params, sql: Macro.escape(sql), env: Macro.escape(env)] do + %{sql | params: cast_params(params, [], binding(), env)} + end end {:dynamic, data} -> sql = struct(SQL, id: id(data), module: env.module) - quote bind_quoted: [left: Macro.unpipe(left), right: right, file: env.file, data: data, sql: Macro.escape(sql)] do + quote bind_quoted: [left: Macro.unpipe(left), right: right, file: env.file, data: data, sql: Macro.escape(sql), env: Macro.escape(env)] do {t, p} = Enum.reduce(left, {[], []}, fn {[], 0}, acc -> acc {v, 0}, {t, p} -> {t ++ v.tokens, p ++ v.params} end) - {tokens, params} = tokens(right, file, length(p), sql.id) + {:ok, context, tokens} = tokens(right, file, length(p), sql.id) tokens = t ++ tokens - %{sql | params: cast_params(params, p, binding()), tokens: tokens, string: plan(tokens, sql.id, sql.module), inspect: plan_inspect(data, sql.id)} + %{sql | params: cast_params(context.binding, p, binding(), env), tokens: tokens, string: plan(tokens, context, sql.id, sql.module), inspect: plan_inspect(data, sql.id)} end end end @@ -184,10 +185,10 @@ defmodule SQL do end @doc false - def cast_params(bindings, params, binding) do + def cast_params(bindings, params, binding, env) do Enum.reduce(bindings, params, fn - {:var, var}, acc -> if v = binding[String.to_atom(var)], do: acc ++ [v], else: acc - {:code, code}, acc -> acc ++ [elem(Code.eval_string(code, binding), 0)] + quoted, acc when is_tuple(quoted) -> acc ++ [elem(Code.eval_quoted_with_env(quoted, binding, env), 0)] + quoted, acc -> acc ++ [quoted] end) end @@ -197,20 +198,20 @@ defmodule SQL do if result = :persistent_term.get(key, nil) do result else - {:ok, opts, _, _, _, _, tokens} = SQL.Lexer.lex(binary, file, count) - result = {tokens, opts[:binding]} + result = SQL.Lexer.lex(binary, file, count) :persistent_term.put(key, result) result end end @doc false - def plan(tokens, id, module) do + def plan(tokens, context, id, module) do key = {module, id, :plan} if string = :persistent_term.get(key, nil) do string else - string = to_string(SQL.to_query(SQL.Parser.parse(tokens)), module) + {:ok, context, tokens} = SQL.Parser.parse(tokens, context) + string = to_string(SQL.to_query(tokens, context), module) :persistent_term.put(key, string) string end @@ -219,19 +220,21 @@ defmodule SQL do @doc false def plan_inspect(data, id) do key = {id, :inspect} - if inspect = :persistent_term.get(key, nil) do - inspect - else + case :persistent_term.get(key, nil) do + nil when is_binary(data) -> + :persistent_term.put(key, data) + data + nil -> inspect = data |> Enum.map(fn ast when is_struct(ast) -> ast.inspect x -> x end) |> IO.iodata_to_binary() - - :persistent_term.put(key, inspect) inspect + inspect -> + inspect end end end diff --git a/lib/string.ex b/lib/string.ex index 2ca1919..531fcc9 100644 --- a/lib/string.ex +++ b/lib/string.ex @@ -9,20 +9,33 @@ defmodule SQL.String do def token_to_sql(value, _mod) when is_struct(value) do to_string(value) end - def token_to_sql({tag, _, [{:parens, _, _} = value]}, mod) when tag in ~w[integer float update]a do + def token_to_sql({:*, _, []}, _mod) do + "*" + end + def token_to_sql({:fun, _, [left, right]}, mod) do + "#{mod.token_to_sql(left)}#{mod.token_to_sql(right)}" + end + def token_to_sql({tag, _, [{:paren, _, _} = value]}, mod) when tag in ~w[numeric update]a do "#{mod.token_to_sql(tag)}#{mod.token_to_sql(value)}" end - def token_to_sql({tag, _, value}, _mod) when tag in ~w[ident integer float]a do - "#{value}" + def token_to_sql({:ident, [{:keyword, :non_reserved},{:tag, tag}|_], [{:paren, _, _} = value]}, mod) do + "#{mod.token_to_sql(tag)}#{mod.token_to_sql(value)}" end - def token_to_sql({tag, _}, mod) do - mod.token_to_sql(tag) + def token_to_sql({:ident, [{:keyword, :non_reserved}, {:tag, tag}|_], [{:numeric, _, _} = value]}, mod) do + "#{mod.token_to_sql(tag)} #{mod.token_to_sql(value)}" + end + def token_to_sql({_tag, [{:keyword, :non_reserved}|_], value}, mod) do + "#{mod.token_to_sql(value)}" + end + def token_to_sql({:numeric = tag, _, []}, mod), do: mod.token_to_sql(tag) + def token_to_sql({tag, _, value}, _mod) when tag in ~w[ident numeric]a do + value end def token_to_sql({:comment, _, value}, _mod) do - "-- #{value}" + "--#{value}" end def token_to_sql({:comments, _, value}, _mod) do - "\\* #{value} *\\" + "\\*#{value}*\\" end def token_to_sql({:double_quote, _, value}, _mod) do "\"#{value}\"" @@ -30,7 +43,7 @@ defmodule SQL.String do def token_to_sql({:quote, _, value}, _mod) do "'#{value}'" end - def token_to_sql({:parens, _, value}, mod) do + def token_to_sql({:paren, _, value}, mod) do "(#{mod.token_to_sql(value)})" end def token_to_sql({:bracket, _, value}, mod) do @@ -42,21 +55,36 @@ defmodule SQL.String do def token_to_sql({:comma, _, value}, mod) do ", #{mod.token_to_sql(value)}" end + def token_to_sql({:dot, _, [left, right]}, mod) do + "#{mod.token_to_sql(left)}.#{mod.token_to_sql(right)}" + end def token_to_sql({tag, _, []}, mod) do mod.token_to_sql(tag) end - def token_to_sql({tag, _, [[_ | _] = left, right]}, mod) when tag in ~w[join]a do + def token_to_sql({:join=tag, _, [right]}, mod) do + "#{mod.token_to_sql(tag)} #{mod.token_to_sql(right)}" + end + def token_to_sql({:join=tag, _, [{t, [{:keyword, :reserved}|_], _}=p, p1, p2, right]}, mod) when t != :as do + "#{mod.token_to_sql(p)} #{mod.token_to_sql(p1)} #{mod.token_to_sql(p2)} #{mod.token_to_sql(tag)} #{mod.token_to_sql(right)}" + end + def token_to_sql({:join=tag, _, [{t, [{:keyword, :reserved}|_], _}=p, p1, right]}, mod) when t != :as do + "#{mod.token_to_sql(p)} #{mod.token_to_sql(p1)} #{mod.token_to_sql(tag)} #{mod.token_to_sql(right)}" + end + def token_to_sql({:join=tag, _, [{t, [{:keyword, :reserved}|_], _}=left, right]}, mod) when t != :as do "#{mod.token_to_sql(left)} #{mod.token_to_sql(tag)} #{mod.token_to_sql(right)}" end def token_to_sql({tag, _, [{:with = t, _, [left, right]}]}, mod) when tag in ~w[to]a do "#{mod.token_to_sql(tag)} #{mod.token_to_sql(left)} #{mod.token_to_sql(t)} #{mod.token_to_sql(right)}" end - def token_to_sql({tag, _, value}, mod) when tag in ~w[select from fetch limit where order offset group having with join by distinct create type drop insert alter table add into delete update start grant revoke set declare open close commit rollback references recursive]a do + def token_to_sql({tag, _, value}, mod) when tag in ~w[select from fetch limit where order offset group having with join by distinct create type drop insert alter table add into delete update start grant revoke set declare open close commit rollback references recursive outer]a do "#{mod.token_to_sql(tag)} #{mod.token_to_sql(value)}" end def token_to_sql({:on = tag, _, [source, as, value]}, mod) do "#{mod.token_to_sql(source)} #{mod.token_to_sql(as)} #{mod.token_to_sql(tag)} #{mod.token_to_sql(value)}" end + def token_to_sql({:not = tag, _, [ident | values]}, mod) when values != [] do + "#{mod.token_to_sql(ident)} #{mod.token_to_sql(tag)} #{mod.token_to_sql(values)}" + end def token_to_sql({tag, _, [left, [{:all = t, _, right}]]}, mod) when tag in ~w[union except intersect]a do "#{mod.token_to_sql(left)} #{mod.token_to_sql(tag)} #{mod.token_to_sql(t)} #{mod.token_to_sql(right)}" end @@ -66,19 +94,13 @@ defmodule SQL.String do def token_to_sql({tag, _, [left, right]}, mod) when tag in ~w[:: [\] <> <= >= != || + - ^ * / % < > = like ilike as union except intersect between and or on is not in cursor for to]a do "#{mod.token_to_sql(left)} #{mod.token_to_sql(tag)} #{mod.token_to_sql(right)}" end - def token_to_sql({tag, _, [{:parens, _, _} = value]}, mod) when tag not in ~w[in on]a do + def token_to_sql({tag, _, [{:paren, _, _} = value]}, mod) when tag not in ~w[in on]a do "#{mod.token_to_sql(tag)}#{mod.token_to_sql(value)}" end - def token_to_sql({tag, _, values}, mod) when tag in ~w[not all between symmetric absolute relative forward backward on in for without]a do + def token_to_sql({tag, _, values}, mod) when tag in ~w[not all between asymmetric symmetric absolute relative forward backward on in for without]a do "#{mod.token_to_sql(tag)} #{mod.token_to_sql(values)}" end - def token_to_sql({tag, _, [left, right]}, mod) when tag in ~w[.]a do - "#{mod.token_to_sql(left)}.#{mod.token_to_sql(right)}" - end - def token_to_sql({tag, _, [left]}, mod) when tag in ~w[not]a do - "#{mod.token_to_sql(left)} #{mod.token_to_sql(tag)}" - end - def token_to_sql({tag, _, [left]}, mod) when tag in ~w[asc desc isnull notnull]a do + def token_to_sql({tag, _, [left]}, mod) when tag in ~w[asc desc isnull notnull not]a do "#{mod.token_to_sql(left)} #{mod.token_to_sql(tag)}" end def token_to_sql({:binding, _, [idx]}, _mod) when is_integer(idx) do @@ -87,7 +109,7 @@ defmodule SQL.String do def token_to_sql({:binding, _, value}, _mod) do "{{#{value}}}" end - def token_to_sql(:asterisk, _mod) do + def token_to_sql(:*, _mod) do "*" end def token_to_sql(value, _mod) when is_atom(value) do @@ -96,12 +118,15 @@ defmodule SQL.String do def token_to_sql(value, _mod) when is_binary(value) do "'#{value}'" end - def token_to_sql(values, mod) when is_list(values) do + def token_to_sql([h|_]=values, mod) when is_tuple(h) or is_tuple(hd(h)) do values |> Enum.reduce([], fn - token, [] = acc -> [acc | mod.token_to_sql(token, mod)] - {:comma, _, _} = token, acc -> [acc | mod.token_to_sql(token, mod)] - token, acc -> [acc, " " | mod.token_to_sql(token, mod)] + token, [] = acc -> [acc,mod.token_to_sql(token, mod)] + {:comma, _, _} = token, acc -> [acc,mod.token_to_sql(token, mod)] + token, acc -> [acc," ",mod.token_to_sql(token, mod)] end) end + def token_to_sql(value, _mod) do + value + end end diff --git a/mix.exs b/mix.exs index 0c7bf9c..229a6d6 100644 --- a/mix.exs +++ b/mix.exs @@ -45,6 +45,7 @@ defmodule SQL.MixProject do {:ex_doc, "~> 0.37", only: :dev}, {:postgrex, ">= 0.0.0", only: [:dev, :test]}, {:yamerl, ">= 0.0.0", only: [:dev, :test]}, + {:unicode_set, "~> 1.0"} ] end end diff --git a/mix.lock b/mix.lock index abc81ad..22123c7 100644 --- a/mix.lock +++ b/mix.lock @@ -14,5 +14,7 @@ "postgrex": {:hex, :postgrex, "0.20.0", "363ed03ab4757f6bc47942eff7720640795eb557e1935951c1626f0d303a3aed", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "d36ef8b36f323d29505314f704e21a1a038e2dc387c6409ee0cd24144e187c0f"}, "statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"}, "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, + "unicode": {:hex, :unicode, "1.20.0", "10189cfe98b03ebb8be6efd00df0936c1c94d75bfbd62cba2bdf958fef3ee4a7", [:mix], [], "hexpm", "fa581cf80b3b1b7f42e4d24a69109dfac465cec27a62c661306c81f4ab35894c"}, + "unicode_set": {:hex, :unicode_set, "1.5.0", "f2dcc40b1e8daf1a04433c705d9a8fb8ccdfc8fd5763a92d414a3e0775414cfb", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:unicode, "~> 1.13", [hex: :unicode, repo: "hexpm", optional: false]}], "hexpm", "6c7f200e52fb90434d6b783eaa4e0ea303cfc4844ea25b2fc1ba3eb8a6901b11"}, "yamerl": {:hex, :yamerl, "0.10.0", "4ff81fee2f1f6a46f1700c0d880b24d193ddb74bd14ef42cb0bcf46e81ef2f8e", [:rebar3], [], "hexpm", "346adb2963f1051dc837a2364e4acf6eb7d80097c0f53cbdc3046ec8ec4b4e6e"}, } diff --git a/test/adapters/ansi_test.exs b/test/adapters/ansi_test.exs index 07d2210..84d283d 100644 --- a/test/adapters/ansi_test.exs +++ b/test/adapters/ansi_test.exs @@ -162,14 +162,11 @@ defmodule SQL.Adapters.ANSITest do end describe "datatypes" do - test "integer" do + test "numeric" do assert "select 1" == to_string(~SQL[select 1]) assert "select 1000" == to_string(~SQL[select 1000]) assert "select -1000" == to_string(~SQL[select -1000]) assert "select +1000" == to_string(~SQL[select +1000]) - end - - test "float" do assert "select +10.00" == to_string(~SQL[select +10.00]) assert "select -10.00" == to_string(~SQL[select -10.00]) end diff --git a/test/adapters/mysql_test.exs b/test/adapters/mysql_test.exs index b6baec8..eebb166 100644 --- a/test/adapters/mysql_test.exs +++ b/test/adapters/mysql_test.exs @@ -162,14 +162,11 @@ defmodule SQL.Adapters.MySQLTest do end describe "datatypes" do - test "integer" do + test "numeric" do assert "select 1" == to_string(~SQL[select 1]) assert "select 1000" == to_string(~SQL[select 1000]) assert "select -1000" == to_string(~SQL[select -1000]) assert "select +1000" == to_string(~SQL[select +1000]) - end - - test "float" do assert "select +10.00" == to_string(~SQL[select +10.00]) assert "select -10.00" == to_string(~SQL[select -10.00]) end diff --git a/test/adapters/postgres_test.exs b/test/adapters/postgres_test.exs index 3a262fd..fc9bc74 100644 --- a/test/adapters/postgres_test.exs +++ b/test/adapters/postgres_test.exs @@ -162,14 +162,11 @@ defmodule SQL.Adapters.PostgresTest do end describe "datatypes" do - test "integer" do + test "numeric" do assert "select 1" == to_string(~SQL[select 1]) assert "select 1000" == to_string(~SQL[select 1000]) assert "select -1000" == to_string(~SQL[select -1000]) assert "select +1000" == to_string(~SQL[select +1000]) - end - - test "float" do assert "select +10.00" == to_string(~SQL[select +10.00]) assert "select -10.00" == to_string(~SQL[select -10.00]) end @@ -302,11 +299,8 @@ defmodule SQL.Adapters.PostgresTest do test "@@" do assert "where id @@ 1" == to_string(~SQL[where id @@ 1]) end - test "<->" do - assert "where id <-> 1" == to_string(~SQL[where id <-> 1]) - end test ">>=" do - assert "where id <-> 1" == to_string(~SQL[where id <-> 1]) + assert "where id >>= 1" == to_string(~SQL[where id >>= 1]) end test "-|-" do assert "where id -|- 1" == to_string(~SQL[where id -|- 1]) diff --git a/test/adapters/tds_test.exs b/test/adapters/tds_test.exs index 59032dc..3e7c00b 100644 --- a/test/adapters/tds_test.exs +++ b/test/adapters/tds_test.exs @@ -162,14 +162,11 @@ defmodule SQL.Adapters.TDSTest do end describe "datatypes" do - test "integer" do + test "numeric" do assert "select 1" == to_string(~SQL[select 1]) assert "select 1000" == to_string(~SQL[select 1000]) assert "select -1000" == to_string(~SQL[select -1000]) assert "select +1000" == to_string(~SQL[select +1000]) - end - - test "float" do assert "select +10.00" == to_string(~SQL[select +10.00]) assert "select -10.00" == to_string(~SQL[select -10.00]) end diff --git a/test/bnf_test.exs b/test/bnf_test.exs deleted file mode 100644 index 1b16f80..0000000 --- a/test/bnf_test.exs +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: 2025 DBVisor - -defmodule SQL.BNFTest do - use ExUnit.Case, async: true - - test "parse/1" do - assert %{"" => ""} == SQL.BNF.parse(""" - ::= - - """) - end -end diff --git a/test/formatter_test.exs b/test/formatter_test.exs index 1c7a6de..525aba1 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -9,6 +9,6 @@ defmodule SQL.FormatterTest do end test "format/2 preserve interpolation" do - assert "with recursive temp (n, fact) as (select 0, 1 union all select n + {{one}}, (n + {{one}}) * fact from temp where n < 9)" == SQL.MixFormatter.format("with recursive temp(n, fact) as (select 0, 1 union all select n + {{one}}, (n + {{one}}) * fact from temp where n < 9)", []) + assert "with recursive temp(n, fact) as (select 0, 1 union all select n + {{one}}, (n + {{one}}) * fact from temp where n < 9)" == SQL.MixFormatter.format("with recursive temp(n, fact) as (select 0, 1 union all select n + {{one}}, (n + {{one}}) * fact from temp where n < 9)", []) end end diff --git a/test/sql_test.exs b/test/sql_test.exs index 67c5a95..c07c4e1 100644 --- a/test/sql_test.exs +++ b/test/sql_test.exs @@ -16,10 +16,10 @@ defmodule SQLTest do describe "composable" do test "pipedream" do sql = ~SQL[from users u] - |> ~SQL[where u.email = "john@example.com"] + |> ~SQL{where u.email = 'john@example.com'} |> ~SQL[select id, email, inserted_at, updated_at] - assert ~s(select id, email, inserted_at, updated_at from users u where u.email = "john@example.com") == to_string(sql) + assert ~s(select id, email, inserted_at, updated_at from users u where u.email = 'john@example.com') == to_string(sql) end test "functional" do @@ -167,9 +167,7 @@ defmodule SQLTest do from top_customers tc order by tc.spending_rank ] - - output = to_string(sql) - assert output == "with customer_rankings as(select customer_id, sum(amount) as total_spent, rank() over(order by sum(amount) desc) as spending_rank from transactions group by customer_id), top_customers as(select c.customer_id, c.name, cr.total_spent, cr.spending_rank from customer_rankings cr join customers c on c.customer_id = cr.customer_id where cr.spending_rank <= 10) select tc.name, tc.total_spent, tc.spending_rank from top_customers tc order by tc.spending_rank" + assert "with customer_rankings as(select customer_id, sum(amount) as total_spent, rank() over(order by sum(amount) desc) as spending_rank from transactions group by customer_id), top_customers as(select c.customer_id, c.name, cr.total_spent, cr.spending_rank from customer_rankings cr join customers c on c.customer_id = cr.customer_id where cr.spending_rank <= 10) select tc.name, tc.total_spent, tc.spending_rank from top_customers tc order by tc.spending_rank" == to_string(sql) end test "complex with multiple ctes" do @@ -204,9 +202,7 @@ defmodule SQLTest do from top_customers tc order by tc.spending_rank, tc.month ] - - output = to_string(sql) - assert output == "with customer_rankings as(select customer_id, sum(amount) as total_spent, rank() over(order by sum(amount) desc) as spending_rank from transactions group by customer_id), top_customers as(select c.customer_id, c.name, cr.total_spent, cr.spending_rank from customer_rankings cr join customers c on c.customer_id = cr.customer_id where cr.spending_rank <= 10) select tc.name, tc.total_spent, tc.spending_rank, case when tc.total_spent > tc.avg_amount * 2 then 'High Value' when tc.total_spent > tc.avg_amount then 'Medium Value' else 'Low Value' end as customer_segment from top_customers tc order by tc.spending_rank, tc.month" + assert "with customer_rankings as(select customer_id, sum(amount) as total_spent, rank() over(order by sum(amount) desc) as spending_rank from transactions group by customer_id), top_customers as(select c.customer_id, c.name, cr.total_spent, cr.spending_rank from customer_rankings cr join customers c on c.customer_id = cr.customer_id where cr.spending_rank <= 10) select tc.name, tc.total_spent, tc.spending_rank, case when tc.total_spent > tc.avg_amount * 2 then 'High Value' when tc.total_spent > tc.avg_amount then 'Medium Value' else 'Low Value' end as customer_segment from top_customers tc order by tc.spending_rank, tc.month" == to_string(sql) end end @@ -357,14 +353,11 @@ defmodule SQLTest do end describe "datatypes" do - test "integer" do + test "numeric" do assert "select 1" == to_string(~SQL[select 1]) assert "select 1000" == to_string(~SQL[select 1000]) assert "select -1000" == to_string(~SQL[select -1000]) assert "select +1000" == to_string(~SQL[select +1000]) - end - - test "float" do assert "select +10.00" == to_string(~SQL[select +10.00]) assert "select -10.00" == to_string(~SQL[select -10.00]) end @@ -375,7 +368,7 @@ defmodule SQLTest do assert "select db" == to_string(~SQL[select db]) end - test "qouted" do + test "quoted" do assert "select \"db.users.id\"" == to_string(~SQL[select "db.users.id"]) assert "select 'db.users'" == to_string(~SQL[select 'db.users']) assert "select \"db.users.id\", 'db.users'" == to_string(~SQL[select "db.users.id", 'db.users'])