www
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYestin L. Harrison <yestin@ylh.io>2020-06-08 15:59:25 -0700
committerYestin L. Harrison <yestin@ylh.io>2020-06-08 15:59:25 -0700
commit9eb3af0fc23b718491483ead3e2e16a0af4b14c3 (patch)
tree77626593e6cf91a5af48893f5e22f479e50b221c
parente13f050b9131524fec941a1234eb0e54684afb41 (diff)
downloaducm-master.tar.gz
ucm-master.tar.xz
ucm-master.zip
back off the backburnerHEADmaster
-rw-r--r--src/ucm.erl102
-rw-r--r--src/ucm_lexer.xrl17
-rw-r--r--src/ucm_line.erl1143
-rw-r--r--src/ucm_line.yrl (renamed from src/ucm_parser.yrl)62
4 files changed, 1248 insertions, 76 deletions
diff --git a/src/ucm.erl b/src/ucm.erl
index ba12972..7b60d81 100644
--- a/src/ucm.erl
+++ b/src/ucm.erl
@@ -34,16 +34,13 @@
inport,
inport_base,
outport,
+ line = 1,
headers = #headers{},
- uconv_class_loc = none,
- mb_cur_min_loc = none,
- mb_cur_max_loc = none,
- mb_cur_max_guess = 0,
firstentries,
rows,
- tree = #ucmfile{}
+ current_line
}).
%%%
@@ -92,7 +89,9 @@ file(File, Options) ->
format_error({internal_error, E}) ->
io_lib:fwrite("internal ucm error: ~w", [E]);
format_error({error, Mod, E}) ->
- io_lib:fwrite("~ts", [Mod:format_error(E)]).
+ io_lib:fwrite("~ts", [Mod:format_error(E)]);
+format_error(Else) ->
+ io_lib:fwrite("~p", [Else]).
%%%
%%% Local functions
@@ -266,44 +265,80 @@ outfile(St0) ->
-define(PASS(P), {P, fun P/1}).
+% The docs are made entirely of pernicious half-truths; they are absolutely
+% nothing like a spec you can just... implement. This follows the general
+% outline of the current icu4c source at time of writing (64.2, December 2019),
+% as it's the one thing that doesn't lie. Since the C source is classic
+% line-by-line manual parsing interleaved with processing, we emulate that state
+% closely to keep the process idiot-proof for ourselves, as close as possible
+% to rote transcription. At least yecc makes this whole process considerably
+% less painful than it could be.
generate(St) ->
- Passes = [?PASS(parse_mapping), ?PASS(headers), ?PASS(thus_far)],
+ Passes = [?PASS(read_header)],
run(Passes, St).
run(Passes, St0) ->
F = fun(_Name, Fn, St) -> Fn(St) end,
- Trap = fun({Name, Fun}, St) ->
- St1 = F(Name, Fun, St),
- if
- St1#ucm.errors =:= [] -> St1;
- true -> throw(St1)
+ Trap = fun T({Name, Fun}, St) ->
+ {Status, St1#ucm{errors=Errors}} = F(Name, Fun, St),
+ case {Status, Errors} of
+ {done, []} -> St1;
+ {more, []} -> T({Name, Fun}, St1);
+ _ -> throw(St1)
end
end,
foldl(Trap, St0, Passes).
-parse_mapping(St) ->
- Args = [St#ucm.inport, {get_until, '', ucm_lexer, tokens, []}],
- case ucm_parser:parse_and_scan({io, request, Args}) of
- {ok, Tree} ->
- St#ucm{tree = Tree};
- {error, {Line, Mod, E}} ->
- add_error(erl_anno:new(Line), {error, Mod, E}, St)
+read_header(St0) ->
+ #ucm{current_line=CL}=St1 = read_line(St0),
+ case CL of
+ #header{} -> {more, process_header(CL, St1)};
+ #'icu:state'{} -> {more, process_header(CL, St1)};
+ {'CHARMAP', _} -> {done, St1};
+ _ -> {done, unexpected(CL, St1)}
end.
-headers(St) ->
- #ucm{tree = #ucmfile{headers = Hs}} = St,
- foldl(fun header/2, St, Hs).
-
-header(#header{key = _K, value = _V, line = _L}, St) ->
- St;
-header(#'icu:state'{}=H, St) ->
- #ucm{headers = #headers{'icu:state'=Ss}=Hs} = St,
- St#ucm{headers = Hs#headers{'icu:state' = Ss ++ [H]}}.
+process_header(#header{key=K, value=V, line=L}=H, #ucm{headers=Hs}=St) ->
+ case K of
+ uconv_class when V =:= "DBCS"; V =:= "SBCS";
+ V =:= "MBCS"; V =:= "EBCDIC_STATEFUL" ->
+ St#ucm{headers = Hs#headers{uconv_class = V}};
+ uconv_class ->
+ add_error(erl_anno:new(L), {unknown, K, V}, St);
+ _ when K =:= mb_cur_max orelse K =:= mb_cur_min,
+ 1 > V orelse V > 4 ->
+ add_error(erl_anno:new(L), {unknown, K, V}, St);
+ mb_cur_max ->
+ St#ucm{headers = Hs#headers{mb_cur_max = V}};
+ mb_cur_min ->
+ St#ucm{headers = Hs#headers{mb_cur_min = V}};
+ 'icu:base' ->
+ St#ucm{headers = Hs#headers{'icu:base' = V}};
+ _ ->
+ St % we super don't care about code_set_name
+ end;
+process_header(#'icu:state'{}=H, St) ->
+ io:format("~p~n", [H]),
+ St.
+
+read_line(#ucm{line=L}=St0) ->
+ Args = [St0#ucm.inport, {get_until, '', ucm_lexer, tokens, [L]}],
+ case ucm_line:parse_and_scan({io, request, Args}) of
+ {ok, Res} ->
+ St1 = St0#ucm{line = L + 1},
+ case Res of
+ empty ->
+ read_line(St1);
+ _ ->
+ St1#ucm{current_line = Res}
+ end;
+ {error, {Line, Mod, E}} ->
+ throw(add_error(erl_anno:new(Line), {error, Mod, E}, St0))
+ end.
-thus_far(#ucm{outport=Outport, tree=Tree}=St0) ->
- St1 = St0#ucm{tree = Tree#ucmfile{headers = []}},
- io:format(Outport, "~80p~n", [St1]),
- St1.
+%thus_far(#ucm{outport=Outport, tree=Tree}=St) ->
+% io:format(Outport, "~80p~n", [St]),
+% St.
location(none) -> none;
location(Anno) ->
@@ -369,6 +404,9 @@ add_warning(Anno, W, St) ->
Loc = location(Anno),
St#ucm{warnings = [{St#ucm.infile,{Loc,?MODULE,W}}|St#ucm.warnings]}.
+unexpected(CL, St) ->
+ add_error(CL, St).
+
ucm_ret(St0) ->
% St = check_expected(St0),
St = St0,
diff --git a/src/ucm_lexer.xrl b/src/ucm_lexer.xrl
index 12fe3ca..dd20a58 100644
--- a/src/ucm_lexer.xrl
+++ b/src/ucm_lexer.xrl
@@ -16,10 +16,23 @@ Rules.
%% Note this hack -- Some auto-generated internal mappings in the ICU
%% distribution have unquoted names.
icu-internal-[a-zA-Z0-9-_]+ : {token, {string, TokenLine, TokenChars}}.
-%% See the treatment of `eol1` and subsequent `eol` in ucm_parser.yrl.
-\n : {token, {eol1, TokenLine}}.
+\n : {end_token, {eol, TokenLine}}.
Erlang code.
+
+% Because multiple newlines are messy, we'll just io:request token-by-token.
+-export([dbg/2, dbg/3]).
+
+dbg(Cont, Chars) -> dbg(Cont, Chars, 1).
+dbg(Cont, Chars, StartLine) ->
+ case tokens(Cont, Chars, StartLine) of
+ {done, {ok, Token, EndLine}, RestChars}=Stuff ->
+ io:format("~p~n", [Stuff]),
+ {done, {ok, Token, EndLine}, RestChars};
+ Else ->
+ Else
+ end.
+
codepoint([_,_|L]) -> list_to_integer(lists:droplast(L), 16).
strip([_|L]) -> lists:droplast(L).
byte([_,_|L]) -> list_to_integer(L, 16).
diff --git a/src/ucm_line.erl b/src/ucm_line.erl
new file mode 100644
index 0000000..d9a2b62
--- /dev/null
+++ b/src/ucm_line.erl
@@ -0,0 +1,1143 @@
+-module(ucm_line).
+-export([parse/1, parse_and_scan/1, format_error/1]).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 92).
+
+-include_lib("ucm/include/ucm_parsetypes.hrl").
+
+%% Default to identity to transparently employ tokens as their properties below
+tag({X,_,_}) -> X;
+tag({X,_}) -> X;
+tag(X) -> X.
+line({_, X, _}) -> X;
+line({_, X}) -> X;
+line(X) -> X.
+value({_, _, X}) -> X;
+value({X, _}) -> X;
+value(X) -> X.
+
+lift(Tag, Body) -> lift(Tag, Body, Body).
+lift(Tag, Line, Body) -> {tag(Tag), line(Line), value(Body)}.
+
+lift_header(Tag, Body) ->
+ L = lift(Tag, Body),
+ #header{key = tag(L), value = value(L), line = line(L)}.
+
+lift_action(Anchor, Action) -> lift(action, Anchor, Action).
+rename(Tag, Token) -> {tag(Tag), line(Token), value(Token)}.
+%% Useful to have the body of some intermediate "token" potentially be a fun.
+inject(Fun, Token) -> {tag(Token), line(Token), (value(Fun))(value(Token))}.
+prepend(X, Xs) -> inject(fun(L) -> [value(X)|L] end, Xs).
+named_inject(Tag, Fun, Token) -> rename(Tag, inject(Fun, Token)).
+plural(Tag, Token) -> named_inject(Tag, fun(X) -> [X] end, Token).
+compose(F, G) -> named_inject(F, fun(G1) -> fun(N) -> (value(F))(G1(N)) end end, G).
+nextstate(Nextstate) ->
+ F = fun(N) -> fun(E) -> E#entry{nextstate = N} end end,
+ named_inject(suffix, F, Nextstate).
+action(Action) ->
+ F = fun(A) -> fun(E) -> E#entry{action = A} end end,
+ named_inject(suffix, F, Action).
+range_to_entry(R) ->
+ named_inject(entry, fun({F, T}) -> #entry{from = F, to = T} end, R).
+
+rfun(F) -> fun(T) -> {value(F), value(T)} end.
+range(S) -> named_inject(range, rfun(S), S).
+range(From, To) ->
+ {F, T} = {value(From), value(To)},
+ case F > T of
+ true -> return_error(line(From), [
+ "range",
+ integer_to_list(F, 16), $-, integer_to_list(T, 16),
+ " is backwards"]);
+ _ -> named_inject(range, rfun(From), To)
+ end.
+
+
+-file("/opt/local/lib/erlang/lib/parsetools-2.1.8/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_line}, 0, [], []).
+
+-spec parse_and_scan({function() | {atom(), atom()}, [_]}
+ | {atom(), atom(), [_]}) -> yecc_ret().
+parse_and_scan({F, A}) ->
+ yeccpars0([], {{F, A}, no_line}, 0, [], []);
+parse_and_scan({M, F, A}) ->
+ Arity = length(A),
+ yeccpars0([], {{fun M:F/Arity, A}, no_line}, 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(integer(), any()) -> no_return().
+return_error(Line, Message) ->
+ throw({error, {Line, ?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, {_Line, ?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},_Line}, State, States, Vstack) ->
+ case apply(F, A) of
+ {ok, Tokens, Endline} ->
+ yeccpars1(Tokens, {{F, A}, Endline}, State, States, Vstack);
+ {eof, Endline} ->
+ yeccpars1([], {no_func, Endline}, State, States, Vstack);
+ {error, Descriptor, _Endline} ->
+ {error, Descriptor}
+ end;
+yeccpars1([], {no_func, no_line}, State, States, Vstack) ->
+ Line = 999999,
+ yeccpars2(State, '$end', States, Vstack, yecc_end(Line), [],
+ {no_func, Line});
+yeccpars1([], {no_func, Endline}, State, States, Vstack) ->
+ yeccpars2(State, '$end', States, Vstack, yecc_end(Endline), [],
+ {no_func, Endline}).
+
+%% 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}, _Line}=Tzr) ->
+ yeccpars1([], Tzr, State, [State1 | States], [Token0 | Vstack]);
+yeccpars1(State1, State, States, Vstack, Token0, [], {no_func, no_line}) ->
+ Line = yecctoken_end_location(Token0),
+ yeccpars2(State, '$end', [State1 | States], [Token0 | Vstack],
+ yecc_end(Line), [], {no_func, Line});
+yeccpars1(State1, State, States, Vstack, Token0, [], {no_func, Line}) ->
+ yeccpars2(State, '$end', [State1 | States], [Token0 | Vstack],
+ yecc_end(Line), [], {no_func, Line}).
+
+%% For internal use only.
+yecc_end({Line,_Column}) ->
+ {'$end', Line};
+yecc_end(Line) ->
+ {'$end', Line}.
+
+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/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.erl", 227).
+
+-dialyzer({nowarn_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_4(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_4(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_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_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_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_38(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_38(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(41=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_41(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(43=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_43(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(44=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_44(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(45=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_45(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(46=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_46(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(47=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_47(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(48=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_48(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(49=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_49(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(50=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_50(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(51=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_51(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(52=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_52(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(53=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_53(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(54=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_54(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(55=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_55(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(56=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_56(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(57=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_57(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(58=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_58(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(59=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_59(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(60=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_60(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(61=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_61(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(62=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_62(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(63=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_63(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(64=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_64(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(Other, _, _, _, _, _, _) ->
+ erlang:error({yecc_bug,"1.4",{missing_state_in_action_table, Other}}).
+
+yeccpars2_0(S, 'CHARMAP', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 5, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, 'END CHARMAP', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 6, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, char_name_mask, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 7, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, code_set_name, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 8, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, codepoint, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, 'icu:alias', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 10, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, 'icu:base', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 11, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, 'icu:charsetFamily', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 12, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, 'icu:state', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 13, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, mb_cur_max, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 14, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, mb_cur_min, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 15, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, subchar, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 16, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, subchar1, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 17, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, uconv_class, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 18, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_0_(Stack),
+ yeccpars2_1(1, Cat, [0 | Ss], NewStack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccpars2_1/7}).
+yeccpars2_1(_S, eol, _Ss, Stack, _T, _Ts, _Tzr) ->
+ {ok, hd(Stack)};
+yeccpars2_1(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_2(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccgoto_ucmline(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
+
+yeccpars2_3(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccgoto_ucmline(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccpars2_4/7}).
+yeccpars2_4(S, byte, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 22, Ss, Stack, T, Ts, Tzr);
+yeccpars2_4(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_5(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccgoto_ucmline(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
+
+yeccpars2_6(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccgoto_ucmline(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccpars2_7/7}).
+yeccpars2_7(S, string, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 60, Ss, Stack, T, Ts, Tzr);
+yeccpars2_7(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+-dialyzer({nowarn_function, yeccpars2_8/7}).
+yeccpars2_8(S, string, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 59, Ss, Stack, T, Ts, Tzr);
+yeccpars2_8(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_9(S, '+', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 57, Ss, Stack, T, Ts, Tzr);
+yeccpars2_9(S, codepoint, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr);
+yeccpars2_9(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_9_(Stack),
+ yeccgoto_codepoints(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccpars2_10/7}).
+yeccpars2_10(S, string, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 55, Ss, Stack, T, Ts, Tzr);
+yeccpars2_10(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+-dialyzer({nowarn_function, yeccpars2_11/7}).
+yeccpars2_11(S, string, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 54, Ss, Stack, T, Ts, Tzr);
+yeccpars2_11(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+-dialyzer({nowarn_function, yeccpars2_12/7}).
+yeccpars2_12(S, string, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 53, Ss, Stack, T, Ts, Tzr);
+yeccpars2_12(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_13(S, hexnum, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 33, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, initial, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 34, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, surrogates, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 35, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_13_(Stack),
+ yeccgoto_spec(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccpars2_14/7}).
+yeccpars2_14(S, hexnum, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 27, Ss, Stack, T, Ts, Tzr);
+yeccpars2_14(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+-dialyzer({nowarn_function, yeccpars2_15/7}).
+yeccpars2_15(S, hexnum, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 26, Ss, Stack, T, Ts, Tzr);
+yeccpars2_15(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+%% yeccpars2_16: see yeccpars2_4
+
+-dialyzer({nowarn_function, yeccpars2_17/7}).
+yeccpars2_17(S, byte, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 20, Ss, Stack, T, Ts, Tzr);
+yeccpars2_17(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+-dialyzer({nowarn_function, yeccpars2_18/7}).
+yeccpars2_18(S, string, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 19, Ss, Stack, T, Ts, Tzr);
+yeccpars2_18(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_19(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_19_(Stack),
+ yeccgoto_spec(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_20(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_20_(Stack),
+ yeccgoto_spec(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_21(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_21_(Stack),
+ yeccgoto_spec(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_22(S, '+', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 24, Ss, Stack, T, Ts, Tzr);
+yeccpars2_22(S, byte, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 22, Ss, Stack, T, Ts, Tzr);
+yeccpars2_22(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_22_(Stack),
+ yeccgoto_bytes(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_23(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_23_(Stack),
+ yeccgoto_bytes(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+%% yeccpars2_24: see yeccpars2_4
+
+yeccpars2_25(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_|Nss] = Ss,
+ NewStack = yeccpars2_25_(Stack),
+ yeccgoto_bytes(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_26(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_26_(Stack),
+ yeccgoto_spec(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_27(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_27_(Stack),
+ yeccgoto_spec(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_28(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_28_(Stack),
+ yeccgoto_spec(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_29(S, '.', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 45, Ss, Stack, T, Ts, Tzr);
+yeccpars2_29(S, ':', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 46, Ss, Stack, T, Ts, Tzr);
+yeccpars2_29(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_29_(Stack),
+ yeccgoto_entry(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccpars2_30/7}).
+yeccpars2_30(S, ',', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 40, Ss, Stack, T, Ts, Tzr);
+yeccpars2_30(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_31(S, ',', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 38, Ss, Stack, T, Ts, Tzr);
+yeccpars2_31(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_31_(Stack),
+ yeccgoto_entries(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_32(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_32_(Stack),
+ yeccgoto_row(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_33(S, '-', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 36, Ss, Stack, T, Ts, Tzr);
+yeccpars2_33(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_33_(Stack),
+ yeccgoto_range(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_34(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccgoto_firstentry(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
+
+yeccpars2_35(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccgoto_firstentry(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccpars2_36/7}).
+yeccpars2_36(S, hexnum, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 37, Ss, Stack, T, Ts, Tzr);
+yeccpars2_36(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_37(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_|Nss] = Ss,
+ NewStack = yeccpars2_37_(Stack),
+ yeccgoto_range(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccpars2_38/7}).
+yeccpars2_38(S, hexnum, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 33, Ss, Stack, T, Ts, Tzr);
+yeccpars2_38(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_39(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_|Nss] = Ss,
+ NewStack = yeccpars2_39_(Stack),
+ yeccgoto_entries(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+%% yeccpars2_40: see yeccpars2_38
+
+yeccpars2_41(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_|Nss] = Ss,
+ NewStack = yeccpars2_41_(Stack),
+ yeccgoto_row(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_42(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_42_(Stack),
+ yeccgoto_entry(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_43(S, '.', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 45, Ss, Stack, T, Ts, Tzr);
+yeccpars2_43(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_43_(Stack),
+ yeccgoto_suffix(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_44(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_44_(Stack),
+ yeccgoto_suffix(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_45(S, i, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 48, Ss, Stack, T, Ts, Tzr);
+yeccpars2_45(S, p, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 49, Ss, Stack, T, Ts, Tzr);
+yeccpars2_45(S, s, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 50, Ss, Stack, T, Ts, Tzr);
+yeccpars2_45(S, u, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 51, Ss, Stack, T, Ts, Tzr);
+yeccpars2_45(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_45_(Stack),
+ yeccgoto_action(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccpars2_46/7}).
+yeccpars2_46(S, hexnum, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 47, Ss, Stack, T, Ts, Tzr);
+yeccpars2_46(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_47(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_47_(Stack),
+ yeccgoto_nextstate(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_48(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_48_(Stack),
+ yeccgoto_action(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_49(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_49_(Stack),
+ yeccgoto_action(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_50(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_50_(Stack),
+ yeccgoto_action(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_51(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_51_(Stack),
+ yeccgoto_action(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_52(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_52_(Stack),
+ yeccgoto_suffix(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_53(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_53_(Stack),
+ yeccgoto_spec(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_54(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_54_(Stack),
+ yeccgoto_spec(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_55(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_55_(Stack),
+ yeccgoto_spec(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_56(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_56_(Stack),
+ yeccgoto_codepoints(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccpars2_57/7}).
+yeccpars2_57(S, codepoint, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr);
+yeccpars2_57(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_58(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_|Nss] = Ss,
+ NewStack = yeccpars2_58_(Stack),
+ yeccgoto_codepoints(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_59(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_59_(Stack),
+ yeccgoto_spec(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_60(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_60_(Stack),
+ yeccgoto_spec(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_61(S, '|', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 63, Ss, Stack, T, Ts, Tzr);
+yeccpars2_61(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_61_(Stack),
+ yeccgoto_map(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_62(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_|Nss] = Ss,
+ NewStack = yeccpars2_62_(Stack),
+ yeccgoto_map(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccpars2_63/7}).
+yeccpars2_63(S, hexnum, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 64, Ss, Stack, T, Ts, Tzr);
+yeccpars2_63(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_64(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_64_(Stack),
+ yeccgoto_precision(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccgoto_action/7}).
+yeccgoto_action(29=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_44(_S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_action(43=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_52(_S, Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccgoto_bytes/7}).
+yeccgoto_bytes(4, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_61(61, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_bytes(16=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_21(_S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_bytes(22=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_23(_S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_bytes(24=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_25(_S, Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccgoto_codepoints/7}).
+yeccgoto_codepoints(0, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_4(4, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_codepoints(9=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_56(_S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_codepoints(57=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_58(_S, Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccgoto_entries/7}).
+yeccgoto_entries(13=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_32(_S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_entries(38=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_39(_S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_entries(40=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_41(_S, Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccgoto_entry/7}).
+yeccgoto_entry(13, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_31(31, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_entry(38, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_31(31, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_entry(40, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_31(31, Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccgoto_firstentry/7}).
+yeccgoto_firstentry(13, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_30(30, Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccgoto_map/7}).
+yeccgoto_map(0=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_3(_S, Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccgoto_nextstate/7}).
+yeccgoto_nextstate(29, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_43(43, Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccgoto_precision/7}).
+yeccgoto_precision(61=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_62(_S, Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccgoto_range/7}).
+yeccgoto_range(13, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_29(29, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_range(38, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_29(29, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_range(40, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_29(29, Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccgoto_row/7}).
+yeccgoto_row(13=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_28(_S, Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccgoto_spec/7}).
+yeccgoto_spec(0=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_2(_S, Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccgoto_suffix/7}).
+yeccgoto_suffix(29=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_42(_S, Cat, Ss, Stack, T, Ts, Tzr).
+
+-dialyzer({nowarn_function, yeccgoto_ucmline/7}).
+yeccgoto_ucmline(0, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_1(1, Cat, Ss, Stack, T, Ts, Tzr).
+
+-compile({inline,yeccpars2_0_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 17).
+yeccpars2_0_(__Stack0) ->
+ [begin
+ empty
+ end | __Stack0].
+
+-compile({inline,yeccpars2_9_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 83).
+yeccpars2_9_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ plural ( codepoints , __1 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_13_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 23).
+yeccpars2_13_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ # 'icu:state' { line = line ( __1 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_19_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 30).
+yeccpars2_19_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ lift_header ( __1 , __2 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_20_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 32).
+yeccpars2_20_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ lift_header ( __1 , __2 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_21_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 31).
+yeccpars2_21_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ lift_header ( __1 , __2 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_22_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 37).
+yeccpars2_22_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ plural ( bytes , __1 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_23_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 38).
+yeccpars2_23_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ prepend ( __1 , __2 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_25_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 39).
+yeccpars2_25_(__Stack0) ->
+ [__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ prepend ( __1 , __3 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_26_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 28).
+yeccpars2_26_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ lift_header ( __1 , __2 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_27_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 29).
+yeccpars2_27_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ lift_header ( __1 , __2 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_28_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 24).
+yeccpars2_28_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ __2
+ end | __Stack].
+
+-compile({inline,yeccpars2_29_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 57).
+yeccpars2_29_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ inject ( action ( lift_action ( __1 , # entry { } # entry .action ) ) , range_to_entry ( __1 ) )
+ end | __Stack].
+
+-compile({inline,yeccpars2_31_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 55).
+yeccpars2_31_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ plural ( entries , __1 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_32_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 43).
+yeccpars2_32_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ # 'icu:state' {
+ entries = value ( __1 ) ,
+ line = line ( __1 )
+ }
+ end | __Stack].
+
+-compile({inline,yeccpars2_33_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 59).
+yeccpars2_33_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ range ( __1 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_37_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 60).
+yeccpars2_37_(__Stack0) ->
+ [__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ range ( __1 , __3 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_39_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 56).
+yeccpars2_39_(__Stack0) ->
+ [__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ prepend ( __1 , __3 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_41_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 47).
+yeccpars2_41_(__Stack0) ->
+ [__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ # 'icu:state' {
+ firstentry = value ( __1 ) ,
+ entries = value ( __3 ) ,
+ line = line ( __1 )
+ }
+ end | __Stack].
+
+-compile({inline,yeccpars2_42_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 58).
+yeccpars2_42_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ inject ( __2 , range_to_entry ( __1 ) )
+ end | __Stack].
+
+-compile({inline,yeccpars2_43_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 61).
+yeccpars2_43_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ compose ( nextstate ( __1 ) , action ( lift_action ( __1 , # entry { } # entry .action ) ) )
+ end | __Stack].
+
+-compile({inline,yeccpars2_44_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 62).
+yeccpars2_44_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ action ( __1 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_45_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 65).
+yeccpars2_45_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ lift_action ( __1 , # entry { } # entry .action )
+ end | __Stack].
+
+-compile({inline,yeccpars2_47_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 64).
+yeccpars2_47_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ rename ( nextstate , __2 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_48_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 68).
+yeccpars2_48_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ lift_action ( __1 , illegal )
+ end | __Stack].
+
+-compile({inline,yeccpars2_49_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 67).
+yeccpars2_49_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ lift_action ( __2 , surrogate_pair )
+ end | __Stack].
+
+-compile({inline,yeccpars2_50_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 69).
+yeccpars2_50_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ lift_action ( __2 , state_change_only )
+ end | __Stack].
+
+-compile({inline,yeccpars2_51_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 66).
+yeccpars2_51_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ lift_action ( __2 , unassigned )
+ end | __Stack].
+
+-compile({inline,yeccpars2_52_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 63).
+yeccpars2_52_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ compose ( nextstate ( __1 ) , action ( __2 ) )
+ end | __Stack].
+
+-compile({inline,yeccpars2_53_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 33).
+yeccpars2_53_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ lift_header ( __1 , __2 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_54_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 35).
+yeccpars2_54_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ lift_header ( __1 , __2 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_55_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 34).
+yeccpars2_55_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ lift_header ( __1 , __2 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_56_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 84).
+yeccpars2_56_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ prepend ( __1 , __2 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_58_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 85).
+yeccpars2_58_(__Stack0) ->
+ [__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ prepend ( __1 , __3 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_59_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 26).
+yeccpars2_59_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ lift_header ( __1 , __2 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_60_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 27).
+yeccpars2_60_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ lift_header ( __1 , __2 )
+ end | __Stack].
+
+-compile({inline,yeccpars2_61_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 71).
+yeccpars2_61_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ # map {
+ codepoints = value ( __1 ) ,
+ bytes = value ( __2 ) ,
+ line = line ( __1 )
+ }
+ end | __Stack].
+
+-compile({inline,yeccpars2_62_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 76).
+yeccpars2_62_(__Stack0) ->
+ [__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ # map {
+ codepoints = value ( __1 ) ,
+ bytes = value ( __2 ) ,
+ precision = value ( __3 ) ,
+ line = line ( __1 )
+ }
+ end | __Stack].
+
+-compile({inline,yeccpars2_64_/1}).
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 86).
+yeccpars2_64_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ rename ( precision , __2 )
+ end | __Stack].
+
+
+-file("/Users/ylh/erl/ucm/_build/default/lib/ucm/src/ucm_line.yrl", 143).
diff --git a/src/ucm_parser.yrl b/src/ucm_line.yrl
index e45563e..937df6f 100644
--- a/src/ucm_parser.yrl
+++ b/src/ucm_line.yrl
@@ -2,39 +2,28 @@ Terminals
string byte hexnum codepoint
'icu:state' initial surrogates
'-' ',' '|' '.' '+' ':' u p i s
- 'CHARMAP' 'END CHARMAP' eol1
+ 'CHARMAP' 'END CHARMAP'
code_set_name char_name_mask mb_cur_min mb_cur_max uconv_class subchar
subchar1 'icu:charsetFamily' 'icu:alias' 'icu:base'.
Nonterminals
- ucm body headers speclines specline spec bytes eol row
- firstentry entries entry range suffix nextstate action
- charmap mapset map maplines mapline precmap precmaplines precmapline
+ ucmline spec bytes row
+ firstentry entries entry range suffix nextstate action map
codepoints precision.
-Rootsymbol ucm.
+Rootsymbol ucmline.
-ucm -> body : '$1'.
-ucm -> eol body : '$2'.
-body -> headers charmap : #ucmfile{
- headers = '$1',
- charmap = '$2'
-}.
-body -> headers charmap charmap : #ucmfile{
- headers = '$1',
- charmap = '$2',
- charmap1 = '$3'
-}.
+Endsymbol eol.
+
+%% We waste an opportunity for clear structure by doing it this way, but icu4c
+%% is full of edge cases interleaved with line-by-line parsing. Putting all the
+%% checks in a fancy dressed-up parser would make it large and unwieldy. As a
+%% bonus, this way we get to mindlessly mirror the general ordering of icu4c's
+%% checks and stay quirk-compatible.
+ucmline -> '$empty' : empty.
+ucmline -> spec : '$1'.
+ucmline -> map : '$1'.
+ucmline -> 'CHARMAP' : '$1'.
+ucmline -> 'END CHARMAP' : '$1'.
-%% This rule is horrid. Unfortunately, it's a necessary workaround, as leex
-%% is line-oriented enough that it trips up on a token consisting of multiple
-%% newlines. For clarity, the token is now explicitly only a single newline, and
-%% we paste them together here. See ucm_lexer.xrl.
-eol -> eol1.
-eol -> eol1 eol.
-
-headers -> speclines : '$1'.
-speclines -> specline : ['$1'].
-speclines -> specline speclines : ['$1'|'$2'].
-specline -> spec eol : '$1'.
spec -> 'icu:state' : #'icu:state'{line = line('$1')}.
spec -> 'icu:state' row : '$2'.
@@ -83,29 +72,18 @@ action -> '.' p : lift_action('$2', surrogate_pair).
action -> '.' i : lift_action('$1', illegal).
action -> '.' s : lift_action('$2', state_change_only).
-charmap -> 'CHARMAP' eol mapset 'END CHARMAP' eol : '$3'.
-mapset -> maplines : '$1'.
-mapset -> precmaplines : '$1'.
-%% Somewhat repetitive, but the more we can encode in the syntax itself, in this
-%% case the all-or-nothing nature of precision indicators, the better.
-precmaplines -> precmapline : ['$1'].
-precmaplines -> precmapline precmaplines : ['$1'|'$2'].
-precmapline -> precmap eol : '$1'.
-precmap -> codepoints bytes precision : #map{
+map -> codepoints bytes : #map{
codepoints = value('$1'),
bytes = value('$2'),
- precision = value('$3'),
line = line('$1')
}.
-maplines -> mapline : ['$1'].
-maplines -> mapline maplines : ['$1'|'$2'].
-mapline -> map eol : '$1'.
-map -> codepoints bytes : #map{
+map -> codepoints bytes precision : #map{
codepoints = value('$1'),
bytes = value('$2'),
- precision = 0,
+ precision = value('$3'),
line = line('$1')
}.
+
codepoints -> codepoint : plural(codepoints, '$1').
codepoints -> codepoint codepoints : prepend('$1', '$2').
codepoints -> codepoint '+' codepoints : prepend('$1', '$3').