-module(xqldb_json_parser). -export([parse/1, parse_and_scan/1, format_error/1]). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 91). %% ------------------------------------------------------------------- %% %% xqerl_db - XML Database for xqerl XQuery processor %% %% Copyright (c) 2018-2020 Zachary N. Dean All Rights Reserved. %% %% This file is provided to you 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. %% %% ------------------------------------------------------------------- %% @doc JSON parser (RFC7159). -compile([{hipe, [{regalloc, linear_scan}]}]). -include("xqerl_db.hrl"). val({_, _, Token}) when hd(Token) == $" -> unicode:characters_to_binary(tl(lists:droplast(Token))); val({_, _, Token}) -> unicode:characters_to_binary(Token). str_val(Val) -> norm_str(val(Val), <<>>). %unicode:characters_to_list(norm_str(val(Val))). list_to_number(List) -> {xqerl_numeric:double(List), List}. norm_str(<<>>, Acc) -> Acc; norm_str(<<$\\, $", T/binary>>, Acc) -> norm_str(T, <>); norm_str(<<$\\, $\\, T/binary>>, Acc) -> norm_str(T, <>); norm_str(<<$\\, $/, T/binary>>, Acc) -> norm_str(T, <>); norm_str(<<$\\, $b, T/binary>>, Acc) -> norm_str(T, <>); norm_str(<<$\\, $f, T/binary>>, Acc) -> norm_str(T, <>); norm_str(<<$\\, $n, T/binary>>, Acc) -> norm_str(T, <>); norm_str(<<$\\, $r, T/binary>>, Acc) -> norm_str(T, <>); norm_str(<<$\\, $t, T/binary>>, Acc) -> norm_str(T, <>); norm_str(<<$\\, $u, A, B, C, D, $\\, $u, A2, B2, C2, D2, T/binary>>, Acc) -> High = list_to_integer([A, B, C, D], 16), Low = list_to_integer([A2, B2, C2, D2], 16), if High >= 16#D800, High =< 16#DFFF, Low >= 16#D800, Low =< 16#DFFF -> New = from_surrogates(High, Low), NewC = maybe_utf(New), norm_str(T, <>); true -> HighC = maybe_utf(High), LowC = maybe_utf(Low), norm_str(T, <>) end; norm_str(<<$\\, $u, A, B, C, D, T/binary>>, Acc) -> Int = list_to_integer([A, B, C, D], 16), H = maybe_utf(Int), norm_str(T, <>); norm_str(<>, Acc) -> norm_str(T, <>). from_surrogates(High, Low) -> HC = (High - 16#D800) bsl 10, LC = Low - 16#DC00, HC bor LC + 16#10000. maybe_utf(Char) -> try <> of H -> H catch _:_ -> <<$\\, $u, (integer_to_binary(Char, 16))/binary>> %<<0/utf8>> end. -file("/usr/local/Cellar/erlang/24.1.2/lib/erlang/lib/parsetools-2.3.1/include/yeccpre.hrl", 0). %% %% %CopyrightBegin% %% %% Copyright Ericsson AB 1996-2018. 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({atom, _, A}) -> io_lib:write_atom(A); yecctoken2string({integer, _, N}) -> io_lib:write(N); yecctoken2string({float, _, F}) -> io_lib:write(F); yecctoken2string({char, _, C}) -> io_lib:write_char(C); yecctoken2string({var, _, V}) -> io_lib:format("~s", [V]); yecctoken2string({string, _, S}) -> io_lib:write_string(S); yecctoken2string({reserved_symbol, _, A}) -> io_lib:write(A); yecctoken2string({_Cat, _, Val}) -> io_lib:format("~tp", [Val]); yecctoken2string({dot, _}) -> "'.'"; yecctoken2string({'$end', _}) -> []; yecctoken2string({Other, _}) when is_atom(Other) -> io_lib:write_atom(Other); yecctoken2string(Other) -> io_lib:format("~tp", [Other]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.erl", 269). -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_14(S, Cat, Ss, Stack, T, Ts, Tzr); yeccpars2(15 = S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_15(S, Cat, Ss, Stack, T, Ts, Tzr); yeccpars2(16 = S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_16(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_25(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_17(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_32(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_34(S, Cat, Ss, Stack, T, Ts, Tzr); yeccpars2(35 = S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_17(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(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, array_begin, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 4, Ss, Stack, T, Ts, Tzr); yeccpars2_0(S, esc_string, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 5, Ss, Stack, T, Ts, Tzr); yeccpars2_0(S, false, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 6, Ss, Stack, T, Ts, Tzr); yeccpars2_0(S, null, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 7, Ss, Stack, T, Ts, Tzr); yeccpars2_0(S, number, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 8, Ss, Stack, T, Ts, Tzr); yeccpars2_0(S, object_begin, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr); yeccpars2_0(S, string, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 10, Ss, Stack, T, Ts, Tzr); yeccpars2_0(S, true, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 11, 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, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_2_(Stack), yeccgoto_root(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_3/7}). -compile({nowarn_unused_function, yeccpars2_3/7}). yeccpars2_3(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_3_(Stack), yeccgoto_root(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). yeccpars2_4(S, array_begin, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 4, Ss, Stack, T, Ts, Tzr); yeccpars2_4(S, array_end, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 34, Ss, Stack, T, Ts, Tzr); yeccpars2_4(S, object_begin, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr); yeccpars2_4(S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_cont_4(S, Cat, Ss, Stack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_4/7}). -compile({nowarn_unused_function, yeccpars2_4/7}). yeccpars2_cont_4(S, esc_string, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 21, Ss, Stack, T, Ts, Tzr); yeccpars2_cont_4(S, false, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 22, Ss, Stack, T, Ts, Tzr); yeccpars2_cont_4(S, null, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 23, Ss, Stack, T, Ts, Tzr); yeccpars2_cont_4(S, number, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 24, Ss, Stack, T, Ts, Tzr); yeccpars2_cont_4(S, string, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 25, Ss, Stack, T, Ts, Tzr); yeccpars2_cont_4(S, true, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 26, Ss, Stack, T, Ts, Tzr); yeccpars2_cont_4(_, _, _, _, T, _, _) -> yeccerror(T). -dialyzer({nowarn_function, yeccpars2_5/7}). -compile({nowarn_unused_function, yeccpars2_5/7}). yeccpars2_5(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_5_(Stack), yeccgoto_root(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_6/7}). -compile({nowarn_unused_function, yeccpars2_6/7}). yeccpars2_6(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_6_(Stack), yeccgoto_root(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_7/7}). -compile({nowarn_unused_function, yeccpars2_7/7}). yeccpars2_7(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_7_(Stack), yeccgoto_root(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_root(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). yeccpars2_9(S, object_end, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 15, Ss, Stack, T, Ts, Tzr); yeccpars2_9(S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_29(S, Cat, Ss, Stack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_10/7}). -compile({nowarn_unused_function, yeccpars2_10/7}). yeccpars2_10(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_10_(Stack), yeccgoto_root(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). -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_root(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_12/7}). -compile({nowarn_unused_function, yeccpars2_12/7}). yeccpars2_12(S, object_end, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 31, Ss, Stack, T, Ts, Tzr); yeccpars2_12(_, _, _, _, T, _, _) -> yeccerror(T). -dialyzer({nowarn_function, yeccpars2_13/7}). -compile({nowarn_unused_function, yeccpars2_13/7}). yeccpars2_13(S, value_sep, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 29, Ss, Stack, T, Ts, Tzr); yeccpars2_13(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_13_(Stack), yeccgoto_members(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_14/7}). -compile({nowarn_unused_function, yeccpars2_14/7}). yeccpars2_14(S, name_sep, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 27, Ss, Stack, T, Ts, Tzr); yeccpars2_14(_, _, _, _, T, _, _) -> yeccerror(T). -dialyzer({nowarn_function, yeccpars2_15/7}). -compile({nowarn_unused_function, yeccpars2_15/7}). yeccpars2_15(_S, Cat, Ss, Stack, T, Ts, Tzr) -> [_ | Nss] = Ss, NewStack = yeccpars2_15_(Stack), yeccgoto_object(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_16/7}). -compile({nowarn_unused_function, yeccpars2_16/7}). yeccpars2_16(S, name_sep, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 17, Ss, Stack, T, Ts, Tzr); yeccpars2_16(_, _, _, _, T, _, _) -> yeccerror(T). yeccpars2_17(S, array_begin, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 4, Ss, Stack, T, Ts, Tzr); yeccpars2_17(S, object_begin, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr); yeccpars2_17(S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_cont_4(S, Cat, Ss, Stack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_18/7}). -compile({nowarn_unused_function, yeccpars2_18/7}). yeccpars2_18(_S, Cat, Ss, Stack, T, Ts, Tzr) -> [_, _ | Nss] = Ss, NewStack = yeccpars2_18_(Stack), yeccgoto_member(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_19/7}). -compile({nowarn_unused_function, yeccpars2_19/7}). yeccpars2_19(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_19_(Stack), yeccgoto_value(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_20/7}). -compile({nowarn_unused_function, yeccpars2_20/7}). yeccpars2_20(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_20_(Stack), yeccgoto_value(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_21/7}). -compile({nowarn_unused_function, yeccpars2_21/7}). yeccpars2_21(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_21_(Stack), yeccgoto_value(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_22/7}). -compile({nowarn_unused_function, yeccpars2_22/7}). yeccpars2_22(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_22_(Stack), yeccgoto_value(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_23/7}). -compile({nowarn_unused_function, yeccpars2_23/7}). yeccpars2_23(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_23_(Stack), yeccgoto_value(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_24/7}). -compile({nowarn_unused_function, yeccpars2_24/7}). yeccpars2_24(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_24_(Stack), yeccgoto_value(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_25/7}). -compile({nowarn_unused_function, yeccpars2_25/7}). yeccpars2_25(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_25_(Stack), yeccgoto_value(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_26/7}). -compile({nowarn_unused_function, yeccpars2_26/7}). yeccpars2_26(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_26_(Stack), yeccgoto_value(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). %% yeccpars2_27: see yeccpars2_17 -dialyzer({nowarn_function, yeccpars2_28/7}). -compile({nowarn_unused_function, yeccpars2_28/7}). yeccpars2_28(_S, Cat, Ss, Stack, T, Ts, Tzr) -> [_, _ | Nss] = Ss, NewStack = yeccpars2_28_(Stack), yeccgoto_member(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_29/7}). -compile({nowarn_unused_function, yeccpars2_29/7}). yeccpars2_29(S, esc_string, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 14, Ss, Stack, T, Ts, Tzr); yeccpars2_29(S, string, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 16, Ss, Stack, T, Ts, Tzr); yeccpars2_29(_, _, _, _, T, _, _) -> yeccerror(T). -dialyzer({nowarn_function, yeccpars2_30/7}). -compile({nowarn_unused_function, yeccpars2_30/7}). yeccpars2_30(_S, Cat, Ss, Stack, T, Ts, Tzr) -> [_, _ | Nss] = Ss, NewStack = yeccpars2_30_(Stack), yeccgoto_members(hd(Nss), Cat, Nss, 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_object(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_32/7}). -compile({nowarn_unused_function, yeccpars2_32/7}). yeccpars2_32(S, array_end, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 37, Ss, Stack, T, Ts, Tzr); yeccpars2_32(_, _, _, _, T, _, _) -> yeccerror(T). -dialyzer({nowarn_function, yeccpars2_33/7}). -compile({nowarn_unused_function, yeccpars2_33/7}). yeccpars2_33(S, value_sep, Ss, Stack, T, Ts, Tzr) -> yeccpars1(S, 35, Ss, Stack, T, Ts, Tzr); yeccpars2_33(_S, Cat, Ss, Stack, T, Ts, Tzr) -> NewStack = yeccpars2_33_(Stack), yeccgoto_values(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccpars2_34/7}). -compile({nowarn_unused_function, yeccpars2_34/7}). yeccpars2_34(_S, Cat, Ss, Stack, T, Ts, Tzr) -> [_ | Nss] = Ss, NewStack = yeccpars2_34_(Stack), yeccgoto_array(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). %% yeccpars2_35: see yeccpars2_17 -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_values(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) -> [_, _ | Nss] = Ss, NewStack = yeccpars2_37_(Stack), yeccgoto_array(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccgoto_array/7}). -compile({nowarn_unused_function, yeccgoto_array/7}). yeccgoto_array(0 = _S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_3(_S, Cat, Ss, Stack, T, Ts, Tzr); yeccgoto_array(4 = _S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_20(_S, Cat, Ss, Stack, T, Ts, Tzr); yeccgoto_array(17 = _S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_20(_S, Cat, Ss, Stack, T, Ts, Tzr); yeccgoto_array(27 = _S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_20(_S, Cat, Ss, Stack, T, Ts, Tzr); yeccgoto_array(35 = _S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_20(_S, Cat, Ss, Stack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccgoto_member/7}). -compile({nowarn_unused_function, yeccgoto_member/7}). yeccgoto_member(9, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_13(13, Cat, Ss, Stack, T, Ts, Tzr); yeccgoto_member(29, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_13(13, Cat, Ss, Stack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccgoto_members/7}). -compile({nowarn_unused_function, yeccgoto_members/7}). yeccgoto_members(9, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_12(12, Cat, Ss, Stack, T, Ts, Tzr); yeccgoto_members(29 = _S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_30(_S, Cat, Ss, Stack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccgoto_object/7}). -compile({nowarn_unused_function, yeccgoto_object/7}). yeccgoto_object(0 = _S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_2(_S, Cat, Ss, Stack, T, Ts, Tzr); yeccgoto_object(4 = _S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_19(_S, Cat, Ss, Stack, T, Ts, Tzr); yeccgoto_object(17 = _S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_19(_S, Cat, Ss, Stack, T, Ts, Tzr); yeccgoto_object(27 = _S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_19(_S, Cat, Ss, Stack, T, Ts, Tzr); yeccgoto_object(35 = _S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_19(_S, Cat, Ss, Stack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccgoto_root/7}). -compile({nowarn_unused_function, yeccgoto_root/7}). yeccgoto_root(0, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_1(1, Cat, Ss, Stack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccgoto_value/7}). -compile({nowarn_unused_function, yeccgoto_value/7}). yeccgoto_value(4, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_33(33, Cat, Ss, Stack, T, Ts, Tzr); yeccgoto_value(17 = _S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_18(_S, Cat, Ss, Stack, T, Ts, Tzr); yeccgoto_value(27 = _S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_28(_S, Cat, Ss, Stack, T, Ts, Tzr); yeccgoto_value(35, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_33(33, Cat, Ss, Stack, T, Ts, Tzr). -dialyzer({nowarn_function, yeccgoto_values/7}). -compile({nowarn_unused_function, yeccgoto_values/7}). yeccgoto_values(4, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_32(32, Cat, Ss, Stack, T, Ts, Tzr); yeccgoto_values(35 = _S, Cat, Ss, Stack, T, Ts, Tzr) -> yeccpars2_36(_S, 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("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 25). yeccpars2_2_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin ___1 end | __Stack ]. -compile({inline, yeccpars2_3_/1}). -dialyzer({nowarn_function, yeccpars2_3_/1}). -compile({nowarn_unused_function, yeccpars2_3_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 27). yeccpars2_3_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin ___1 end | __Stack ]. -compile({inline, yeccpars2_5_/1}). -dialyzer({nowarn_function, yeccpars2_5_/1}). -compile({nowarn_unused_function, yeccpars2_5_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 31). yeccpars2_5_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin str_val(___1) end | __Stack ]. -compile({inline, yeccpars2_6_/1}). -dialyzer({nowarn_function, yeccpars2_6_/1}). -compile({nowarn_unused_function, yeccpars2_6_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 35). yeccpars2_6_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin false end | __Stack ]. -compile({inline, yeccpars2_7_/1}). -dialyzer({nowarn_function, yeccpars2_7_/1}). -compile({nowarn_unused_function, yeccpars2_7_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 37). yeccpars2_7_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin null end | __Stack ]. -compile({inline, yeccpars2_8_/1}). -dialyzer({nowarn_function, yeccpars2_8_/1}). -compile({nowarn_unused_function, yeccpars2_8_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 33). yeccpars2_8_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin list_to_number(val(___1)) end | __Stack ]. -compile({inline, yeccpars2_10_/1}). -dialyzer({nowarn_function, yeccpars2_10_/1}). -compile({nowarn_unused_function, yeccpars2_10_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 29). yeccpars2_10_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin val(___1) end | __Stack ]. -compile({inline, yeccpars2_11_/1}). -dialyzer({nowarn_function, yeccpars2_11_/1}). -compile({nowarn_unused_function, yeccpars2_11_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 39). yeccpars2_11_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin true end | __Stack ]. -compile({inline, yeccpars2_13_/1}). -dialyzer({nowarn_function, yeccpars2_13_/1}). -compile({nowarn_unused_function, yeccpars2_13_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 53). yeccpars2_13_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin [___1] end | __Stack ]. -compile({inline, yeccpars2_15_/1}). -dialyzer({nowarn_function, yeccpars2_15_/1}). -compile({nowarn_unused_function, yeccpars2_15_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 44). yeccpars2_15_(__Stack0) -> [___2, ___1 | __Stack] = __Stack0, [ begin {object, []} end | __Stack ]. -compile({inline, yeccpars2_18_/1}). -dialyzer({nowarn_function, yeccpars2_18_/1}). -compile({nowarn_unused_function, yeccpars2_18_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 56). yeccpars2_18_(__Stack0) -> [___3, ___2, ___1 | __Stack] = __Stack0, [ begin {val(___1), ___3} end | __Stack ]. -compile({inline, yeccpars2_19_/1}). -dialyzer({nowarn_function, yeccpars2_19_/1}). -compile({nowarn_unused_function, yeccpars2_19_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 73). yeccpars2_19_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin ___1 end | __Stack ]. -compile({inline, yeccpars2_20_/1}). -dialyzer({nowarn_function, yeccpars2_20_/1}). -compile({nowarn_unused_function, yeccpars2_20_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 75). yeccpars2_20_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin ___1 end | __Stack ]. -compile({inline, yeccpars2_21_/1}). -dialyzer({nowarn_function, yeccpars2_21_/1}). -compile({nowarn_unused_function, yeccpars2_21_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 83). yeccpars2_21_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin str_val(___1) end | __Stack ]. -compile({inline, yeccpars2_22_/1}). -dialyzer({nowarn_function, yeccpars2_22_/1}). -compile({nowarn_unused_function, yeccpars2_22_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 67). yeccpars2_22_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin false end | __Stack ]. -compile({inline, yeccpars2_23_/1}). -dialyzer({nowarn_function, yeccpars2_23_/1}). -compile({nowarn_unused_function, yeccpars2_23_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 69). yeccpars2_23_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin null end | __Stack ]. -compile({inline, yeccpars2_24_/1}). -dialyzer({nowarn_function, yeccpars2_24_/1}). -compile({nowarn_unused_function, yeccpars2_24_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 77). yeccpars2_24_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin list_to_number(val(___1)) end | __Stack ]. -compile({inline, yeccpars2_25_/1}). -dialyzer({nowarn_function, yeccpars2_25_/1}). -compile({nowarn_unused_function, yeccpars2_25_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 80). yeccpars2_25_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin val(___1) end | __Stack ]. -compile({inline, yeccpars2_26_/1}). -dialyzer({nowarn_function, yeccpars2_26_/1}). -compile({nowarn_unused_function, yeccpars2_26_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 71). yeccpars2_26_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin true end | __Stack ]. -compile({inline, yeccpars2_28_/1}). -dialyzer({nowarn_function, yeccpars2_28_/1}). -compile({nowarn_unused_function, yeccpars2_28_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 59). yeccpars2_28_(__Stack0) -> [___3, ___2, ___1 | __Stack] = __Stack0, [ begin {str_val(___1), ___3} end | __Stack ]. -compile({inline, yeccpars2_30_/1}). -dialyzer({nowarn_function, yeccpars2_30_/1}). -compile({nowarn_unused_function, yeccpars2_30_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 51). yeccpars2_30_(__Stack0) -> [___3, ___2, ___1 | __Stack] = __Stack0, [ begin [___1 | ___3] end | __Stack ]. -compile({inline, yeccpars2_31_/1}). -dialyzer({nowarn_function, yeccpars2_31_/1}). -compile({nowarn_unused_function, yeccpars2_31_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 42). yeccpars2_31_(__Stack0) -> [___3, ___2, ___1 | __Stack] = __Stack0, [ begin {object, ___2} end | __Stack ]. -compile({inline, yeccpars2_33_/1}). -dialyzer({nowarn_function, yeccpars2_33_/1}). -compile({nowarn_unused_function, yeccpars2_33_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 64). yeccpars2_33_(__Stack0) -> [___1 | __Stack] = __Stack0, [ begin [___1] end | __Stack ]. -compile({inline, yeccpars2_34_/1}). -dialyzer({nowarn_function, yeccpars2_34_/1}). -compile({nowarn_unused_function, yeccpars2_34_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 48). yeccpars2_34_(__Stack0) -> [___2, ___1 | __Stack] = __Stack0, [ begin {array, []} end | __Stack ]. -compile({inline, yeccpars2_36_/1}). -dialyzer({nowarn_function, yeccpars2_36_/1}). -compile({nowarn_unused_function, yeccpars2_36_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 62). yeccpars2_36_(__Stack0) -> [___3, ___2, ___1 | __Stack] = __Stack0, [ begin [___1 | ___3] end | __Stack ]. -compile({inline, yeccpars2_37_/1}). -dialyzer({nowarn_function, yeccpars2_37_/1}). -compile({nowarn_unused_function, yeccpars2_37_/1}). -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 46). yeccpars2_37_(__Stack0) -> [___3, ___2, ___1 | __Stack] = __Stack0, [ begin {array, ___2} end | __Stack ]. -file("/Users/zdean/git/zadean/xqerl/src/xqldb_json_parser.yrl", 186).