diff --git a/lib/query_builder.ex b/lib/query_builder.ex index 1f372fa..1fa4d06 100644 --- a/lib/query_builder.ex +++ b/lib/query_builder.ex @@ -3,105 +3,80 @@ defmodule KinoEcto.QueryBuilder do import Ecto.Query alias KinoEcto.QueryBuilder.Renderer - defmodule MyParser do - import NimbleParsec - - @alphanumeric [?a..?z, ?A..?Z, ?0..?9, ?_, ?*, ?.] - @string_prefix [?'] - - whitespace = ascii_string([?\s, ?\n], min: 1) - select_choice = choice([string("SELECT"), string("select")]) - from_choice = choice([string("FROM"), string("from")]) - join_choice = choice([string("JOIN"), string("join")]) - on_choice = choice([string("ON"), string("on")]) - where_choice = choice([string("WHERE"), string("where")]) - comparisson_choice = choice([string("="), string(">="), string("<="), string("<>")]) - - from_part = - select_choice - |> ignore(whitespace) - |> ascii_string(@alphanumeric, min: 1) - |> ignore(whitespace) - |> optional(from_choice) - |> ignore(whitespace) - |> optional(ascii_string(@alphanumeric, min: 1)) - - join_part = - ignore(from_part) - |> ignore(whitespace) - |> optional(join_choice) - |> ignore(whitespace) - |> ascii_string(@alphanumeric, min: 1) - |> ignore(whitespace) - |> optional(on_choice) - |> ignore(whitespace) - |> ascii_string(@alphanumeric, min: 1) - |> ignore(whitespace) - |> string("=") - |> ignore(whitespace) - |> ascii_string(@alphanumeric, min: 1) - |> optional(ignore(whitespace)) - - where_part = - ignore(from_part) - |> optional(ignore(join_part)) - |> ignore(whitespace) - |> optional(where_choice) - |> ignore(whitespace) - |> ascii_string(@alphanumeric, min: 1) - |> ignore(whitespace) - |> optional(comparisson_choice) - |> ignore(whitespace) - |> optional(ascii_string(@string_prefix, min: 0, max: 1)) - |> ascii_string(@alphanumeric, min: 1) - |> optional(ascii_string(@string_prefix, min: 0, max: 1)) - - defparsec(:from_part, from_part) - defparsec(:join_part, optional(join_part)) - defparsec(:where_part, where_part) + # def call(%__MODULE__{sql_query: query}) do + # query = String.downcase(query) + # {:ok, tokens, _} = :build_query_lexer.string(query) + # {:ok, ast} = :build_query_parser.parse(tokens) + # ast + # end + + defmodule KinoEcto.QueryBuilder.Node do + defstruct [:name, :value, :lhs, :rhs] end - def test(query) do - from_part = MyParser.from_part(query) - join_part = MyParser.join_part(query) - where_part = MyParser.where_part(query) + def call(query) do + query = + query + |> String.downcase() + |> String.to_charlist() - [elem(from_part, 1), elem(join_part, 1), elem(where_part, 1)] - end + {:ok, tokens, _} = :build_query_lexer.string(query) + {:ok, ast} = :build_query_parser.parse(tokens) - def call(%__MODULE__{sql_query: query}) do - from_part = MyParser.from_part(query) - join_part = MyParser.join_part(query) - where_part = MyParser.where_part(query) + ast + |> cleanup() + |> build_query() - from = elem(from_part, 1) - join_part = elem(join_part, 1) - where_part = elem(where_part, 1) - # [, elem(join_part, 1), elem(where_part, 1)] + # [:select, [:fields, [:all]], [:from, ["customers"]]] + # [:select, [:fields, ["name", "age"]], [:from, ["customers"]]] + end - build_from(from) - |> build_join(join_part) - |> build_where(where_part) - |> Renderer.call() + defp cleanup(ast) when is_tuple(ast) do + ast + |> Tuple.to_list() + |> Enum.map(&cleanup/1) + |> Enum.reject(&is_nil/1) end - defp build_from(from_part) do - result = %Ecto.Query{ - from: %Ecto.Query.FromExpr{ - source: get_source(List.last(from_part)) - } - } + defp cleanup(ast) when is_list(ast), do: to_string(ast) + defp cleanup(ast), do: ast + + defp build_query(ast) do + dbg() - Ecto.Query.from(result) + ast + |> Enum.reduce(%Ecto.Query{}, fn item, acc -> + acc = do_build_query(item, acc) + acc + end) end - defp build_join(query, []), do: query + defp do_build_query(:select, query), do: query + + defp do_build_query([:fields, [:all]], query), do: query + + defp do_build_query([:fields, fields], query) do + flatten_fields = List.flatten(fields) |> Enum.map(&String.to_atom/1) - defp build_join(query, _join_part) do query + |> select(^flatten_fields) end - defp build_where(query, []), do: query + defp do_build_query([:from, [table]], query) do + query + |> build_from(table) + end + + defp build_from(query, from_part) do + result = %{ + query + | from: %Ecto.Query.FromExpr{ + source: get_source(from_part) + } + } + + result + end defp build_where(query, [_where, field_name, "=" | tail]) do tail = tail |> Enum.join() |> String.replace("'", "") @@ -114,6 +89,7 @@ defmodule KinoEcto.QueryBuilder do {:ok, modules} = :application.get_key(:kino_ecto, :modules) modules + |> Enum.reject(fn item -> item == :build_query_lexer || item == :build_query_parser end) |> Enum.filter(&({:__schema__, 1} in &1.__info__(:functions))) |> Enum.find(fn module -> module.__schema__(:source) == table_name end) |> then(fn schema -> {table_name, schema} end) @@ -149,14 +125,14 @@ defmodule KinoEcto.QueryBuilder do # %Ecto.Query.BooleanExpr{ # end - # defp get_source(table_name) do - # {:ok, modules} = :application.get_key(:kino_ecto, :modules) + # defp get_source(table_name) do + # {:ok, modules} = :application.get_key(:kino_ecto, :modules) - # modules - # |> Enum.filter(&({:__schema__, 1} in &1.__info__(:functions))) - # |> Enum.find(fn module -> module.__schema__(:source) == table_name end) - # |> IO.inspect() - # |> then(fn schema -> {table_name, schema} end) - # end + # modules + # |> Enum.filter(&({:__schema__, 1} in &1.__info__(:functions))) + # |> Enum.find(fn module -> module.__schema__(:source) == table_name end) + # |> IO.inspect() + # |> then(fn schema -> {table_name, schema} end) + # end # end end diff --git a/lib/query_builder/domain/customer.ex b/lib/query_builder/domain/customer.ex new file mode 100644 index 0000000..147cbd2 --- /dev/null +++ b/lib/query_builder/domain/customer.ex @@ -0,0 +1,9 @@ +defmodule KinoEcto.QueryBuilder.Domain.Customer do + use Ecto.Schema + + schema "customers" do + field(:name, :string) + field(:age, :string) + has_many(:sales, KinoEcto.QueryBuilder.Domain.Sale) + end +end diff --git a/lib/query_builder/domain/sale.ex b/lib/query_builder/domain/sale.ex new file mode 100644 index 0000000..cd2513b --- /dev/null +++ b/lib/query_builder/domain/sale.ex @@ -0,0 +1,8 @@ +defmodule KinoEcto.QueryBuilder.Domain.Sale do + use Ecto.Schema + + schema "sales" do + field(:total, :string) + belongs_to(:customer, KinoEcto.QueryBuilder.Domain.Customer) + end +end diff --git a/src/build_query_lexer.erl b/src/build_query_lexer.erl new file mode 100644 index 0000000..03d3057 --- /dev/null +++ b/src/build_query_lexer.erl @@ -0,0 +1,1722 @@ +-file("/Users/thiago/.asdf/installs/erlang/25.0.3/lib/parsetools-2.4/include/leexinc.hrl", 0). +%% The source of this file is part of leex distribution, as such it +%% has the same Copyright as the other files in the leex +%% distribution. The Copyright is defined in the accompanying file +%% COPYRIGHT. However, the resultant scanner generated by leex is the +%% property of the creator of the scanner and is not covered by that +%% Copyright. + +-module(build_query_lexer). + +-export([string/1,string/2,token/2,token/3,tokens/2,tokens/3]). +-export([format_error/1]). + +%% User code. This is placed here to allow extra attributes. +-file("src/build_query_lexer.xrl", 65). + +oid(Oid) -> + S = tl(lists:droplast(Oid)), + L = string:split(S, ".", all), + lists:map(fun list_to_integer/1, L). + +-file("/Users/thiago/.asdf/installs/erlang/25.0.3/lib/parsetools-2.4/include/leexinc.hrl", 14). + +format_error({illegal,S}) -> ["illegal characters ",io_lib:write_string(S)]; +format_error({user,S}) -> S. + +string(String) -> string(String, 1). + +string(String, Line) -> string(String, Line, String, []). + +%% string(InChars, Line, TokenChars, Tokens) -> +%% {ok,Tokens,Line} | {error,ErrorInfo,Line}. +%% Note the line number going into yystate, L0, is line of token +%% start while line number returned is line of token end. We want line +%% of token start. + +string([], L, [], Ts) -> % No partial tokens! + {ok,yyrev(Ts),L}; +string(Ics0, L0, Tcs, Ts) -> + case yystate(yystate(), Ics0, L0, 0, reject, 0) of + {A,Alen,Ics1,L1} -> % Accepting end state + string_cont(Ics1, L1, yyaction(A, Alen, Tcs, L0), Ts); + {A,Alen,Ics1,L1,_S1} -> % Accepting transition state + string_cont(Ics1, L1, yyaction(A, Alen, Tcs, L0), Ts); + {reject,_Alen,Tlen,_Ics1,L1,_S1} -> % After a non-accepting state + {error,{L0,?MODULE,{illegal,yypre(Tcs, Tlen+1)}},L1}; + {A,Alen,Tlen,_Ics1,L1,_S1} -> + Tcs1 = yysuf(Tcs, Alen), + L2 = adjust_line(Tlen, Alen, Tcs1, L1), + string_cont(Tcs1, L2, yyaction(A, Alen, Tcs, L0), Ts) + end. + +%% string_cont(RestChars, Line, Token, Tokens) +%% Test for and remove the end token wrapper. Push back characters +%% are prepended to RestChars. + +-dialyzer({nowarn_function, string_cont/4}). + +string_cont(Rest, Line, {token,T}, Ts) -> + string(Rest, Line, Rest, [T|Ts]); +string_cont(Rest, Line, {token,T,Push}, Ts) -> + NewRest = Push ++ Rest, + string(NewRest, Line, NewRest, [T|Ts]); +string_cont(Rest, Line, {end_token,T}, Ts) -> + string(Rest, Line, Rest, [T|Ts]); +string_cont(Rest, Line, {end_token,T,Push}, Ts) -> + NewRest = Push ++ Rest, + string(NewRest, Line, NewRest, [T|Ts]); +string_cont(Rest, Line, skip_token, Ts) -> + string(Rest, Line, Rest, Ts); +string_cont(Rest, Line, {skip_token,Push}, Ts) -> + NewRest = Push ++ Rest, + string(NewRest, Line, NewRest, Ts); +string_cont(_Rest, Line, {error,S}, _Ts) -> + {error,{Line,?MODULE,{user,S}},Line}. + +%% token(Continuation, Chars) -> +%% token(Continuation, Chars, Line) -> +%% {more,Continuation} | {done,ReturnVal,RestChars}. +%% Must be careful when re-entering to append the latest characters to the +%% after characters in an accept. The continuation is: +%% {token,State,CurrLine,TokenChars,TokenLen,TokenLine,AccAction,AccLen} + +token(Cont, Chars) -> token(Cont, Chars, 1). + +token([], Chars, Line) -> + token(yystate(), Chars, Line, Chars, 0, Line, reject, 0); +token({token,State,Line,Tcs,Tlen,Tline,Action,Alen}, Chars, _) -> + token(State, Chars, Line, Tcs ++ Chars, Tlen, Tline, Action, Alen). + +%% token(State, InChars, Line, TokenChars, TokenLen, TokenLine, +%% AcceptAction, AcceptLen) -> +%% {more,Continuation} | {done,ReturnVal,RestChars}. +%% The argument order is chosen to be more efficient. + +token(S0, Ics0, L0, Tcs, Tlen0, Tline, A0, Alen0) -> + case yystate(S0, Ics0, L0, Tlen0, A0, Alen0) of + %% Accepting end state, we have a token. + {A1,Alen1,Ics1,L1} -> + token_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline)); + %% Accepting transition state, can take more chars. + {A1,Alen1,[],L1,S1} -> % Need more chars to check + {more,{token,S1,L1,Tcs,Alen1,Tline,A1,Alen1}}; + {A1,Alen1,Ics1,L1,_S1} -> % Take what we got + token_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline)); + %% After a non-accepting state, maybe reach accept state later. + {A1,Alen1,Tlen1,[],L1,S1} -> % Need more chars to check + {more,{token,S1,L1,Tcs,Tlen1,Tline,A1,Alen1}}; + {reject,_Alen1,Tlen1,eof,L1,_S1} -> % No token match + %% Check for partial token which is error. + Ret = if Tlen1 > 0 -> {error,{Tline,?MODULE, + %% Skip eof tail in Tcs. + {illegal,yypre(Tcs, Tlen1)}},L1}; + true -> {eof,L1} + end, + {done,Ret,eof}; + {reject,_Alen1,Tlen1,Ics1,L1,_S1} -> % No token match + Error = {Tline,?MODULE,{illegal,yypre(Tcs, Tlen1+1)}}, + {done,{error,Error,L1},Ics1}; + {A1,Alen1,Tlen1,_Ics1,L1,_S1} -> % Use last accept match + Tcs1 = yysuf(Tcs, Alen1), + L2 = adjust_line(Tlen1, Alen1, Tcs1, L1), + token_cont(Tcs1, L2, yyaction(A1, Alen1, Tcs, Tline)) + end. + +%% token_cont(RestChars, Line, Token) +%% If we have a token or error then return done, else if we have a +%% skip_token then continue. + +-dialyzer({nowarn_function, token_cont/3}). + +token_cont(Rest, Line, {token,T}) -> + {done,{ok,T,Line},Rest}; +token_cont(Rest, Line, {token,T,Push}) -> + NewRest = Push ++ Rest, + {done,{ok,T,Line},NewRest}; +token_cont(Rest, Line, {end_token,T}) -> + {done,{ok,T,Line},Rest}; +token_cont(Rest, Line, {end_token,T,Push}) -> + NewRest = Push ++ Rest, + {done,{ok,T,Line},NewRest}; +token_cont(Rest, Line, skip_token) -> + token(yystate(), Rest, Line, Rest, 0, Line, reject, 0); +token_cont(Rest, Line, {skip_token,Push}) -> + NewRest = Push ++ Rest, + token(yystate(), NewRest, Line, NewRest, 0, Line, reject, 0); +token_cont(Rest, Line, {error,S}) -> + {done,{error,{Line,?MODULE,{user,S}},Line},Rest}. + +%% tokens(Continuation, Chars, Line) -> +%% {more,Continuation} | {done,ReturnVal,RestChars}. +%% Must be careful when re-entering to append the latest characters to the +%% after characters in an accept. The continuation is: +%% {tokens,State,CurrLine,TokenChars,TokenLen,TokenLine,Tokens,AccAction,AccLen} +%% {skip_tokens,State,CurrLine,TokenChars,TokenLen,TokenLine,Error,AccAction,AccLen} + +tokens(Cont, Chars) -> tokens(Cont, Chars, 1). + +tokens([], Chars, Line) -> + tokens(yystate(), Chars, Line, Chars, 0, Line, [], reject, 0); +tokens({tokens,State,Line,Tcs,Tlen,Tline,Ts,Action,Alen}, Chars, _) -> + tokens(State, Chars, Line, Tcs ++ Chars, Tlen, Tline, Ts, Action, Alen); +tokens({skip_tokens,State,Line,Tcs,Tlen,Tline,Error,Action,Alen}, Chars, _) -> + skip_tokens(State, Chars, Line, Tcs ++ Chars, Tlen, Tline, Error, Action, Alen). + +%% tokens(State, InChars, Line, TokenChars, TokenLen, TokenLine, Tokens, +%% AcceptAction, AcceptLen) -> +%% {more,Continuation} | {done,ReturnVal,RestChars}. + +tokens(S0, Ics0, L0, Tcs, Tlen0, Tline, Ts, A0, Alen0) -> + case yystate(S0, Ics0, L0, Tlen0, A0, Alen0) of + %% Accepting end state, we have a token. + {A1,Alen1,Ics1,L1} -> + tokens_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline), Ts); + %% Accepting transition state, can take more chars. + {A1,Alen1,[],L1,S1} -> % Need more chars to check + {more,{tokens,S1,L1,Tcs,Alen1,Tline,Ts,A1,Alen1}}; + {A1,Alen1,Ics1,L1,_S1} -> % Take what we got + tokens_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline), Ts); + %% After a non-accepting state, maybe reach accept state later. + {A1,Alen1,Tlen1,[],L1,S1} -> % Need more chars to check + {more,{tokens,S1,L1,Tcs,Tlen1,Tline,Ts,A1,Alen1}}; + {reject,_Alen1,Tlen1,eof,L1,_S1} -> % No token match + %% Check for partial token which is error, no need to skip here. + Ret = if Tlen1 > 0 -> {error,{Tline,?MODULE, + %% Skip eof tail in Tcs. + {illegal,yypre(Tcs, Tlen1)}},L1}; + Ts == [] -> {eof,L1}; + true -> {ok,yyrev(Ts),L1} + end, + {done,Ret,eof}; + {reject,_Alen1,Tlen1,_Ics1,L1,_S1} -> + %% Skip rest of tokens. + Error = {L1,?MODULE,{illegal,yypre(Tcs, Tlen1+1)}}, + skip_tokens(yysuf(Tcs, Tlen1+1), L1, Error); + {A1,Alen1,Tlen1,_Ics1,L1,_S1} -> + Token = yyaction(A1, Alen1, Tcs, Tline), + Tcs1 = yysuf(Tcs, Alen1), + L2 = adjust_line(Tlen1, Alen1, Tcs1, L1), + tokens_cont(Tcs1, L2, Token, Ts) + end. + +%% tokens_cont(RestChars, Line, Token, Tokens) +%% If we have an end_token or error then return done, else if we have +%% a token then save it and continue, else if we have a skip_token +%% just continue. + +-dialyzer({nowarn_function, tokens_cont/4}). + +tokens_cont(Rest, Line, {token,T}, Ts) -> + tokens(yystate(), Rest, Line, Rest, 0, Line, [T|Ts], reject, 0); +tokens_cont(Rest, Line, {token,T,Push}, Ts) -> + NewRest = Push ++ Rest, + tokens(yystate(), NewRest, Line, NewRest, 0, Line, [T|Ts], reject, 0); +tokens_cont(Rest, Line, {end_token,T}, Ts) -> + {done,{ok,yyrev(Ts, [T]),Line},Rest}; +tokens_cont(Rest, Line, {end_token,T,Push}, Ts) -> + NewRest = Push ++ Rest, + {done,{ok,yyrev(Ts, [T]),Line},NewRest}; +tokens_cont(Rest, Line, skip_token, Ts) -> + tokens(yystate(), Rest, Line, Rest, 0, Line, Ts, reject, 0); +tokens_cont(Rest, Line, {skip_token,Push}, Ts) -> + NewRest = Push ++ Rest, + tokens(yystate(), NewRest, Line, NewRest, 0, Line, Ts, reject, 0); +tokens_cont(Rest, Line, {error,S}, _Ts) -> + skip_tokens(Rest, Line, {Line,?MODULE,{user,S}}). + +%%skip_tokens(InChars, Line, Error) -> {done,{error,Error,Line},Ics}. +%% Skip tokens until an end token, junk everything and return the error. + +skip_tokens(Ics, Line, Error) -> + skip_tokens(yystate(), Ics, Line, Ics, 0, Line, Error, reject, 0). + +%% skip_tokens(State, InChars, Line, TokenChars, TokenLen, TokenLine, Tokens, +%% AcceptAction, AcceptLen) -> +%% {more,Continuation} | {done,ReturnVal,RestChars}. + +skip_tokens(S0, Ics0, L0, Tcs, Tlen0, Tline, Error, A0, Alen0) -> + case yystate(S0, Ics0, L0, Tlen0, A0, Alen0) of + {A1,Alen1,Ics1,L1} -> % Accepting end state + skip_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline), Error); + {A1,Alen1,[],L1,S1} -> % After an accepting state + {more,{skip_tokens,S1,L1,Tcs,Alen1,Tline,Error,A1,Alen1}}; + {A1,Alen1,Ics1,L1,_S1} -> + skip_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline), Error); + {A1,Alen1,Tlen1,[],L1,S1} -> % After a non-accepting state + {more,{skip_tokens,S1,L1,Tcs,Tlen1,Tline,Error,A1,Alen1}}; + {reject,_Alen1,_Tlen1,eof,L1,_S1} -> + {done,{error,Error,L1},eof}; + {reject,_Alen1,Tlen1,_Ics1,L1,_S1} -> + skip_tokens(yysuf(Tcs, Tlen1+1), L1, Error); + {A1,Alen1,Tlen1,_Ics1,L1,_S1} -> + Token = yyaction(A1, Alen1, Tcs, Tline), + Tcs1 = yysuf(Tcs, Alen1), + L2 = adjust_line(Tlen1, Alen1, Tcs1, L1), + skip_cont(Tcs1, L2, Token, Error) + end. + +%% skip_cont(RestChars, Line, Token, Error) +%% Skip tokens until we have an end_token or error then return done +%% with the original rror. + +-dialyzer({nowarn_function, skip_cont/4}). + +skip_cont(Rest, Line, {token,_T}, Error) -> + skip_tokens(yystate(), Rest, Line, Rest, 0, Line, Error, reject, 0); +skip_cont(Rest, Line, {token,_T,Push}, Error) -> + NewRest = Push ++ Rest, + skip_tokens(yystate(), NewRest, Line, NewRest, 0, Line, Error, reject, 0); +skip_cont(Rest, Line, {end_token,_T}, Error) -> + {done,{error,Error,Line},Rest}; +skip_cont(Rest, Line, {end_token,_T,Push}, Error) -> + NewRest = Push ++ Rest, + {done,{error,Error,Line},NewRest}; +skip_cont(Rest, Line, skip_token, Error) -> + skip_tokens(yystate(), Rest, Line, Rest, 0, Line, Error, reject, 0); +skip_cont(Rest, Line, {skip_token,Push}, Error) -> + NewRest = Push ++ Rest, + skip_tokens(yystate(), NewRest, Line, NewRest, 0, Line, Error, reject, 0); +skip_cont(Rest, Line, {error,_S}, Error) -> + skip_tokens(yystate(), Rest, Line, Rest, 0, Line, Error, reject, 0). + +-compile({nowarn_unused_function, [yyrev/1, yyrev/2, yypre/2, yysuf/2]}). + +yyrev(List) -> lists:reverse(List). +yyrev(List, Tail) -> lists:reverse(List, Tail). +yypre(List, N) -> lists:sublist(List, N). +yysuf(List, N) -> lists:nthtail(N, List). + +%% adjust_line(TokenLength, AcceptLength, Chars, Line) -> NewLine +%% Make sure that newlines in Chars are not counted twice. +%% Line has been updated with respect to newlines in the prefix of +%% Chars consisting of (TokenLength - AcceptLength) characters. + +-compile({nowarn_unused_function, adjust_line/4}). + +adjust_line(N, N, _Cs, L) -> L; +adjust_line(T, A, [$\n|Cs], L) -> + adjust_line(T-1, A, Cs, L-1); +adjust_line(T, A, [_|Cs], L) -> + adjust_line(T-1, A, Cs, L). + +%% yystate() -> InitialState. +%% yystate(State, InChars, Line, CurrTokLen, AcceptAction, AcceptLen) -> +%% {Action, AcceptLen, RestChars, Line} | +%% {Action, AcceptLen, RestChars, Line, State} | +%% {reject, AcceptLen, CurrTokLen, RestChars, Line, State} | +%% {Action, AcceptLen, CurrTokLen, RestChars, Line, State}. +%% Generated state transition functions. The non-accepting end state +%% return signal either an unrecognised character or end of current +%% input. + +-file("src/build_query_lexer.erl", 312). +yystate() -> 101. + +yystate(104, [110|Ics], Line, Tlen, _, _) -> + yystate(100, Ics, Line, Tlen+1, 8, Tlen); +yystate(104, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 8, Tlen); +yystate(104, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 8, Tlen); +yystate(104, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 8, Tlen); +yystate(104, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 109 -> + yystate(77, Ics, Line, Tlen+1, 8, Tlen); +yystate(104, [C|Ics], Line, Tlen, _, _) when C >= 111, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 8, Tlen); +yystate(104, Ics, Line, Tlen, _, _) -> + {8,Tlen,Ics,Line,104}; +yystate(103, [32|Ics], Line, Tlen, _, _) -> + yystate(103, Ics, Line, Tlen+1, 36, Tlen); +yystate(103, [13|Ics], Line, Tlen, _, _) -> + yystate(103, Ics, Line, Tlen+1, 36, Tlen); +yystate(103, [9|Ics], Line, Tlen, _, _) -> + yystate(103, Ics, Line, Tlen+1, 36, Tlen); +yystate(103, [10|Ics], Line, Tlen, _, _) -> + yystate(103, Ics, Line+1, Tlen+1, 36, Tlen); +yystate(103, Ics, Line, Tlen, _, _) -> + {36,Tlen,Ics,Line,103}; +yystate(102, [110|Ics], Line, Tlen, _, _) -> + yystate(104, Ics, Line, Tlen+1, 33, Tlen); +yystate(102, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(102, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(102, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(102, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 109 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(102, [C|Ics], Line, Tlen, _, _) when C >= 111, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(102, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,102}; +yystate(101, [119|Ics], Line, Tlen, Action, Alen) -> + yystate(97, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [117|Ics], Line, Tlen, Action, Alen) -> + yystate(77, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [118|Ics], Line, Tlen, Action, Alen) -> + yystate(77, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [116|Ics], Line, Tlen, Action, Alen) -> + yystate(73, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [115|Ics], Line, Tlen, Action, Alen) -> + yystate(57, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [114|Ics], Line, Tlen, Action, Alen) -> + yystate(25, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [112|Ics], Line, Tlen, Action, Alen) -> + yystate(77, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [113|Ics], Line, Tlen, Action, Alen) -> + yystate(77, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [111|Ics], Line, Tlen, Action, Alen) -> + yystate(14, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [110|Ics], Line, Tlen, Action, Alen) -> + yystate(26, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [109|Ics], Line, Tlen, Action, Alen) -> + yystate(77, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [108|Ics], Line, Tlen, Action, Alen) -> + yystate(38, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [107|Ics], Line, Tlen, Action, Alen) -> + yystate(77, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [106|Ics], Line, Tlen, Action, Alen) -> + yystate(86, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [105|Ics], Line, Tlen, Action, Alen) -> + yystate(102, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [103|Ics], Line, Tlen, Action, Alen) -> + yystate(77, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [104|Ics], Line, Tlen, Action, Alen) -> + yystate(77, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [102|Ics], Line, Tlen, Action, Alen) -> + yystate(68, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [100|Ics], Line, Tlen, Action, Alen) -> + yystate(77, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [101|Ics], Line, Tlen, Action, Alen) -> + yystate(77, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [99|Ics], Line, Tlen, Action, Alen) -> + yystate(36, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [98|Ics], Line, Tlen, Action, Alen) -> + yystate(16, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [97|Ics], Line, Tlen, Action, Alen) -> + yystate(11, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [93|Ics], Line, Tlen, Action, Alen) -> + yystate(27, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [91|Ics], Line, Tlen, Action, Alen) -> + yystate(31, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [62|Ics], Line, Tlen, Action, Alen) -> + yystate(35, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [61|Ics], Line, Tlen, Action, Alen) -> + yystate(43, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [60|Ics], Line, Tlen, Action, Alen) -> + yystate(47, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [46|Ics], Line, Tlen, Action, Alen) -> + yystate(59, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [44|Ics], Line, Tlen, Action, Alen) -> + yystate(63, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [42|Ics], Line, Tlen, Action, Alen) -> + yystate(67, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [41|Ics], Line, Tlen, Action, Alen) -> + yystate(71, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [40|Ics], Line, Tlen, Action, Alen) -> + yystate(75, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [39|Ics], Line, Tlen, Action, Alen) -> + yystate(83, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [34|Ics], Line, Tlen, Action, Alen) -> + yystate(91, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [33|Ics], Line, Tlen, Action, Alen) -> + yystate(95, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [32|Ics], Line, Tlen, Action, Alen) -> + yystate(103, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [13|Ics], Line, Tlen, Action, Alen) -> + yystate(103, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [9|Ics], Line, Tlen, Action, Alen) -> + yystate(103, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [10|Ics], Line, Tlen, Action, Alen) -> + yystate(103, Ics, Line+1, Tlen+1, Action, Alen); +yystate(101, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 -> + yystate(55, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, Action, Alen); +yystate(101, [C|Ics], Line, Tlen, Action, Alen) when C >= 120, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, Action, Alen); +yystate(101, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,101}; +yystate(100, [101|Ics], Line, Tlen, _, _) -> + yystate(96, Ics, Line, Tlen+1, 33, Tlen); +yystate(100, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(100, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(100, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(100, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 100 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(100, [C|Ics], Line, Tlen, _, _) when C >= 102, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(100, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,100}; +yystate(99, Ics, Line, Tlen, _, _) -> + {2,Tlen,Ics,Line}; +yystate(98, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 28, Tlen); +yystate(98, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 28, Tlen); +yystate(98, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 28, Tlen); +yystate(98, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 28, Tlen); +yystate(98, Ics, Line, Tlen, _, _) -> + {28,Tlen,Ics,Line,98}; +yystate(97, [104|Ics], Line, Tlen, _, _) -> + yystate(93, Ics, Line, Tlen+1, 33, Tlen); +yystate(97, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(97, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(97, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(97, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 103 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(97, [C|Ics], Line, Tlen, _, _) when C >= 105, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(97, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,97}; +yystate(96, [114|Ics], Line, Tlen, _, _) -> + yystate(92, Ics, Line, Tlen+1, 33, Tlen); +yystate(96, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(96, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(96, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(96, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 113 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(96, [C|Ics], Line, Tlen, _, _) when C >= 115, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(96, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,96}; +yystate(95, [61|Ics], Line, Tlen, Action, Alen) -> + yystate(99, Ics, Line, Tlen+1, Action, Alen); +yystate(95, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,95}; +yystate(94, [110|Ics], Line, Tlen, _, _) -> + yystate(98, Ics, Line, Tlen+1, 33, Tlen); +yystate(94, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(94, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(94, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(94, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 109 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(94, [C|Ics], Line, Tlen, _, _) when C >= 111, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(94, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,94}; +yystate(93, [101|Ics], Line, Tlen, _, _) -> + yystate(89, Ics, Line, Tlen+1, 33, Tlen); +yystate(93, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(93, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(93, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(93, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 100 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(93, [C|Ics], Line, Tlen, _, _) when C >= 102, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(93, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,93}; +yystate(92, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(92, [32|Ics], Line, Tlen, _, _) -> + yystate(88, Ics, Line, Tlen+1, 33, Tlen); +yystate(92, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(92, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(92, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(92, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,92}; +yystate(91, [34|Ics], Line, Tlen, Action, Alen) -> + yystate(87, Ics, Line, Tlen+1, Action, Alen); +yystate(91, [10|Ics], Line, Tlen, Action, Alen) -> + yystate(91, Ics, Line+1, Tlen+1, Action, Alen); +yystate(91, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> + yystate(91, Ics, Line, Tlen+1, Action, Alen); +yystate(91, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 33 -> + yystate(91, Ics, Line, Tlen+1, Action, Alen); +yystate(91, [C|Ics], Line, Tlen, Action, Alen) when C >= 35 -> + yystate(91, Ics, Line, Tlen+1, Action, Alen); +yystate(91, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,91}; +yystate(90, [105|Ics], Line, Tlen, _, _) -> + yystate(94, Ics, Line, Tlen+1, 33, Tlen); +yystate(90, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(90, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(90, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(90, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 104 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(90, [C|Ics], Line, Tlen, _, _) when C >= 106, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(90, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,90}; +yystate(89, [114|Ics], Line, Tlen, _, _) -> + yystate(85, Ics, Line, Tlen+1, 33, Tlen); +yystate(89, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(89, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(89, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(89, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 113 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(89, [C|Ics], Line, Tlen, _, _) when C >= 115, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(89, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,89}; +yystate(88, [106|Ics], Line, Tlen, Action, Alen) -> + yystate(84, Ics, Line, Tlen+1, Action, Alen); +yystate(88, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,88}; +yystate(87, Ics, Line, Tlen, _, _) -> + {35,Tlen,Ics,Line}; +yystate(86, [111|Ics], Line, Tlen, _, _) -> + yystate(90, Ics, Line, Tlen+1, 33, Tlen); +yystate(86, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(86, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(86, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(86, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 110 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(86, [C|Ics], Line, Tlen, _, _) when C >= 112, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(86, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,86}; +yystate(85, [101|Ics], Line, Tlen, _, _) -> + yystate(81, Ics, Line, Tlen+1, 33, Tlen); +yystate(85, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(85, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(85, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(85, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 100 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(85, [C|Ics], Line, Tlen, _, _) when C >= 102, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(85, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,85}; +yystate(84, [111|Ics], Line, Tlen, Action, Alen) -> + yystate(80, Ics, Line, Tlen+1, Action, Alen); +yystate(84, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,84}; +yystate(83, [39|Ics], Line, Tlen, Action, Alen) -> + yystate(79, Ics, Line, Tlen+1, Action, Alen); +yystate(83, [10|Ics], Line, Tlen, Action, Alen) -> + yystate(83, Ics, Line+1, Tlen+1, Action, Alen); +yystate(83, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 -> + yystate(83, Ics, Line, Tlen+1, Action, Alen); +yystate(83, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 38 -> + yystate(83, Ics, Line, Tlen+1, Action, Alen); +yystate(83, [C|Ics], Line, Tlen, Action, Alen) when C >= 40 -> + yystate(83, Ics, Line, Tlen+1, Action, Alen); +yystate(83, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,83}; +yystate(82, Ics, Line, Tlen, _, _) -> + {30,Tlen,Ics,Line}; +yystate(81, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 22, Tlen); +yystate(81, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 22, Tlen); +yystate(81, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 22, Tlen); +yystate(81, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 22, Tlen); +yystate(81, Ics, Line, Tlen, _, _) -> + {22,Tlen,Ics,Line,81}; +yystate(80, [105|Ics], Line, Tlen, Action, Alen) -> + yystate(76, Ics, Line, Tlen+1, Action, Alen); +yystate(80, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,80}; +yystate(79, Ics, Line, Tlen, _, _) -> + {34,Tlen,Ics,Line}; +yystate(78, [110|Ics], Line, Tlen, Action, Alen) -> + yystate(82, Ics, Line, Tlen+1, Action, Alen); +yystate(78, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,78}; +yystate(77, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(77, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(77, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(77, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(77, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,77}; +yystate(76, [110|Ics], Line, Tlen, Action, Alen) -> + yystate(72, Ics, Line, Tlen+1, Action, Alen); +yystate(76, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,76}; +yystate(75, Ics, Line, Tlen, _, _) -> + {11,Tlen,Ics,Line}; +yystate(74, [105|Ics], Line, Tlen, Action, Alen) -> + yystate(78, Ics, Line, Tlen+1, Action, Alen); +yystate(74, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,74}; +yystate(73, [114|Ics], Line, Tlen, _, _) -> + yystate(69, Ics, Line, Tlen+1, 33, Tlen); +yystate(73, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(73, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(73, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(73, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 113 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(73, [C|Ics], Line, Tlen, _, _) when C >= 115, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(73, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,73}; +yystate(72, Ics, Line, Tlen, _, _) -> + {29,Tlen,Ics,Line}; +yystate(71, Ics, Line, Tlen, _, _) -> + {12,Tlen,Ics,Line}; +yystate(70, [111|Ics], Line, Tlen, Action, Alen) -> + yystate(74, Ics, Line, Tlen+1, Action, Alen); +yystate(70, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,70}; +yystate(69, [117|Ics], Line, Tlen, _, _) -> + yystate(65, Ics, Line, Tlen+1, 33, Tlen); +yystate(69, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(69, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(69, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(69, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 116 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(69, [C|Ics], Line, Tlen, _, _) when C >= 118, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(69, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,69}; +yystate(68, [114|Ics], Line, Tlen, _, _) -> + yystate(64, Ics, Line, Tlen+1, 33, Tlen); +yystate(68, [97|Ics], Line, Tlen, _, _) -> + yystate(52, Ics, Line, Tlen+1, 33, Tlen); +yystate(68, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(68, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(68, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(68, [C|Ics], Line, Tlen, _, _) when C >= 98, C =< 113 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(68, [C|Ics], Line, Tlen, _, _) when C >= 115, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(68, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,68}; +yystate(67, Ics, Line, Tlen, _, _) -> + {17,Tlen,Ics,Line}; +yystate(66, [106|Ics], Line, Tlen, Action, Alen) -> + yystate(70, Ics, Line, Tlen+1, Action, Alen); +yystate(66, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,66}; +yystate(65, [101|Ics], Line, Tlen, _, _) -> + yystate(61, Ics, Line, Tlen+1, 33, Tlen); +yystate(65, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(65, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(65, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(65, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 100 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(65, [C|Ics], Line, Tlen, _, _) when C >= 102, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(65, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,65}; +yystate(64, [111|Ics], Line, Tlen, _, _) -> + yystate(60, Ics, Line, Tlen+1, 33, Tlen); +yystate(64, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(64, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(64, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(64, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 110 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(64, [C|Ics], Line, Tlen, _, _) when C >= 112, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(64, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,64}; +yystate(63, Ics, Line, Tlen, _, _) -> + {16,Tlen,Ics,Line}; +yystate(62, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(62, [32|Ics], Line, Tlen, _, _) -> + yystate(66, Ics, Line, Tlen+1, 33, Tlen); +yystate(62, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(62, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(62, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(62, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,62}; +yystate(61, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 23, Tlen); +yystate(61, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 23, Tlen); +yystate(61, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 23, Tlen); +yystate(61, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 23, Tlen); +yystate(61, Ics, Line, Tlen, _, _) -> + {23,Tlen,Ics,Line,61}; +yystate(60, [109|Ics], Line, Tlen, _, _) -> + yystate(56, Ics, Line, Tlen+1, 33, Tlen); +yystate(60, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(60, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(60, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(60, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 108 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(60, [C|Ics], Line, Tlen, _, _) when C >= 110, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(60, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,60}; +yystate(59, Ics, Line, Tlen, _, _) -> + {15,Tlen,Ics,Line}; +yystate(58, [116|Ics], Line, Tlen, _, _) -> + yystate(62, Ics, Line, Tlen+1, 33, Tlen); +yystate(58, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(58, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(58, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(58, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 115 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(58, [C|Ics], Line, Tlen, _, _) when C >= 117, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(58, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,58}; +yystate(57, [117|Ics], Line, Tlen, _, _) -> + yystate(53, Ics, Line, Tlen+1, 33, Tlen); +yystate(57, [101|Ics], Line, Tlen, _, _) -> + yystate(45, Ics, Line, Tlen+1, 33, Tlen); +yystate(57, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(57, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(57, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(57, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 100 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(57, [C|Ics], Line, Tlen, _, _) when C >= 102, C =< 116 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(57, [C|Ics], Line, Tlen, _, _) when C >= 118, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(57, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,57}; +yystate(56, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 27, Tlen); +yystate(56, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 27, Tlen); +yystate(56, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 27, Tlen); +yystate(56, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 27, Tlen); +yystate(56, Ics, Line, Tlen, _, _) -> + {27,Tlen,Ics,Line,56}; +yystate(55, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(55, Ics, Line, Tlen+1, 0, Tlen); +yystate(55, Ics, Line, Tlen, _, _) -> + {0,Tlen,Ics,Line,55}; +yystate(54, [102|Ics], Line, Tlen, _, _) -> + yystate(58, Ics, Line, Tlen+1, 33, Tlen); +yystate(54, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(54, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(54, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(54, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 101 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(54, [C|Ics], Line, Tlen, _, _) when C >= 103, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(54, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,54}; +yystate(53, [109|Ics], Line, Tlen, _, _) -> + yystate(49, Ics, Line, Tlen+1, 33, Tlen); +yystate(53, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(53, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(53, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(53, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 108 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(53, [C|Ics], Line, Tlen, _, _) when C >= 110, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(53, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,53}; +yystate(52, [108|Ics], Line, Tlen, _, _) -> + yystate(48, Ics, Line, Tlen+1, 33, Tlen); +yystate(52, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(52, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(52, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(52, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 107 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(52, [C|Ics], Line, Tlen, _, _) when C >= 109, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(52, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,52}; +yystate(51, Ics, Line, Tlen, _, _) -> + {5,Tlen,Ics,Line}; +yystate(50, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 7, Tlen); +yystate(50, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 7, Tlen); +yystate(50, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 7, Tlen); +yystate(50, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 7, Tlen); +yystate(50, Ics, Line, Tlen, _, _) -> + {7,Tlen,Ics,Line,50}; +yystate(49, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 10, Tlen); +yystate(49, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 10, Tlen); +yystate(49, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 10, Tlen); +yystate(49, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 10, Tlen); +yystate(49, Ics, Line, Tlen, _, _) -> + {10,Tlen,Ics,Line,49}; +yystate(48, [115|Ics], Line, Tlen, _, _) -> + yystate(44, Ics, Line, Tlen+1, 33, Tlen); +yystate(48, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(48, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(48, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(48, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 114 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(48, [C|Ics], Line, Tlen, _, _) when C >= 116, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(48, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,48}; +yystate(47, [61|Ics], Line, Tlen, _, _) -> + yystate(51, Ics, Line, Tlen+1, 3, Tlen); +yystate(47, Ics, Line, Tlen, _, _) -> + {3,Tlen,Ics,Line,47}; +yystate(46, [101|Ics], Line, Tlen, _, _) -> + yystate(50, Ics, Line, Tlen+1, 33, Tlen); +yystate(46, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(46, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(46, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(46, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 100 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(46, [C|Ics], Line, Tlen, _, _) when C >= 102, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(46, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,46}; +yystate(45, [108|Ics], Line, Tlen, _, _) -> + yystate(41, Ics, Line, Tlen+1, 33, Tlen); +yystate(45, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(45, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(45, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(45, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 107 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(45, [C|Ics], Line, Tlen, _, _) when C >= 109, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(45, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,45}; +yystate(44, [101|Ics], Line, Tlen, _, _) -> + yystate(40, Ics, Line, Tlen+1, 33, Tlen); +yystate(44, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(44, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(44, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(44, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 100 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(44, [C|Ics], Line, Tlen, _, _) when C >= 102, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(44, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,44}; +yystate(43, Ics, Line, Tlen, _, _) -> + {1,Tlen,Ics,Line}; +yystate(42, [107|Ics], Line, Tlen, _, _) -> + yystate(46, Ics, Line, Tlen+1, 33, Tlen); +yystate(42, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(42, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(42, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(42, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 106 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(42, [C|Ics], Line, Tlen, _, _) when C >= 108, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(42, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,42}; +yystate(41, [101|Ics], Line, Tlen, _, _) -> + yystate(37, Ics, Line, Tlen+1, 33, Tlen); +yystate(41, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(41, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(41, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(41, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 100 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(41, [C|Ics], Line, Tlen, _, _) when C >= 102, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(41, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,41}; +yystate(40, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 24, Tlen); +yystate(40, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 24, Tlen); +yystate(40, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 24, Tlen); +yystate(40, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 24, Tlen); +yystate(40, Ics, Line, Tlen, _, _) -> + {24,Tlen,Ics,Line,40}; +yystate(39, Ics, Line, Tlen, _, _) -> + {6,Tlen,Ics,Line}; +yystate(38, [105|Ics], Line, Tlen, _, _) -> + yystate(42, Ics, Line, Tlen+1, 33, Tlen); +yystate(38, [101|Ics], Line, Tlen, _, _) -> + yystate(54, Ics, Line, Tlen+1, 33, Tlen); +yystate(38, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(38, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(38, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(38, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 100 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(38, [C|Ics], Line, Tlen, _, _) when C >= 102, C =< 104 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(38, [C|Ics], Line, Tlen, _, _) when C >= 106, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(38, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,38}; +yystate(37, [99|Ics], Line, Tlen, _, _) -> + yystate(33, Ics, Line, Tlen+1, 33, Tlen); +yystate(37, [97|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(37, [98|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(37, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(37, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(37, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(37, [C|Ics], Line, Tlen, _, _) when C >= 100, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(37, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,37}; +yystate(36, [111|Ics], Line, Tlen, _, _) -> + yystate(32, Ics, Line, Tlen+1, 33, Tlen); +yystate(36, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(36, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(36, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(36, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 110 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(36, [C|Ics], Line, Tlen, _, _) when C >= 112, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(36, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,36}; +yystate(35, [61|Ics], Line, Tlen, _, _) -> + yystate(39, Ics, Line, Tlen+1, 4, Tlen); +yystate(35, Ics, Line, Tlen, _, _) -> + {4,Tlen,Ics,Line,35}; +yystate(34, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 21, Tlen); +yystate(34, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 21, Tlen); +yystate(34, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 21, Tlen); +yystate(34, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 21, Tlen); +yystate(34, Ics, Line, Tlen, _, _) -> + {21,Tlen,Ics,Line,34}; +yystate(33, [116|Ics], Line, Tlen, _, _) -> + yystate(29, Ics, Line, Tlen+1, 33, Tlen); +yystate(33, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(33, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(33, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(33, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 115 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(33, [C|Ics], Line, Tlen, _, _) when C >= 117, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(33, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,33}; +yystate(32, [117|Ics], Line, Tlen, _, _) -> + yystate(28, Ics, Line, Tlen+1, 33, Tlen); +yystate(32, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(32, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(32, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(32, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 116 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(32, [C|Ics], Line, Tlen, _, _) when C >= 118, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(32, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,32}; +yystate(31, Ics, Line, Tlen, _, _) -> + {13,Tlen,Ics,Line}; +yystate(30, [116|Ics], Line, Tlen, _, _) -> + yystate(34, Ics, Line, Tlen+1, 33, Tlen); +yystate(30, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(30, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(30, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(30, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 115 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(30, [C|Ics], Line, Tlen, _, _) when C >= 117, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(30, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,30}; +yystate(29, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 26, Tlen); +yystate(29, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 26, Tlen); +yystate(29, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 26, Tlen); +yystate(29, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 26, Tlen); +yystate(29, Ics, Line, Tlen, _, _) -> + {26,Tlen,Ics,Line,29}; +yystate(28, [110|Ics], Line, Tlen, _, _) -> + yystate(24, Ics, Line, Tlen+1, 33, Tlen); +yystate(28, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(28, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(28, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(28, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 109 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(28, [C|Ics], Line, Tlen, _, _) when C >= 111, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(28, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,28}; +yystate(27, Ics, Line, Tlen, _, _) -> + {14,Tlen,Ics,Line}; +yystate(26, [111|Ics], Line, Tlen, _, _) -> + yystate(30, Ics, Line, Tlen+1, 33, Tlen); +yystate(26, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(26, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(26, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(26, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 110 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(26, [C|Ics], Line, Tlen, _, _) when C >= 112, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(26, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,26}; +yystate(25, [105|Ics], Line, Tlen, _, _) -> + yystate(21, Ics, Line, Tlen+1, 33, Tlen); +yystate(25, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(25, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(25, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(25, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 104 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(25, [C|Ics], Line, Tlen, _, _) when C >= 106, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(25, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,25}; +yystate(24, [116|Ics], Line, Tlen, _, _) -> + yystate(20, Ics, Line, Tlen+1, 33, Tlen); +yystate(24, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 115 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 117, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(24, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,24}; +yystate(23, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 19, Tlen); +yystate(23, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 19, Tlen); +yystate(23, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 19, Tlen); +yystate(23, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 19, Tlen); +yystate(23, Ics, Line, Tlen, _, _) -> + {19,Tlen,Ics,Line,23}; +yystate(22, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 32, Tlen); +yystate(22, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 32, Tlen); +yystate(22, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 32, Tlen); +yystate(22, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 32, Tlen); +yystate(22, Ics, Line, Tlen, _, _) -> + {32,Tlen,Ics,Line,22}; +yystate(21, [103|Ics], Line, Tlen, _, _) -> + yystate(17, Ics, Line, Tlen+1, 33, Tlen); +yystate(21, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(21, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(21, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(21, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 102 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(21, [C|Ics], Line, Tlen, _, _) when C >= 104, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(21, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,21}; +yystate(20, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 9, Tlen); +yystate(20, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 9, Tlen); +yystate(20, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 9, Tlen); +yystate(20, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 9, Tlen); +yystate(20, Ics, Line, Tlen, _, _) -> + {9,Tlen,Ics,Line,20}; +yystate(19, [100|Ics], Line, Tlen, _, _) -> + yystate(23, Ics, Line, Tlen+1, 33, Tlen); +yystate(19, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(19, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(19, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(19, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 99 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(19, [C|Ics], Line, Tlen, _, _) when C >= 101, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(19, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,19}; +yystate(18, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 20, Tlen); +yystate(18, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 20, Tlen); +yystate(18, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 20, Tlen); +yystate(18, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 20, Tlen); +yystate(18, Ics, Line, Tlen, _, _) -> + {20,Tlen,Ics,Line,18}; +yystate(17, [104|Ics], Line, Tlen, _, _) -> + yystate(13, Ics, Line, Tlen+1, 33, Tlen); +yystate(17, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(17, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(17, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(17, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 103 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(17, [C|Ics], Line, Tlen, _, _) when C >= 105, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(17, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,17}; +yystate(16, [101|Ics], Line, Tlen, _, _) -> + yystate(12, Ics, Line, Tlen+1, 33, Tlen); +yystate(16, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(16, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(16, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(16, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 100 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(16, [C|Ics], Line, Tlen, _, _) when C >= 102, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(16, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,16}; +yystate(15, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 18, Tlen); +yystate(15, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 18, Tlen); +yystate(15, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 18, Tlen); +yystate(15, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 18, Tlen); +yystate(15, Ics, Line, Tlen, _, _) -> + {18,Tlen,Ics,Line,15}; +yystate(14, [114|Ics], Line, Tlen, _, _) -> + yystate(18, Ics, Line, Tlen+1, 33, Tlen); +yystate(14, [110|Ics], Line, Tlen, _, _) -> + yystate(22, Ics, Line, Tlen+1, 33, Tlen); +yystate(14, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(14, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(14, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(14, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 109 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(14, [C|Ics], Line, Tlen, _, _) when C >= 111, C =< 113 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(14, [C|Ics], Line, Tlen, _, _) when C >= 115, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(14, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,14}; +yystate(13, [116|Ics], Line, Tlen, _, _) -> + yystate(9, Ics, Line, Tlen+1, 33, Tlen); +yystate(13, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(13, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(13, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(13, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 115 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(13, [C|Ics], Line, Tlen, _, _) when C >= 117, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(13, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,13}; +yystate(12, [116|Ics], Line, Tlen, _, _) -> + yystate(8, Ics, Line, Tlen+1, 33, Tlen); +yystate(12, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(12, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(12, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(12, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 115 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(12, [C|Ics], Line, Tlen, _, _) when C >= 117, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(12, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,12}; +yystate(11, [115|Ics], Line, Tlen, _, _) -> + yystate(15, Ics, Line, Tlen+1, 33, Tlen); +yystate(11, [110|Ics], Line, Tlen, _, _) -> + yystate(19, Ics, Line, Tlen+1, 33, Tlen); +yystate(11, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 109 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 111, C =< 114 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 116, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(11, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,11}; +yystate(10, Ics, Line, Tlen, _, _) -> + {31,Tlen,Ics,Line}; +yystate(9, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(9, [32|Ics], Line, Tlen, _, _) -> + yystate(5, Ics, Line, Tlen+1, 33, Tlen); +yystate(9, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(9, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(9, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(9, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,9}; +yystate(8, [119|Ics], Line, Tlen, _, _) -> + yystate(4, Ics, Line, Tlen+1, 33, Tlen); +yystate(8, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 118 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 120, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(8, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,8}; +yystate(7, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 25, Tlen); +yystate(7, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 25, Tlen); +yystate(7, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 25, Tlen); +yystate(7, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 25, Tlen); +yystate(7, Ics, Line, Tlen, _, _) -> + {25,Tlen,Ics,Line,7}; +yystate(6, [110|Ics], Line, Tlen, Action, Alen) -> + yystate(10, Ics, Line, Tlen+1, Action, Alen); +yystate(6, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,6}; +yystate(5, [106|Ics], Line, Tlen, Action, Alen) -> + yystate(1, Ics, Line, Tlen+1, Action, Alen); +yystate(5, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,5}; +yystate(4, [101|Ics], Line, Tlen, _, _) -> + yystate(0, Ics, Line, Tlen+1, 33, Tlen); +yystate(4, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(4, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(4, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(4, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 100 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(4, [C|Ics], Line, Tlen, _, _) when C >= 102, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(4, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,4}; +yystate(3, [110|Ics], Line, Tlen, _, _) -> + yystate(7, Ics, Line, Tlen+1, 33, Tlen); +yystate(3, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 109 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 111, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(3, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,3}; +yystate(2, [105|Ics], Line, Tlen, Action, Alen) -> + yystate(6, Ics, Line, Tlen+1, Action, Alen); +yystate(2, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,2}; +yystate(1, [111|Ics], Line, Tlen, Action, Alen) -> + yystate(2, Ics, Line, Tlen+1, Action, Alen); +yystate(1, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,1}; +yystate(0, [101|Ics], Line, Tlen, _, _) -> + yystate(3, Ics, Line, Tlen+1, 33, Tlen); +yystate(0, [95|Ics], Line, Tlen, _, _) -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 100 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 102, C =< 122 -> + yystate(77, Ics, Line, Tlen+1, 33, Tlen); +yystate(0, Ics, Line, Tlen, _, _) -> + {33,Tlen,Ics,Line,0}; +yystate(S, Ics, Line, Tlen, Action, Alen) -> + {Action,Alen,Tlen,Ics,Line,S}. + +%% yyaction(Action, TokenLength, TokenChars, TokenLine) -> +%% {token,Token} | {end_token, Token} | skip_token | {error,String}. +%% Generated action function. + +yyaction(0, TokenLen, YYtcs, TokenLine) -> + TokenChars = yypre(YYtcs, TokenLen), + yyaction_0(TokenChars, TokenLine); +yyaction(1, _, _, TokenLine) -> + yyaction_1(TokenLine); +yyaction(2, _, _, TokenLine) -> + yyaction_2(TokenLine); +yyaction(3, _, _, TokenLine) -> + yyaction_3(TokenLine); +yyaction(4, _, _, TokenLine) -> + yyaction_4(TokenLine); +yyaction(5, _, _, TokenLine) -> + yyaction_5(TokenLine); +yyaction(6, _, _, TokenLine) -> + yyaction_6(TokenLine); +yyaction(7, _, _, TokenLine) -> + yyaction_7(TokenLine); +yyaction(8, _, _, TokenLine) -> + yyaction_8(TokenLine); +yyaction(9, _, _, TokenLine) -> + yyaction_9(TokenLine); +yyaction(10, _, _, TokenLine) -> + yyaction_10(TokenLine); +yyaction(11, _, _, TokenLine) -> + yyaction_11(TokenLine); +yyaction(12, _, _, TokenLine) -> + yyaction_12(TokenLine); +yyaction(13, _, _, TokenLine) -> + yyaction_13(TokenLine); +yyaction(14, _, _, TokenLine) -> + yyaction_14(TokenLine); +yyaction(15, _, _, TokenLine) -> + yyaction_15(TokenLine); +yyaction(16, _, _, TokenLine) -> + yyaction_16(TokenLine); +yyaction(17, _, _, TokenLine) -> + yyaction_17(TokenLine); +yyaction(18, _, _, TokenLine) -> + yyaction_18(TokenLine); +yyaction(19, _, _, TokenLine) -> + yyaction_19(TokenLine); +yyaction(20, _, _, TokenLine) -> + yyaction_20(TokenLine); +yyaction(21, _, _, TokenLine) -> + yyaction_21(TokenLine); +yyaction(22, _, _, TokenLine) -> + yyaction_22(TokenLine); +yyaction(23, _, _, TokenLine) -> + yyaction_23(TokenLine); +yyaction(24, _, _, TokenLine) -> + yyaction_24(TokenLine); +yyaction(25, _, _, TokenLine) -> + yyaction_25(TokenLine); +yyaction(26, _, _, TokenLine) -> + yyaction_26(TokenLine); +yyaction(27, _, _, TokenLine) -> + yyaction_27(TokenLine); +yyaction(28, _, _, TokenLine) -> + yyaction_28(TokenLine); +yyaction(29, _, _, TokenLine) -> + yyaction_29(TokenLine); +yyaction(30, _, _, TokenLine) -> + yyaction_30(TokenLine); +yyaction(31, _, _, TokenLine) -> + yyaction_31(TokenLine); +yyaction(32, _, _, TokenLine) -> + yyaction_32(TokenLine); +yyaction(33, TokenLen, YYtcs, TokenLine) -> + TokenChars = yypre(YYtcs, TokenLen), + yyaction_33(TokenChars, TokenLine); +yyaction(34, TokenLen, YYtcs, TokenLine) -> + TokenChars = yypre(YYtcs, TokenLen), + yyaction_34(TokenChars, TokenLine); +yyaction(35, TokenLen, YYtcs, TokenLine) -> + TokenChars = yypre(YYtcs, TokenLen), + yyaction_35(TokenChars, TokenLine); +yyaction(36, _, _, _) -> + yyaction_36(); +yyaction(_, _, _, _) -> error. + +-compile({inline,yyaction_0/2}). +-file("src/build_query_lexer.xrl", 7). +yyaction_0(TokenChars, TokenLine) -> + { token, { number, TokenLine, list_to_integer (TokenChars) } } . + +-compile({inline,yyaction_1/1}). +-file("src/build_query_lexer.xrl", 10). +yyaction_1(TokenLine) -> + { token, { operator, TokenLine, '==' } } . + +-compile({inline,yyaction_2/1}). +-file("src/build_query_lexer.xrl", 11). +yyaction_2(TokenLine) -> + { token, { operator, TokenLine, '!=' } } . + +-compile({inline,yyaction_3/1}). +-file("src/build_query_lexer.xrl", 12). +yyaction_3(TokenLine) -> + { token, { operator, TokenLine, '<' } } . + +-compile({inline,yyaction_4/1}). +-file("src/build_query_lexer.xrl", 13). +yyaction_4(TokenLine) -> + { token, { operator, TokenLine, '>' } } . + +-compile({inline,yyaction_5/1}). +-file("src/build_query_lexer.xrl", 14). +yyaction_5(TokenLine) -> + { token, { operator, TokenLine, '>=' } } . + +-compile({inline,yyaction_6/1}). +-file("src/build_query_lexer.xrl", 15). +yyaction_6(TokenLine) -> + { token, { operator, TokenLine, '<=' } } . + +-compile({inline,yyaction_7/1}). +-file("src/build_query_lexer.xrl", 16). +yyaction_7(TokenLine) -> + { token, { operator, TokenLine, ilike } } . + +-compile({inline,yyaction_8/1}). +-file("src/build_query_lexer.xrl", 20). +yyaction_8(TokenLine) -> + { token, { cmp_in, TokenLine } } . + +-compile({inline,yyaction_9/1}). +-file("src/build_query_lexer.xrl", 23). +yyaction_9(TokenLine) -> + { token, { aggregate, TokenLine, count } } . + +-compile({inline,yyaction_10/1}). +-file("src/build_query_lexer.xrl", 24). +yyaction_10(TokenLine) -> + { token, { aggregate, TokenLine, sum } } . + +-compile({inline,yyaction_11/1}). +-file("src/build_query_lexer.xrl", 27). +yyaction_11(TokenLine) -> + { token, { left_paren, TokenLine } } . + +-compile({inline,yyaction_12/1}). +-file("src/build_query_lexer.xrl", 28). +yyaction_12(TokenLine) -> + { token, { right_paren, TokenLine } } . + +-compile({inline,yyaction_13/1}). +-file("src/build_query_lexer.xrl", 29). +yyaction_13(TokenLine) -> + { token, { '[', TokenLine } } . + +-compile({inline,yyaction_14/1}). +-file("src/build_query_lexer.xrl", 30). +yyaction_14(TokenLine) -> + { token, { ']', TokenLine } } . + +-compile({inline,yyaction_15/1}). +-file("src/build_query_lexer.xrl", 33). +yyaction_15(TokenLine) -> + { token, { dot, TokenLine } } . + +-compile({inline,yyaction_16/1}). +-file("src/build_query_lexer.xrl", 34). +yyaction_16(TokenLine) -> + { token, { comma, TokenLine } } . + +-compile({inline,yyaction_17/1}). +-file("src/build_query_lexer.xrl", 35). +yyaction_17(TokenLine) -> + { token, { all, TokenLine } } . + +-compile({inline,yyaction_18/1}). +-file("src/build_query_lexer.xrl", 38). +yyaction_18(TokenLine) -> + { token, { as, TokenLine } } . + +-compile({inline,yyaction_19/1}). +-file("src/build_query_lexer.xrl", 39). +yyaction_19(TokenLine) -> + { token, { boolean_mult, TokenLine } } . + +-compile({inline,yyaction_20/1}). +-file("src/build_query_lexer.xrl", 40). +yyaction_20(TokenLine) -> + { token, { boolean_add, TokenLine } } . + +-compile({inline,yyaction_21/1}). +-file("src/build_query_lexer.xrl", 41). +yyaction_21(TokenLine) -> + { token, { boolean_negate, TokenLine } } . + +-compile({inline,yyaction_22/1}). +-file("src/build_query_lexer.xrl", 42). +yyaction_22(TokenLine) -> + { token, { where, TokenLine } } . + +-compile({inline,yyaction_23/1}). +-file("src/build_query_lexer.xrl", 43). +yyaction_23(TokenLine) -> + { token, { true, TokenLine } } . + +-compile({inline,yyaction_24/1}). +-file("src/build_query_lexer.xrl", 44). +yyaction_24(TokenLine) -> + { token, { false, TokenLine } } . + +-compile({inline,yyaction_25/1}). +-file("src/build_query_lexer.xrl", 45). +yyaction_25(TokenLine) -> + { token, { between, TokenLine } } . + +-compile({inline,yyaction_26/1}). +-file("src/build_query_lexer.xrl", 46). +yyaction_26(TokenLine) -> + { token, { select, TokenLine } } . + +-compile({inline,yyaction_27/1}). +-file("src/build_query_lexer.xrl", 47). +yyaction_27(TokenLine) -> + { token, { from, TokenLine } } . + +-compile({inline,yyaction_28/1}). +-file("src/build_query_lexer.xrl", 48). +yyaction_28(TokenLine) -> + { token, { join, TokenLine } } . + +-compile({inline,yyaction_29/1}). +-file("src/build_query_lexer.xrl", 49). +yyaction_29(TokenLine) -> + { token, { join, TokenLine } } . + +-compile({inline,yyaction_30/1}). +-file("src/build_query_lexer.xrl", 50). +yyaction_30(TokenLine) -> + { token, { left_join, TokenLine } } . + +-compile({inline,yyaction_31/1}). +-file("src/build_query_lexer.xrl", 51). +yyaction_31(TokenLine) -> + { token, { right_join, TokenLine } } . + +-compile({inline,yyaction_32/1}). +-file("src/build_query_lexer.xrl", 52). +yyaction_32(TokenLine) -> + { token, { on, TokenLine } } . + +-compile({inline,yyaction_33/2}). +-file("src/build_query_lexer.xrl", 55). +yyaction_33(TokenChars, TokenLine) -> + { token, { identifier, TokenLine, TokenChars } } . + +-compile({inline,yyaction_34/2}). +-file("src/build_query_lexer.xrl", 57). +yyaction_34(TokenChars, TokenLine) -> + { token, { quoted, TokenLine, TokenChars } } . + +-compile({inline,yyaction_35/2}). +-file("src/build_query_lexer.xrl", 58). +yyaction_35(TokenChars, TokenLine) -> + { token, { quoted, TokenLine, TokenChars } } . + +-compile({inline,yyaction_36/0}). +-file("src/build_query_lexer.xrl", 61). +yyaction_36() -> + skip_token . + +-file("/Users/thiago/.asdf/installs/erlang/25.0.3/lib/parsetools-2.4/include/leexinc.hrl", 313). diff --git a/src/build_query_lexer.xrl b/src/build_query_lexer.xrl new file mode 100644 index 0000000..ab9734e --- /dev/null +++ b/src/build_query_lexer.xrl @@ -0,0 +1,70 @@ + +Definitions. + +IDENTIFIER = [a-zA-Z][A-Za-z0-9_]* + +Rules. + +%% a number +[0-9]+ : {token, {number, TokenLine, list_to_integer(TokenChars)}}. + +%% comparison operators += : {token, {operator, TokenLine, '=='}}. +!= : {token, {operator, TokenLine, '!='}}. +< : {token, {operator, TokenLine, '<'}}. +> : {token, {operator, TokenLine, '>'}}. +<= : {token, {operator, TokenLine, '>='}}. +>= : {token, {operator, TokenLine, '<='}}. +like : {token, {operator, TokenLine, 'ilike'}}. +%contains : {token, {operator, TokenLine, cmp_contains}}. + +%% inclusion +in : {token, {cmp_in, TokenLine}}. + +%% aggregate functions +count : {token, {aggregate, TokenLine, count}}. +sum : {token, {aggregate, TokenLine, sum}}. + +%% open/close parens +\( : {token, {left_paren, TokenLine}}. +\) : {token, {right_paren, TokenLine}}. +\[ : {token, {'[', TokenLine}}. +\] : {token, {']', TokenLine}}. + +%% arithmetic operators +\. : {token, {dot, TokenLine}}. +\, : {token, {comma, TokenLine}}. +\* : {token, {all, TokenLine}}. + +%% Reserver keywords +as : {token, {as, TokenLine}}. +and : {token, {boolean_mult, TokenLine}}. +or : {token, {boolean_add, TokenLine}}. +not : {token, {boolean_negate, TokenLine}}. +where : {token, {where, TokenLine}}. +true : {token, {true, TokenLine}}. +false : {token, {false, TokenLine}}. +between : {token, {between, TokenLine}}. +select : {token, {select, TokenLine}}. +from : {token, {from, TokenLine}}. +join : {token, {join, TokenLine}}. +inner\sjoin : {token, {join, TokenLine}}. +left\sjoin : {token, {left_join, TokenLine}}. +right\sjoin : {token, {right_join, TokenLine}}. +on : {token, {on, TokenLine}}. + +%% Identifiers +{IDENTIFIER} : {token, {identifier, TokenLine, TokenChars}}. + +'[^']*' : {token, {quoted, TokenLine, TokenChars}}. +"[^"]*" : {token, {quoted, TokenLine, TokenChars}}. + +%% white space +[\s\n\r\t]+ : skip_token. + +Erlang code. + +oid(Oid) -> + S = tl(lists:droplast(Oid)), + L = string:split(S, ".", all), + lists:map(fun list_to_integer/1, L). diff --git a/src/build_query_parser.erl b/src/build_query_parser.erl new file mode 100644 index 0000000..e1a7d2b --- /dev/null +++ b/src/build_query_parser.erl @@ -0,0 +1,978 @@ +-module(build_query_parser). +-export([parse/1, parse_and_scan/1, format_error/1]). +-file("src/build_query_parser.yrl", 43). + +-import(string,[len/1, sub_string/3]). + +extract_value({_Token, _Line, Value}) -> Value. +extract_token({Token, _Line}) -> Token. + +-file("/Users/thiago/.asdf/installs/erlang/25.0.3/lib/parsetools-2.4/include/yeccpre.hrl", 0). +%% +%% %CopyrightBegin% +%% +%% Copyright Ericsson AB 1996-2021. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%% +%% %CopyrightEnd% +%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% The parser generator will insert appropriate declarations before this line.% + +-type yecc_ret() :: {'error', _} | {'ok', _}. + +-spec parse(Tokens :: list()) -> yecc_ret(). +parse(Tokens) -> + yeccpars0(Tokens, {no_func, no_location}, 0, [], []). + +-spec parse_and_scan({function() | {atom(), atom()}, [_]} + | {atom(), atom(), [_]}) -> yecc_ret(). +parse_and_scan({F, A}) -> + yeccpars0([], {{F, A}, no_location}, 0, [], []); +parse_and_scan({M, F, A}) -> + Arity = length(A), + yeccpars0([], {{fun M:F/Arity, A}, no_location}, 0, [], []). + +-spec format_error(any()) -> [char() | list()]. +format_error(Message) -> + case io_lib:deep_char_list(Message) of + true -> + Message; + _ -> + io_lib:write(Message) + end. + +%% To be used in grammar files to throw an error message to the parser +%% toplevel. Doesn't have to be exported! +-compile({nowarn_unused_function, return_error/2}). +-spec return_error(erl_anno:location(), any()) -> no_return(). +return_error(Location, Message) -> + throw({error, {Location, ?MODULE, Message}}). + +-define(CODE_VERSION, "1.4"). + +yeccpars0(Tokens, Tzr, State, States, Vstack) -> + try yeccpars1(Tokens, Tzr, State, States, Vstack) + catch + error: Error: Stacktrace -> + try yecc_error_type(Error, Stacktrace) of + Desc -> + erlang:raise(error, {yecc_bug, ?CODE_VERSION, Desc}, + Stacktrace) + catch _:_ -> erlang:raise(error, Error, Stacktrace) + end; + %% Probably thrown from return_error/2: + throw: {error, {_Location, ?MODULE, _M}} = Error -> + Error + end. + +yecc_error_type(function_clause, [{?MODULE,F,ArityOrArgs,_} | _]) -> + case atom_to_list(F) of + "yeccgoto_" ++ SymbolL -> + {ok,[{atom,_,Symbol}],_} = erl_scan:string(SymbolL), + State = case ArityOrArgs of + [S,_,_,_,_,_,_] -> S; + _ -> state_is_unknown + end, + {Symbol, State, missing_in_goto_table} + end. + +yeccpars1([Token | Tokens], Tzr, State, States, Vstack) -> + yeccpars2(State, element(1, Token), States, Vstack, Token, Tokens, Tzr); +yeccpars1([], {{F, A},_Location}, State, States, Vstack) -> + case apply(F, A) of + {ok, Tokens, EndLocation} -> + yeccpars1(Tokens, {{F, A}, EndLocation}, State, States, Vstack); + {eof, EndLocation} -> + yeccpars1([], {no_func, EndLocation}, State, States, Vstack); + {error, Descriptor, _EndLocation} -> + {error, Descriptor} + end; +yeccpars1([], {no_func, no_location}, State, States, Vstack) -> + Line = 999999, + yeccpars2(State, '$end', States, Vstack, yecc_end(Line), [], + {no_func, Line}); +yeccpars1([], {no_func, EndLocation}, State, States, Vstack) -> + yeccpars2(State, '$end', States, Vstack, yecc_end(EndLocation), [], + {no_func, EndLocation}). + +%% yeccpars1/7 is called from generated code. +%% +%% When using the {includefile, Includefile} option, make sure that +%% yeccpars1/7 can be found by parsing the file without following +%% include directives. yecc will otherwise assume that an old +%% yeccpre.hrl is included (one which defines yeccpars1/5). +yeccpars1(State1, State, States, Vstack, Token0, [Token | Tokens], Tzr) -> + yeccpars2(State, element(1, Token), [State1 | States], + [Token0 | Vstack], Token, Tokens, Tzr); +yeccpars1(State1, State, States, Vstack, Token0, [], {{_F,_A}, _Location}=Tzr) -> + yeccpars1([], Tzr, State, [State1 | States], [Token0 | Vstack]); +yeccpars1(State1, State, States, Vstack, Token0, [], {no_func, no_location}) -> + Location = yecctoken_end_location(Token0), + yeccpars2(State, '$end', [State1 | States], [Token0 | Vstack], + yecc_end(Location), [], {no_func, Location}); +yeccpars1(State1, State, States, Vstack, Token0, [], {no_func, Location}) -> + yeccpars2(State, '$end', [State1 | States], [Token0 | Vstack], + yecc_end(Location), [], {no_func, Location}). + +%% For internal use only. +yecc_end(Location) -> + {'$end', Location}. + +yecctoken_end_location(Token) -> + try erl_anno:end_location(element(2, Token)) of + undefined -> yecctoken_location(Token); + Loc -> Loc + catch _:_ -> yecctoken_location(Token) + end. + +-compile({nowarn_unused_function, yeccerror/1}). +yeccerror(Token) -> + Text = yecctoken_to_string(Token), + Location = yecctoken_location(Token), + {error, {Location, ?MODULE, ["syntax error before: ", Text]}}. + +-compile({nowarn_unused_function, yecctoken_to_string/1}). +yecctoken_to_string(Token) -> + try erl_scan:text(Token) of + undefined -> yecctoken2string(Token); + Txt -> Txt + catch _:_ -> yecctoken2string(Token) + end. + +yecctoken_location(Token) -> + try erl_scan:location(Token) + catch _:_ -> element(2, Token) + end. + +-compile({nowarn_unused_function, yecctoken2string/1}). +yecctoken2string(Token) -> + try + yecctoken2string1(Token) + catch + _:_ -> + io_lib:format("~tp", [Token]) + end. + +-compile({nowarn_unused_function, yecctoken2string1/1}). +yecctoken2string1({atom, _, A}) -> io_lib:write_atom(A); +yecctoken2string1({integer,_,N}) -> io_lib:write(N); +yecctoken2string1({float,_,F}) -> io_lib:write(F); +yecctoken2string1({char,_,C}) -> io_lib:write_char(C); +yecctoken2string1({var,_,V}) -> io_lib:format("~s", [V]); +yecctoken2string1({string,_,S}) -> io_lib:write_string(S); +yecctoken2string1({reserved_symbol, _, A}) -> io_lib:write(A); +yecctoken2string1({_Cat, _, Val}) -> io_lib:format("~tp", [Val]); +yecctoken2string1({dot, _}) -> "'.'"; +yecctoken2string1({'$end', _}) -> []; +yecctoken2string1({Other, _}) when is_atom(Other) -> + io_lib:write_atom(Other); +yecctoken2string1(Other) -> + io_lib:format("~tp", [Other]). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +-file("src/build_query_parser.erl", 189). + +-dialyzer({nowarn_function, yeccpars2/7}). +-compile({nowarn_unused_function, yeccpars2/7}). +yeccpars2(0=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_0(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(1=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_1(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(2=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_2(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(3=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_3(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(4=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_4(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(5=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_5(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(6=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_6(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(7=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_7(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(8=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_8(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(9=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_9(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(10=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_10(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(11=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_11(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(12=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_12(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(13=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_13(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(14=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_10(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(15=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_10(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(16=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_10(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(17=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_17(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(18=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_18(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(19=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_19(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(20=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_20(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(21=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_21(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(22=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_22(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(23=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_23(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(24=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_24(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(25=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_10(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(26=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_26(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(27=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_27(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(28=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_28(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(29=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_29(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(30=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_30(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(31=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_31(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(32=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_10(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(33=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_33(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(34=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_10(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(35=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_35(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(36=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_36(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(37=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_37(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(38=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_10(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(39=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_39(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(40=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_40(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(41=S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_10(S, Cat, Ss, Stack, T, Ts, Tzr); +%% yeccpars2(42=S, Cat, Ss, Stack, T, Ts, Tzr) -> +%% yeccpars2_42(S, Cat, Ss, Stack, T, Ts, Tzr); +yeccpars2(Other, _, _, _, _, _, _) -> + erlang:error({yecc_bug,"1.4",{missing_state_in_action_table, Other}}). + +-dialyzer({nowarn_function, yeccpars2_0/7}). +-compile({nowarn_unused_function, yeccpars2_0/7}). +yeccpars2_0(S, 'select', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 2, Ss, Stack, T, Ts, Tzr); +yeccpars2_0(_, _, _, _, T, _, _) -> + yeccerror(T). + +-dialyzer({nowarn_function, yeccpars2_1/7}). +-compile({nowarn_unused_function, yeccpars2_1/7}). +yeccpars2_1(_S, '$end', _Ss, Stack, _T, _Ts, _Tzr) -> + {ok, hd(Stack)}; +yeccpars2_1(_, _, _, _, T, _, _) -> + yeccerror(T). + +-dialyzer({nowarn_function, yeccpars2_2/7}). +-compile({nowarn_unused_function, yeccpars2_2/7}). +yeccpars2_2(S, 'distinct', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 4, Ss, Stack, T, Ts, Tzr); +yeccpars2_2(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_2_(Stack), + yeccpars2_3(3, Cat, [2 | Ss], NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_3/7}). +-compile({nowarn_unused_function, yeccpars2_3/7}). +yeccpars2_3(S, 'all', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 8, Ss, Stack, T, Ts, Tzr); +yeccpars2_3(S, 'identifier', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr); +yeccpars2_3(S, 'left_paren', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 10, Ss, Stack, T, Ts, Tzr); +yeccpars2_3(S, 'number', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 11, Ss, Stack, T, Ts, Tzr); +yeccpars2_3(S, 'quoted', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 12, Ss, Stack, T, Ts, Tzr); +yeccpars2_3(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_3_(Stack), + yeccpars2_5(5, Cat, [3 | Ss], NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_4/7}). +-compile({nowarn_unused_function, yeccpars2_4/7}). +yeccpars2_4(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_4_(Stack), + yeccgoto_select_opts(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_5/7}). +-compile({nowarn_unused_function, yeccpars2_5/7}). +yeccpars2_5(S, 'from', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 25, Ss, Stack, T, Ts, Tzr); +yeccpars2_5(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + [_,_|Nss] = Ss, + NewStack = yeccpars2_5_(Stack), + yeccgoto_select_stmt(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_6/7}). +-compile({nowarn_unused_function, yeccpars2_6/7}). +yeccpars2_6(S, 'comma', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 23, Ss, Stack, T, Ts, Tzr); +yeccpars2_6(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_6_(Stack), + yeccgoto_select_expr_list(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_7/7}). +-compile({nowarn_unused_function, yeccpars2_7/7}). +yeccpars2_7(S, 'boolean_add', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 14, Ss, Stack, T, Ts, Tzr); +yeccpars2_7(S, 'boolean_mult', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 15, Ss, Stack, T, Ts, Tzr); +yeccpars2_7(S, 'operator', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 16, Ss, Stack, T, Ts, Tzr); +yeccpars2_7(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_7_(Stack), + yeccgoto_select_expr(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_8/7}). +-compile({nowarn_unused_function, yeccpars2_8/7}). +yeccpars2_8(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_8_(Stack), + yeccgoto_select_expr(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_9/7}). +-compile({nowarn_unused_function, yeccpars2_9/7}). +yeccpars2_9(S, 'dot', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 21, Ss, Stack, T, Ts, Tzr); +yeccpars2_9(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_9_(Stack), + yeccgoto_expr(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_10/7}). +-compile({nowarn_unused_function, yeccpars2_10/7}). +yeccpars2_10(S, 'identifier', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr); +yeccpars2_10(S, 'left_paren', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 10, Ss, Stack, T, Ts, Tzr); +yeccpars2_10(S, 'number', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 11, Ss, Stack, T, Ts, Tzr); +yeccpars2_10(S, 'quoted', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 12, Ss, Stack, T, Ts, Tzr); +yeccpars2_10(_, _, _, _, T, _, _) -> + yeccerror(T). + +-dialyzer({nowarn_function, yeccpars2_11/7}). +-compile({nowarn_unused_function, yeccpars2_11/7}). +yeccpars2_11(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_11_(Stack), + yeccgoto_expr(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_12/7}). +-compile({nowarn_unused_function, yeccpars2_12/7}). +yeccpars2_12(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_12_(Stack), + yeccgoto_expr(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_13/7}). +-compile({nowarn_unused_function, yeccpars2_13/7}). +yeccpars2_13(S, 'boolean_add', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 14, Ss, Stack, T, Ts, Tzr); +yeccpars2_13(S, 'boolean_mult', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 15, Ss, Stack, T, Ts, Tzr); +yeccpars2_13(S, 'operator', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 16, Ss, Stack, T, Ts, Tzr); +yeccpars2_13(S, 'right_paren', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 17, Ss, Stack, T, Ts, Tzr); +yeccpars2_13(_, _, _, _, T, _, _) -> + yeccerror(T). + +%% yeccpars2_14: see yeccpars2_10 + +%% yeccpars2_15: see yeccpars2_10 + +%% yeccpars2_16: see yeccpars2_10 + +-dialyzer({nowarn_function, yeccpars2_17/7}). +-compile({nowarn_unused_function, yeccpars2_17/7}). +yeccpars2_17(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + [_,_|Nss] = Ss, + NewStack = yeccpars2_17_(Stack), + yeccgoto_expr(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_18/7}). +-compile({nowarn_unused_function, yeccpars2_18/7}). +yeccpars2_18(S, 'boolean_add', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 14, Ss, Stack, T, Ts, Tzr); +yeccpars2_18(S, 'boolean_mult', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 15, Ss, Stack, T, Ts, Tzr); +yeccpars2_18(S, 'operator', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 16, Ss, Stack, T, Ts, Tzr); +yeccpars2_18(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + [_,_|Nss] = Ss, + NewStack = yeccpars2_18_(Stack), + yeccgoto_expr(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_19/7}). +-compile({nowarn_unused_function, yeccpars2_19/7}). +yeccpars2_19(S, 'boolean_add', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 14, Ss, Stack, T, Ts, Tzr); +yeccpars2_19(S, 'boolean_mult', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 15, Ss, Stack, T, Ts, Tzr); +yeccpars2_19(S, 'operator', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 16, Ss, Stack, T, Ts, Tzr); +yeccpars2_19(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + [_,_|Nss] = Ss, + NewStack = yeccpars2_19_(Stack), + yeccgoto_expr(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_20/7}). +-compile({nowarn_unused_function, yeccpars2_20/7}). +yeccpars2_20(S, 'boolean_add', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 14, Ss, Stack, T, Ts, Tzr); +yeccpars2_20(S, 'boolean_mult', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 15, Ss, Stack, T, Ts, Tzr); +yeccpars2_20(S, 'operator', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 16, Ss, Stack, T, Ts, Tzr); +yeccpars2_20(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + [_,_|Nss] = Ss, + NewStack = yeccpars2_20_(Stack), + yeccgoto_expr(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_21/7}). +-compile({nowarn_unused_function, yeccpars2_21/7}). +yeccpars2_21(S, 'identifier', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 22, Ss, Stack, T, Ts, Tzr); +yeccpars2_21(_, _, _, _, T, _, _) -> + yeccerror(T). + +-dialyzer({nowarn_function, yeccpars2_22/7}). +-compile({nowarn_unused_function, yeccpars2_22/7}). +yeccpars2_22(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + [_,_|Nss] = Ss, + NewStack = yeccpars2_22_(Stack), + yeccgoto_expr(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). + +yeccpars2_23(S, 'all', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 8, Ss, Stack, T, Ts, Tzr); +yeccpars2_23(S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_10(S, Cat, Ss, Stack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_24/7}). +-compile({nowarn_unused_function, yeccpars2_24/7}). +yeccpars2_24(S, 'comma', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 23, Ss, Stack, T, Ts, Tzr); +yeccpars2_24(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + [_,_|Nss] = Ss, + NewStack = yeccpars2_24_(Stack), + yeccgoto_select_expr(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). + +%% yeccpars2_25: see yeccpars2_10 + +-dialyzer({nowarn_function, yeccpars2_26/7}). +-compile({nowarn_unused_function, yeccpars2_26/7}). +yeccpars2_26(S, 'where', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 41, Ss, Stack, T, Ts, Tzr); +yeccpars2_26(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_26_(Stack), + yeccpars2_40(_S, Cat, [26 | Ss], NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_27/7}). +-compile({nowarn_unused_function, yeccpars2_27/7}). +yeccpars2_27(S, 'join', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 34, Ss, Stack, T, Ts, Tzr); +yeccpars2_27(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_27_(Stack), + yeccgoto_table_references(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_28/7}). +-compile({nowarn_unused_function, yeccpars2_28/7}). +yeccpars2_28(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_28_(Stack), + yeccgoto_table_reference(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_29/7}). +-compile({nowarn_unused_function, yeccpars2_29/7}). +yeccpars2_29(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_29_(Stack), + yeccgoto_table_reference(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_30/7}). +-compile({nowarn_unused_function, yeccpars2_30/7}). +yeccpars2_30(S, 'as', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 32, Ss, Stack, T, Ts, Tzr); +yeccpars2_30(S, 'boolean_add', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 14, Ss, Stack, T, Ts, Tzr); +yeccpars2_30(S, 'boolean_mult', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 15, Ss, Stack, T, Ts, Tzr); +yeccpars2_30(S, 'operator', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 16, Ss, Stack, T, Ts, Tzr); +yeccpars2_30(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_30_(Stack), + yeccpars2_31(_S, Cat, [30 | Ss], NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_31/7}). +-compile({nowarn_unused_function, yeccpars2_31/7}). +yeccpars2_31(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + [_|Nss] = Ss, + NewStack = yeccpars2_31_(Stack), + yeccgoto_table_factor(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). + +%% yeccpars2_32: see yeccpars2_10 + +-dialyzer({nowarn_function, yeccpars2_33/7}). +-compile({nowarn_unused_function, yeccpars2_33/7}). +yeccpars2_33(S, 'boolean_add', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 14, Ss, Stack, T, Ts, Tzr); +yeccpars2_33(S, 'boolean_mult', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 15, Ss, Stack, T, Ts, Tzr); +yeccpars2_33(S, 'operator', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 16, Ss, Stack, T, Ts, Tzr); +yeccpars2_33(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + [_|Nss] = Ss, + NewStack = yeccpars2_33_(Stack), + yeccgoto_opt_as_alias(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). + +%% yeccpars2_34: see yeccpars2_10 + +-dialyzer({nowarn_function, yeccpars2_35/7}). +-compile({nowarn_unused_function, yeccpars2_35/7}). +yeccpars2_35(S, 'on', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 38, Ss, Stack, T, Ts, Tzr); +yeccpars2_35(_, _, _, _, T, _, _) -> + yeccerror(T). + +-dialyzer({nowarn_function, yeccpars2_36/7}). +-compile({nowarn_unused_function, yeccpars2_36/7}). +yeccpars2_36(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + [_,_,_|Nss] = Ss, + NewStack = yeccpars2_36_(Stack), + yeccgoto_join_table(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_37/7}). +-compile({nowarn_unused_function, yeccpars2_37/7}). +yeccpars2_37(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + NewStack = yeccpars2_37_(Stack), + yeccgoto_opt_join_condition(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). + +%% yeccpars2_38: see yeccpars2_10 + +-dialyzer({nowarn_function, yeccpars2_39/7}). +-compile({nowarn_unused_function, yeccpars2_39/7}). +yeccpars2_39(S, 'boolean_add', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 14, Ss, Stack, T, Ts, Tzr); +yeccpars2_39(S, 'boolean_mult', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 15, Ss, Stack, T, Ts, Tzr); +yeccpars2_39(S, 'operator', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 16, Ss, Stack, T, Ts, Tzr); +yeccpars2_39(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + [_|Nss] = Ss, + NewStack = yeccpars2_39_(Stack), + yeccgoto_join_condition(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccpars2_40/7}). +-compile({nowarn_unused_function, yeccpars2_40/7}). +yeccpars2_40(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + [_,_,_,_,_|Nss] = Ss, + NewStack = yeccpars2_40_(Stack), + yeccgoto_select_stmt(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). + +%% yeccpars2_41: see yeccpars2_10 + +-dialyzer({nowarn_function, yeccpars2_42/7}). +-compile({nowarn_unused_function, yeccpars2_42/7}). +yeccpars2_42(S, 'boolean_add', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 14, Ss, Stack, T, Ts, Tzr); +yeccpars2_42(S, 'boolean_mult', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 15, Ss, Stack, T, Ts, Tzr); +yeccpars2_42(S, 'operator', Ss, Stack, T, Ts, Tzr) -> + yeccpars1(S, 16, Ss, Stack, T, Ts, Tzr); +yeccpars2_42(_S, Cat, Ss, Stack, T, Ts, Tzr) -> + [_|Nss] = Ss, + NewStack = yeccpars2_42_(Stack), + yeccgoto_opt_where(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccgoto_expr/7}). +-compile({nowarn_unused_function, yeccgoto_expr/7}). +yeccgoto_expr(3, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_7(7, Cat, Ss, Stack, T, Ts, Tzr); +yeccgoto_expr(10, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_13(13, Cat, Ss, Stack, T, Ts, Tzr); +yeccgoto_expr(14, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_20(20, Cat, Ss, Stack, T, Ts, Tzr); +yeccgoto_expr(15, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_19(19, Cat, Ss, Stack, T, Ts, Tzr); +yeccgoto_expr(16, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_18(18, Cat, Ss, Stack, T, Ts, Tzr); +yeccgoto_expr(23, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_7(7, Cat, Ss, Stack, T, Ts, Tzr); +yeccgoto_expr(25, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_30(30, Cat, Ss, Stack, T, Ts, Tzr); +yeccgoto_expr(32, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_33(33, Cat, Ss, Stack, T, Ts, Tzr); +yeccgoto_expr(34, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_30(30, Cat, Ss, Stack, T, Ts, Tzr); +yeccgoto_expr(38, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_39(39, Cat, Ss, Stack, T, Ts, Tzr); +yeccgoto_expr(41, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_42(42, Cat, Ss, Stack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccgoto_join_condition/7}). +-compile({nowarn_unused_function, yeccgoto_join_condition/7}). +yeccgoto_join_condition(35=_S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_37(_S, Cat, Ss, Stack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccgoto_join_table/7}). +-compile({nowarn_unused_function, yeccgoto_join_table/7}). +yeccgoto_join_table(25=_S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_29(_S, Cat, Ss, Stack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccgoto_opt_as_alias/7}). +-compile({nowarn_unused_function, yeccgoto_opt_as_alias/7}). +yeccgoto_opt_as_alias(30=_S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_31(_S, Cat, Ss, Stack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccgoto_opt_join_condition/7}). +-compile({nowarn_unused_function, yeccgoto_opt_join_condition/7}). +yeccgoto_opt_join_condition(35=_S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_36(_S, Cat, Ss, Stack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccgoto_opt_where/7}). +-compile({nowarn_unused_function, yeccgoto_opt_where/7}). +yeccgoto_opt_where(26=_S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_40(_S, Cat, Ss, Stack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccgoto_select_expr/7}). +-compile({nowarn_unused_function, yeccgoto_select_expr/7}). +yeccgoto_select_expr(3, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_6(6, Cat, Ss, Stack, T, Ts, Tzr); +yeccgoto_select_expr(23, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_24(24, Cat, Ss, Stack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccgoto_select_expr_list/7}). +-compile({nowarn_unused_function, yeccgoto_select_expr_list/7}). +yeccgoto_select_expr_list(3, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_5(5, Cat, Ss, Stack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccgoto_select_opts/7}). +-compile({nowarn_unused_function, yeccgoto_select_opts/7}). +yeccgoto_select_opts(2, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_3(3, Cat, Ss, Stack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccgoto_select_stmt/7}). +-compile({nowarn_unused_function, yeccgoto_select_stmt/7}). +yeccgoto_select_stmt(0, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_1(1, Cat, Ss, Stack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccgoto_table_factor/7}). +-compile({nowarn_unused_function, yeccgoto_table_factor/7}). +yeccgoto_table_factor(25=_S, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_28(_S, Cat, Ss, Stack, T, Ts, Tzr); +yeccgoto_table_factor(34, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_35(35, Cat, Ss, Stack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccgoto_table_reference/7}). +-compile({nowarn_unused_function, yeccgoto_table_reference/7}). +yeccgoto_table_reference(25, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_27(27, Cat, Ss, Stack, T, Ts, Tzr). + +-dialyzer({nowarn_function, yeccgoto_table_references/7}). +-compile({nowarn_unused_function, yeccgoto_table_references/7}). +yeccgoto_table_references(25, Cat, Ss, Stack, T, Ts, Tzr) -> + yeccpars2_26(26, Cat, Ss, Stack, T, Ts, Tzr). + +-compile({inline,yeccpars2_2_/1}). +-dialyzer({nowarn_function, yeccpars2_2_/1}). +-compile({nowarn_unused_function, yeccpars2_2_/1}). +-file("src/build_query_parser.yrl", 6). +yeccpars2_2_(__Stack0) -> + [begin + nil + end | __Stack0]. + +-compile({inline,yeccpars2_3_/1}). +-dialyzer({nowarn_function, yeccpars2_3_/1}). +-compile({nowarn_unused_function, yeccpars2_3_/1}). +-file("src/build_query_parser.yrl", 8). +yeccpars2_3_(__Stack0) -> + [begin + nil + end | __Stack0]. + +-compile({inline,yeccpars2_4_/1}). +-dialyzer({nowarn_function, yeccpars2_4_/1}). +-compile({nowarn_unused_function, yeccpars2_4_/1}). +-file("src/build_query_parser.yrl", 7). +yeccpars2_4_(__Stack0) -> + [___1 | __Stack] = __Stack0, + [begin + {select_opts, ___1} + end | __Stack]. + +-compile({inline,yeccpars2_5_/1}). +-dialyzer({nowarn_function, yeccpars2_5_/1}). +-compile({nowarn_unused_function, yeccpars2_5_/1}). +-file("src/build_query_parser.yrl", 3). +yeccpars2_5_(__Stack0) -> + [___3,___2,___1 | __Stack] = __Stack0, + [begin + {select, ___2, ___3} + end | __Stack]. + +-compile({inline,yeccpars2_6_/1}). +-dialyzer({nowarn_function, yeccpars2_6_/1}). +-compile({nowarn_unused_function, yeccpars2_6_/1}). +-file("src/build_query_parser.yrl", 9). +yeccpars2_6_(__Stack0) -> + [___1 | __Stack] = __Stack0, + [begin + {fields, ___1} + end | __Stack]. + +-compile({inline,yeccpars2_7_/1}). +-dialyzer({nowarn_function, yeccpars2_7_/1}). +-compile({nowarn_unused_function, yeccpars2_7_/1}). +-file("src/build_query_parser.yrl", 12). +yeccpars2_7_(__Stack0) -> + [___1 | __Stack] = __Stack0, + [begin + ___1 + end | __Stack]. + +-compile({inline,yeccpars2_8_/1}). +-dialyzer({nowarn_function, yeccpars2_8_/1}). +-compile({nowarn_unused_function, yeccpars2_8_/1}). +-file("src/build_query_parser.yrl", 11). +yeccpars2_8_(__Stack0) -> + [___1 | __Stack] = __Stack0, + [begin + {extract_token(___1)} + end | __Stack]. + +-compile({inline,yeccpars2_9_/1}). +-dialyzer({nowarn_function, yeccpars2_9_/1}). +-compile({nowarn_unused_function, yeccpars2_9_/1}). +-file("src/build_query_parser.yrl", 36). +yeccpars2_9_(__Stack0) -> + [___1 | __Stack] = __Stack0, + [begin + extract_value(___1) + end | __Stack]. + +-compile({inline,yeccpars2_11_/1}). +-dialyzer({nowarn_function, yeccpars2_11_/1}). +-compile({nowarn_unused_function, yeccpars2_11_/1}). +-file("src/build_query_parser.yrl", 37). +yeccpars2_11_(__Stack0) -> + [___1 | __Stack] = __Stack0, + [begin + extract_value(___1) + end | __Stack]. + +-compile({inline,yeccpars2_12_/1}). +-dialyzer({nowarn_function, yeccpars2_12_/1}). +-compile({nowarn_unused_function, yeccpars2_12_/1}). +-file("src/build_query_parser.yrl", 35). +yeccpars2_12_(__Stack0) -> + [___1 | __Stack] = __Stack0, + [begin + {quoted, extract_value(___1)} + end | __Stack]. + +-compile({inline,yeccpars2_17_/1}). +-dialyzer({nowarn_function, yeccpars2_17_/1}). +-compile({nowarn_unused_function, yeccpars2_17_/1}). +-file("src/build_query_parser.yrl", 30). +yeccpars2_17_(__Stack0) -> + [___3,___2,___1 | __Stack] = __Stack0, + [begin + {grouping, ___2} + end | __Stack]. + +-compile({inline,yeccpars2_18_/1}). +-dialyzer({nowarn_function, yeccpars2_18_/1}). +-compile({nowarn_unused_function, yeccpars2_18_/1}). +-file("src/build_query_parser.yrl", 33). +yeccpars2_18_(__Stack0) -> + [___3,___2,___1 | __Stack] = __Stack0, + [begin + {extract_value(___2), ___1, ___3} + end | __Stack]. + +-compile({inline,yeccpars2_19_/1}). +-dialyzer({nowarn_function, yeccpars2_19_/1}). +-compile({nowarn_unused_function, yeccpars2_19_/1}). +-file("src/build_query_parser.yrl", 31). +yeccpars2_19_(__Stack0) -> + [___3,___2,___1 | __Stack] = __Stack0, + [begin + {booelan_mult, ___1, ___3} + end | __Stack]. + +-compile({inline,yeccpars2_20_/1}). +-dialyzer({nowarn_function, yeccpars2_20_/1}). +-compile({nowarn_unused_function, yeccpars2_20_/1}). +-file("src/build_query_parser.yrl", 32). +yeccpars2_20_(__Stack0) -> + [___3,___2,___1 | __Stack] = __Stack0, + [begin + {boolean_add, ___1, ___3} + end | __Stack]. + +-compile({inline,yeccpars2_22_/1}). +-dialyzer({nowarn_function, yeccpars2_22_/1}). +-compile({nowarn_unused_function, yeccpars2_22_/1}). +-file("src/build_query_parser.yrl", 34). +yeccpars2_22_(__Stack0) -> + [___3,___2,___1 | __Stack] = __Stack0, + [begin + {fieldname, extract_value(___1), '.', extract_value(___3)} + end | __Stack]. + +-compile({inline,yeccpars2_24_/1}). +-dialyzer({nowarn_function, yeccpars2_24_/1}). +-compile({nowarn_unused_function, yeccpars2_24_/1}). +-file("src/build_query_parser.yrl", 10). +yeccpars2_24_(__Stack0) -> + [___3,___2,___1 | __Stack] = __Stack0, + [begin + {___1, ___3} + end | __Stack]. + +-compile({inline,yeccpars2_26_/1}). +-dialyzer({nowarn_function, yeccpars2_26_/1}). +-compile({nowarn_unused_function, yeccpars2_26_/1}). +-file("src/build_query_parser.yrl", 24). +yeccpars2_26_(__Stack0) -> + [begin + nil + end | __Stack0]. + +-compile({inline,yeccpars2_27_/1}). +-dialyzer({nowarn_function, yeccpars2_27_/1}). +-compile({nowarn_unused_function, yeccpars2_27_/1}). +-file("src/build_query_parser.yrl", 14). +yeccpars2_27_(__Stack0) -> + [___1 | __Stack] = __Stack0, + [begin + {from, ___1} + end | __Stack]. + +-compile({inline,yeccpars2_28_/1}). +-dialyzer({nowarn_function, yeccpars2_28_/1}). +-compile({nowarn_unused_function, yeccpars2_28_/1}). +-file("src/build_query_parser.yrl", 15). +yeccpars2_28_(__Stack0) -> + [___1 | __Stack] = __Stack0, + [begin + ___1 + end | __Stack]. + +-compile({inline,yeccpars2_29_/1}). +-dialyzer({nowarn_function, yeccpars2_29_/1}). +-compile({nowarn_unused_function, yeccpars2_29_/1}). +-file("src/build_query_parser.yrl", 16). +yeccpars2_29_(__Stack0) -> + [___1 | __Stack] = __Stack0, + [begin + ___1 + end | __Stack]. + +-compile({inline,yeccpars2_30_/1}). +-dialyzer({nowarn_function, yeccpars2_30_/1}). +-compile({nowarn_unused_function, yeccpars2_30_/1}). +-file("src/build_query_parser.yrl", 27). +yeccpars2_30_(__Stack0) -> + [begin + nil + end | __Stack0]. + +-compile({inline,yeccpars2_31_/1}). +-dialyzer({nowarn_function, yeccpars2_31_/1}). +-compile({nowarn_unused_function, yeccpars2_31_/1}). +-file("src/build_query_parser.yrl", 22). +yeccpars2_31_(__Stack0) -> + [___2,___1 | __Stack] = __Stack0, + [begin + {___1, ___2} + end | __Stack]. + +-compile({inline,yeccpars2_33_/1}). +-dialyzer({nowarn_function, yeccpars2_33_/1}). +-compile({nowarn_unused_function, yeccpars2_33_/1}). +-file("src/build_query_parser.yrl", 28). +yeccpars2_33_(__Stack0) -> + [___2,___1 | __Stack] = __Stack0, + [begin + {alias, ___2} + end | __Stack]. + +-compile({inline,yeccpars2_36_/1}). +-dialyzer({nowarn_function, yeccpars2_36_/1}). +-compile({nowarn_unused_function, yeccpars2_36_/1}). +-file("src/build_query_parser.yrl", 18). +yeccpars2_36_(__Stack0) -> + [___4,___3,___2,___1 | __Stack] = __Stack0, + [begin + {join, ___1, ___3, ___4} + end | __Stack]. + +-compile({inline,yeccpars2_37_/1}). +-dialyzer({nowarn_function, yeccpars2_37_/1}). +-compile({nowarn_unused_function, yeccpars2_37_/1}). +-file("src/build_query_parser.yrl", 19). +yeccpars2_37_(__Stack0) -> + [___1 | __Stack] = __Stack0, + [begin + ___1 + end | __Stack]. + +-compile({inline,yeccpars2_39_/1}). +-dialyzer({nowarn_function, yeccpars2_39_/1}). +-compile({nowarn_unused_function, yeccpars2_39_/1}). +-file("src/build_query_parser.yrl", 20). +yeccpars2_39_(__Stack0) -> + [___2,___1 | __Stack] = __Stack0, + [begin + {on, ___2} + end | __Stack]. + +-compile({inline,yeccpars2_40_/1}). +-dialyzer({nowarn_function, yeccpars2_40_/1}). +-compile({nowarn_unused_function, yeccpars2_40_/1}). +-file("src/build_query_parser.yrl", 4). +yeccpars2_40_(__Stack0) -> + [___6,___5,___4,___3,___2,___1 | __Stack] = __Stack0, + [begin + {select, ___2, ___3, ___5, ___6} + end | __Stack]. + +-compile({inline,yeccpars2_42_/1}). +-dialyzer({nowarn_function, yeccpars2_42_/1}). +-compile({nowarn_unused_function, yeccpars2_42_/1}). +-file("src/build_query_parser.yrl", 25). +yeccpars2_42_(__Stack0) -> + [___2,___1 | __Stack] = __Stack0, + [begin + {where, ___2} + end | __Stack]. + + +-file("src/build_query_parser.yrl", 49). diff --git a/src/build_query_parser.yrl b/src/build_query_parser.yrl new file mode 100644 index 0000000..7cfadfb --- /dev/null +++ b/src/build_query_parser.yrl @@ -0,0 +1,48 @@ +Nonterminals select_stmt select_opts select_expr_list select_expr table_references table_reference + table_factor opt_where opt_as_alias join_table opt_join_condition join_condition expr. +Terminals identifier select from where operator number as quoted boolean_mult boolean_add join on +left_paren right_paren fieldname grouping dot comma distinct all all_fields. +Rootsymbol select_stmt. + +select_stmt -> select select_opts select_expr_list : {select, '$2', '$3'}. +select_stmt -> select select_opts select_expr_list from table_references opt_where : {select, '$2', '$3', '$5', '$6'}. + +select_opts -> '$empty' : nil. +select_opts -> distinct : {select_opts, '$1'}. +select_expr_list -> '$empty' : nil. +select_expr_list -> select_expr : {fields, '$1'}. +select_expr -> select_expr comma select_expr : {'$1', '$3'}. +select_expr -> all: {extract_token('$1')}. +select_expr -> expr : '$1'. + +table_references -> table_reference : {from, '$1'}. +table_reference -> table_factor : '$1'. +table_reference -> join_table : '$1'. + +join_table -> table_reference join table_factor opt_join_condition : {join, '$1', '$3', '$4'}. +opt_join_condition -> join_condition : '$1'. +join_condition -> on expr : {on, '$2'}. + +table_factor -> expr opt_as_alias: {'$1', '$2'}. + +opt_where -> '$empty' : nil. +opt_where -> where expr : {where, '$2'}. + +opt_as_alias -> '$empty' : nil. +opt_as_alias -> as expr : {alias, '$2'}. + +expr -> left_paren expr right_paren: {grouping, '$2'}. +expr -> expr boolean_mult expr: {booelan_mult, '$1', '$3'}. +expr -> expr boolean_add expr: {boolean_add, '$1', '$3'}. +expr -> expr operator expr : {extract_value('$2'), '$1', '$3'}. +expr -> identifier dot identifier : {fieldname, extract_value('$1'), '.', extract_value('$3')}. +expr -> quoted : {quoted, extract_value('$1')}. +expr -> identifier : extract_value('$1'). +expr -> number : extract_value('$1'). + +Erlang code. + +-import(string,[len/1, sub_string/3]). + +extract_value({_Token, _Line, Value}) -> Value. +extract_token({Token, _Line}) -> Token. diff --git a/src/test.md b/src/test.md new file mode 100644 index 0000000..344958b --- /dev/null +++ b/src/test.md @@ -0,0 +1,10 @@ +# IDEA + +### Simple select +{:select, + {:fields, :*}, + {:from, table_name}, + {:where, {:=, field, value}} +} + + diff --git a/test/query_builder/query_builder_test.exs b/test/query_builder/query_builder_test.exs new file mode 100644 index 0000000..fe21ea6 --- /dev/null +++ b/test/query_builder/query_builder_test.exs @@ -0,0 +1,44 @@ +defmodule KinoEcto.QueryBuilderTest do + use ExUnit.Case + + import Ecto.Query + + alias KinoEcto.QueryBuilder + + test "parses simple query" do + query = "SELECT name, age FROM customers" + result = QueryBuilder.call(query) + + expected_query = from(c in KinoEcto.QueryBuilder.Domain.Customer, select: [:name, :age]) + + assert result.from.source == expected_query.from.source + assert result.select.take == expected_query.select.take + end + + test "parses simple query with all fields" do + query = "SELECT * FROM customers" + result = QueryBuilder.call(query) + + expected_query = from(c in KinoEcto.QueryBuilder.Domain.Customer) + + assert result.from.source == expected_query.from.source + assert is_nil(result.select) + assert is_nil(expected_query.select) + end + + test "parses query with join" do + query = "SELECT * FROM sales JOIN customers ON sales.customer_id = customers.id" + result = QueryBuilder.call(query) + + expected_query = + from(s in KinoEcto.QueryBuilder.Domain.Sale, + join: c in KinoEcto.QueryBuilder.Domain.Customer, + on: s.customer_id == c.id + ) + + IO.inspect(result) + # assert result.from.source == expected_query.from.source + # assert is_nil(result.select) + # assert is_nil(expected_query.select) + end +end diff --git a/test/query_builder_test.exs b/test/query_builder_test.exs deleted file mode 100644 index a74b142..0000000 --- a/test/query_builder_test.exs +++ /dev/null @@ -1,16 +0,0 @@ -defmodule KinoEcto.QueryBuilderTest do - use ExUnit.Case - - alias KinoEcto.QueryBuilder - - test "parses simple query" do - query = "SELECT * FROM persons WHERE name = 'John'" - - IO.inspect(QueryBuilder.call(%QueryBuilder{sql_query: query})) - IO.inspect(QueryBuilder.test(query)) - end - - test "parses simple with where" do - _query = "SELECT name FROM persons WHERE name = 'John'" - end -end