1-module(yeccparser).
2-export([parse/1, parse_and_scan/1, format_error/1]).
3-file("yeccgramm.yrl", 68).
4
5-record(symbol, {anno, name}).
6
7symbol(Symbol) ->
8    #symbol{anno = anno_of(Symbol), name = value_of(Symbol)}.
9
10value_of(Token) ->
11    element(3, Token).
12
13anno_of(Token) ->
14    element(2, Token).
15
16-file("/ldisk/hasse/otp/lib/parsetools/include/yeccpre.hrl", 0).
17%%
18%% %CopyrightBegin%
19%%
20%% Copyright Ericsson AB 1996-2018. All Rights Reserved.
21%%
22%% Licensed under the Apache License, Version 2.0 (the "License");
23%% you may not use this file except in compliance with the License.
24%% You may obtain a copy of the License at
25%%
26%%     http://www.apache.org/licenses/LICENSE-2.0
27%%
28%% Unless required by applicable law or agreed to in writing, software
29%% distributed under the License is distributed on an "AS IS" BASIS,
30%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31%% See the License for the specific language governing permissions and
32%% limitations under the License.
33%%
34%% %CopyrightEnd%
35%%
36
37%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38% The parser generator will insert appropriate declarations before this line.%
39
40-type yecc_ret() :: {'error', _} | {'ok', _}.
41
42-spec parse(Tokens :: list()) -> yecc_ret().
43parse(Tokens) ->
44    yeccpars0(Tokens, {no_func, no_location}, 0, [], []).
45
46-spec parse_and_scan({function() | {atom(), atom()}, [_]}
47                     | {atom(), atom(), [_]}) -> yecc_ret().
48parse_and_scan({F, A}) ->
49    yeccpars0([], {{F, A}, no_location}, 0, [], []);
50parse_and_scan({M, F, A}) ->
51    Arity = length(A),
52    yeccpars0([], {{fun M:F/Arity, A}, no_location}, 0, [], []).
53
54-spec format_error(any()) -> [char() | list()].
55format_error(Message) ->
56    case io_lib:deep_char_list(Message) of
57        true ->
58            Message;
59        _ ->
60            io_lib:write(Message)
61    end.
62
63%% To be used in grammar files to throw an error message to the parser
64%% toplevel. Doesn't have to be exported!
65-compile({nowarn_unused_function, return_error/2}).
66-spec return_error(erl_anno:location(), any()) -> no_return().
67return_error(Location, Message) ->
68    throw({error, {Location, ?MODULE, Message}}).
69
70-define(CODE_VERSION, "1.4").
71
72yeccpars0(Tokens, Tzr, State, States, Vstack) ->
73    try yeccpars1(Tokens, Tzr, State, States, Vstack)
74    catch
75        error: Error: Stacktrace ->
76            try yecc_error_type(Error, Stacktrace) of
77                Desc ->
78                    erlang:raise(error, {yecc_bug, ?CODE_VERSION, Desc},
79                                 Stacktrace)
80            catch _:_ -> erlang:raise(error, Error, Stacktrace)
81            end;
82        %% Probably thrown from return_error/2:
83        throw: {error, {_Location, ?MODULE, _M}} = Error ->
84            Error
85    end.
86
87yecc_error_type(function_clause, [{?MODULE,F,ArityOrArgs,_} | _]) ->
88    case atom_to_list(F) of
89        "yeccgoto_" ++ SymbolL ->
90            {ok,[{atom,_,Symbol}],_} = erl_scan:string(SymbolL),
91            State = case ArityOrArgs of
92                        [S,_,_,_,_,_,_] -> S;
93                        _ -> state_is_unknown
94                    end,
95            {Symbol, State, missing_in_goto_table}
96    end.
97
98yeccpars1([Token | Tokens], Tzr, State, States, Vstack) ->
99    yeccpars2(State, element(1, Token), States, Vstack, Token, Tokens, Tzr);
100yeccpars1([], {{F, A},_Location}, State, States, Vstack) ->
101    case apply(F, A) of
102        {ok, Tokens, EndLocation} ->
103            yeccpars1(Tokens, {{F, A}, EndLocation}, State, States, Vstack);
104        {eof, EndLocation} ->
105            yeccpars1([], {no_func, EndLocation}, State, States, Vstack);
106        {error, Descriptor, _EndLocation} ->
107            {error, Descriptor}
108    end;
109yeccpars1([], {no_func, no_location}, State, States, Vstack) ->
110    Line = 999999,
111    yeccpars2(State, '$end', States, Vstack, yecc_end(Line), [],
112              {no_func, Line});
113yeccpars1([], {no_func, EndLocation}, State, States, Vstack) ->
114    yeccpars2(State, '$end', States, Vstack, yecc_end(EndLocation), [],
115              {no_func, EndLocation}).
116
117%% yeccpars1/7 is called from generated code.
118%%
119%% When using the {includefile, Includefile} option, make sure that
120%% yeccpars1/7 can be found by parsing the file without following
121%% include directives. yecc will otherwise assume that an old
122%% yeccpre.hrl is included (one which defines yeccpars1/5).
123yeccpars1(State1, State, States, Vstack, Token0, [Token | Tokens], Tzr) ->
124    yeccpars2(State, element(1, Token), [State1 | States],
125              [Token0 | Vstack], Token, Tokens, Tzr);
126yeccpars1(State1, State, States, Vstack, Token0, [], {{_F,_A}, _Location}=Tzr) ->
127    yeccpars1([], Tzr, State, [State1 | States], [Token0 | Vstack]);
128yeccpars1(State1, State, States, Vstack, Token0, [], {no_func, no_location}) ->
129    Location = yecctoken_end_location(Token0),
130    yeccpars2(State, '$end', [State1 | States], [Token0 | Vstack],
131              yecc_end(Location), [], {no_func, Location});
132yeccpars1(State1, State, States, Vstack, Token0, [], {no_func, Location}) ->
133    yeccpars2(State, '$end', [State1 | States], [Token0 | Vstack],
134              yecc_end(Location), [], {no_func, Location}).
135
136%% For internal use only.
137yecc_end(Location) ->
138    {'$end', Location}.
139
140yecctoken_end_location(Token) ->
141    try erl_anno:end_location(element(2, Token)) of
142        undefined -> yecctoken_location(Token);
143        Loc -> Loc
144    catch _:_ -> yecctoken_location(Token)
145    end.
146
147-compile({nowarn_unused_function, yeccerror/1}).
148yeccerror(Token) ->
149    Text = yecctoken_to_string(Token),
150    Location = yecctoken_location(Token),
151    {error, {Location, ?MODULE, ["syntax error before: ", Text]}}.
152
153-compile({nowarn_unused_function, yecctoken_to_string/1}).
154yecctoken_to_string(Token) ->
155    try erl_scan:text(Token) of
156        undefined -> yecctoken2string(Token);
157        Txt -> Txt
158    catch _:_ -> yecctoken2string(Token)
159    end.
160
161yecctoken_location(Token) ->
162    try erl_scan:location(Token)
163    catch _:_ -> element(2, Token)
164    end.
165
166-compile({nowarn_unused_function, yecctoken2string/1}).
167yecctoken2string({atom, _, A}) -> io_lib:write_atom(A);
168yecctoken2string({integer,_,N}) -> io_lib:write(N);
169yecctoken2string({float,_,F}) -> io_lib:write(F);
170yecctoken2string({char,_,C}) -> io_lib:write_char(C);
171yecctoken2string({var,_,V}) -> io_lib:format("~s", [V]);
172yecctoken2string({string,_,S}) -> io_lib:write_string(S);
173yecctoken2string({reserved_symbol, _, A}) -> io_lib:write(A);
174yecctoken2string({_Cat, _, Val}) -> io_lib:format("~tp", [Val]);
175yecctoken2string({dot, _}) -> "'.'";
176yecctoken2string({'$end', _}) -> [];
177yecctoken2string({Other, _}) when is_atom(Other) ->
178    io_lib:write_atom(Other);
179yecctoken2string(Other) ->
180    io_lib:format("~tp", [Other]).
181
182%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
183
184
185
186-file("yeccgramm.erl", 186).
187
188-dialyzer({nowarn_function, yeccpars2/7}).
189yeccpars2(0=S, Cat, Ss, Stack, T, Ts, Tzr) ->
190 yeccpars2_0(S, Cat, Ss, Stack, T, Ts, Tzr);
191%% yeccpars2(1=S, Cat, Ss, Stack, T, Ts, Tzr) ->
192%%  yeccpars2_1(S, Cat, Ss, Stack, T, Ts, Tzr);
193%% yeccpars2(2=S, Cat, Ss, Stack, T, Ts, Tzr) ->
194%%  yeccpars2_2(S, Cat, Ss, Stack, T, Ts, Tzr);
195%% yeccpars2(3=S, Cat, Ss, Stack, T, Ts, Tzr) ->
196%%  yeccpars2_3(S, Cat, Ss, Stack, T, Ts, Tzr);
197%% yeccpars2(4=S, Cat, Ss, Stack, T, Ts, Tzr) ->
198%%  yeccpars2_4(S, Cat, Ss, Stack, T, Ts, Tzr);
199%% yeccpars2(5=S, Cat, Ss, Stack, T, Ts, Tzr) ->
200%%  yeccpars2_5(S, Cat, Ss, Stack, T, Ts, Tzr);
201yeccpars2(6=S, Cat, Ss, Stack, T, Ts, Tzr) ->
202 yeccpars2_6(S, Cat, Ss, Stack, T, Ts, Tzr);
203yeccpars2(7=S, Cat, Ss, Stack, T, Ts, Tzr) ->
204 yeccpars2_7(S, Cat, Ss, Stack, T, Ts, Tzr);
205yeccpars2(8=S, Cat, Ss, Stack, T, Ts, Tzr) ->
206 yeccpars2_8(S, Cat, Ss, Stack, T, Ts, Tzr);
207yeccpars2(9=S, Cat, Ss, Stack, T, Ts, Tzr) ->
208 yeccpars2_9(S, Cat, Ss, Stack, T, Ts, Tzr);
209yeccpars2(10=S, Cat, Ss, Stack, T, Ts, Tzr) ->
210 yeccpars2_0(S, Cat, Ss, Stack, T, Ts, Tzr);
211%% yeccpars2(11=S, Cat, Ss, Stack, T, Ts, Tzr) ->
212%%  yeccpars2_11(S, Cat, Ss, Stack, T, Ts, Tzr);
213%% yeccpars2(12=S, Cat, Ss, Stack, T, Ts, Tzr) ->
214%%  yeccpars2_12(S, Cat, Ss, Stack, T, Ts, Tzr);
215%% yeccpars2(13=S, Cat, Ss, Stack, T, Ts, Tzr) ->
216%%  yeccpars2_13(S, Cat, Ss, Stack, T, Ts, Tzr);
217%% yeccpars2(14=S, Cat, Ss, Stack, T, Ts, Tzr) ->
218%%  yeccpars2_14(S, Cat, Ss, Stack, T, Ts, Tzr);
219yeccpars2(15=S, Cat, Ss, Stack, T, Ts, Tzr) ->
220 yeccpars2_15(S, Cat, Ss, Stack, T, Ts, Tzr);
221%% yeccpars2(16=S, Cat, Ss, Stack, T, Ts, Tzr) ->
222%%  yeccpars2_16(S, Cat, Ss, Stack, T, Ts, Tzr);
223%% yeccpars2(17=S, Cat, Ss, Stack, T, Ts, Tzr) ->
224%%  yeccpars2_17(S, Cat, Ss, Stack, T, Ts, Tzr);
225yeccpars2(18=S, Cat, Ss, Stack, T, Ts, Tzr) ->
226 yeccpars2_18(S, Cat, Ss, Stack, T, Ts, Tzr);
227yeccpars2(19=S, Cat, Ss, Stack, T, Ts, Tzr) ->
228 yeccpars2_19(S, Cat, Ss, Stack, T, Ts, Tzr);
229yeccpars2(20=S, Cat, Ss, Stack, T, Ts, Tzr) ->
230 yeccpars2_20(S, Cat, Ss, Stack, T, Ts, Tzr);
231yeccpars2(21=S, Cat, Ss, Stack, T, Ts, Tzr) ->
232 yeccpars2_21(S, Cat, Ss, Stack, T, Ts, Tzr);
233yeccpars2(22=S, Cat, Ss, Stack, T, Ts, Tzr) ->
234 yeccpars2_22(S, Cat, Ss, Stack, T, Ts, Tzr);
235yeccpars2(23=S, Cat, Ss, Stack, T, Ts, Tzr) ->
236 yeccpars2_23(S, Cat, Ss, Stack, T, Ts, Tzr);
237yeccpars2(24=S, Cat, Ss, Stack, T, Ts, Tzr) ->
238 yeccpars2_24(S, Cat, Ss, Stack, T, Ts, Tzr);
239yeccpars2(25=S, Cat, Ss, Stack, T, Ts, Tzr) ->
240 yeccpars2_25(S, Cat, Ss, Stack, T, Ts, Tzr);
241yeccpars2(26=S, Cat, Ss, Stack, T, Ts, Tzr) ->
242 yeccpars2_26(S, Cat, Ss, Stack, T, Ts, Tzr);
243yeccpars2(27=S, Cat, Ss, Stack, T, Ts, Tzr) ->
244 yeccpars2_27(S, Cat, Ss, Stack, T, Ts, Tzr);
245%% yeccpars2(28=S, Cat, Ss, Stack, T, Ts, Tzr) ->
246%%  yeccpars2_28(S, Cat, Ss, Stack, T, Ts, Tzr);
247yeccpars2(29=S, Cat, Ss, Stack, T, Ts, Tzr) ->
248 yeccpars2_29(S, Cat, Ss, Stack, T, Ts, Tzr);
249%% yeccpars2(30=S, Cat, Ss, Stack, T, Ts, Tzr) ->
250%%  yeccpars2_30(S, Cat, Ss, Stack, T, Ts, Tzr);
251%% yeccpars2(31=S, Cat, Ss, Stack, T, Ts, Tzr) ->
252%%  yeccpars2_31(S, Cat, Ss, Stack, T, Ts, Tzr);
253yeccpars2(32=S, Cat, Ss, Stack, T, Ts, Tzr) ->
254 yeccpars2_32(S, Cat, Ss, Stack, T, Ts, Tzr);
255%% yeccpars2(33=S, Cat, Ss, Stack, T, Ts, Tzr) ->
256%%  yeccpars2_33(S, Cat, Ss, Stack, T, Ts, Tzr);
257yeccpars2(34=S, Cat, Ss, Stack, T, Ts, Tzr) ->
258 yeccpars2_34(S, Cat, Ss, Stack, T, Ts, Tzr);
259yeccpars2(35=S, Cat, Ss, Stack, T, Ts, Tzr) ->
260 yeccpars2_35(S, Cat, Ss, Stack, T, Ts, Tzr);
261yeccpars2(Other, _, _, _, _, _, _) ->
262 erlang:error({yecc_bug,"1.4",{missing_state_in_action_table, Other}}).
263
264-dialyzer({nowarn_function, yeccpars2_0/7}).
265yeccpars2_0(S, atom, Ss, Stack, T, Ts, Tzr) ->
266 yeccpars1(S, 6, Ss, Stack, T, Ts, Tzr);
267yeccpars2_0(S, integer, Ss, Stack, T, Ts, Tzr) ->
268 yeccpars1(S, 7, Ss, Stack, T, Ts, Tzr);
269yeccpars2_0(S, reserved_word, Ss, Stack, T, Ts, Tzr) ->
270 yeccpars1(S, 8, Ss, Stack, T, Ts, Tzr);
271yeccpars2_0(S, var, Ss, Stack, T, Ts, Tzr) ->
272 yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr);
273yeccpars2_0(_, _, _, _, T, _, _) ->
274 yeccerror(T).
275
276yeccpars2_1(S, atom, Ss, Stack, T, Ts, Tzr) ->
277 yeccpars1(S, 6, Ss, Stack, T, Ts, Tzr);
278yeccpars2_1(S, integer, Ss, Stack, T, Ts, Tzr) ->
279 yeccpars1(S, 7, Ss, Stack, T, Ts, Tzr);
280yeccpars2_1(S, reserved_word, Ss, Stack, T, Ts, Tzr) ->
281 yeccpars1(S, 8, Ss, Stack, T, Ts, Tzr);
282yeccpars2_1(S, string, Ss, Stack, T, Ts, Tzr) ->
283 yeccpars1(S, 32, Ss, Stack, T, Ts, Tzr);
284yeccpars2_1(S, var, Ss, Stack, T, Ts, Tzr) ->
285 yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr);
286yeccpars2_1(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
287 NewStack = yeccpars2_1_(Stack),
288 yeccgoto_head(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
289
290yeccpars2_2(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
291 NewStack = yeccpars2_2_(Stack),
292 yeccgoto_grammar(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
293
294-dialyzer({nowarn_function, yeccpars2_3/7}).
295yeccpars2_3(S, '->', Ss, Stack, T, Ts, Tzr) ->
296 yeccpars1(S, 10, Ss, Stack, T, Ts, Tzr);
297yeccpars2_3(_, _, _, _, T, _, _) ->
298 yeccerror(T).
299
300-dialyzer({nowarn_function, yeccpars2_4/7}).
301yeccpars2_4(_S, '$end', _Ss, Stack, _T, _Ts, _Tzr) ->
302 {ok, hd(Stack)};
303yeccpars2_4(_, _, _, _, T, _, _) ->
304 yeccerror(T).
305
306yeccpars2_5(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
307 NewStack = yeccpars2_5_(Stack),
308 yeccgoto_grammar(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
309
310yeccpars2_6(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
311 NewStack = yeccpars2_6_(Stack),
312 yeccgoto_symbol(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
313
314yeccpars2_7(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
315 NewStack = yeccpars2_7_(Stack),
316 yeccgoto_symbol(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
317
318yeccpars2_8(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
319 NewStack = yeccpars2_8_(Stack),
320 yeccgoto_symbol(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
321
322yeccpars2_9(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
323 NewStack = yeccpars2_9_(Stack),
324 yeccgoto_symbol(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
325
326%% yeccpars2_10: see yeccpars2_0
327
328yeccpars2_11(S, ':', Ss, Stack, T, Ts, Tzr) ->
329 yeccpars1(S, 15, Ss, Stack, T, Ts, Tzr);
330yeccpars2_11(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
331 NewStack = yeccpars2_11_(Stack),
332 yeccpars2_14(14, Cat, [11 | Ss], NewStack, T, Ts, Tzr).
333
334yeccpars2_12(S, atom, Ss, Stack, T, Ts, Tzr) ->
335 yeccpars1(S, 6, Ss, Stack, T, Ts, Tzr);
336yeccpars2_12(S, integer, Ss, Stack, T, Ts, Tzr) ->
337 yeccpars1(S, 7, Ss, Stack, T, Ts, Tzr);
338yeccpars2_12(S, reserved_word, Ss, Stack, T, Ts, Tzr) ->
339 yeccpars1(S, 8, Ss, Stack, T, Ts, Tzr);
340yeccpars2_12(S, var, Ss, Stack, T, Ts, Tzr) ->
341 yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr);
342yeccpars2_12(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
343 NewStack = yeccpars2_12_(Stack),
344 yeccgoto_symbols(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
345
346yeccpars2_13(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
347 [_|Nss] = Ss,
348 NewStack = yeccpars2_13_(Stack),
349 yeccgoto_symbols(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
350
351-dialyzer({nowarn_function, yeccpars2_14/7}).
352yeccpars2_14(S, dot, Ss, Stack, T, Ts, Tzr) ->
353 yeccpars1(S, 29, Ss, Stack, T, Ts, Tzr);
354yeccpars2_14(_, _, _, _, T, _, _) ->
355 yeccerror(T).
356
357-dialyzer({nowarn_function, yeccpars2_15/7}).
358yeccpars2_15(S, '->', Ss, Stack, T, Ts, Tzr) ->
359 yeccpars1(S, 18, Ss, Stack, T, Ts, Tzr);
360yeccpars2_15(S, ':', Ss, Stack, T, Ts, Tzr) ->
361 yeccpars1(S, 19, Ss, Stack, T, Ts, Tzr);
362yeccpars2_15(S, atom, Ss, Stack, T, Ts, Tzr) ->
363 yeccpars1(S, 20, Ss, Stack, T, Ts, Tzr);
364yeccpars2_15(S, char, Ss, Stack, T, Ts, Tzr) ->
365 yeccpars1(S, 21, Ss, Stack, T, Ts, Tzr);
366yeccpars2_15(S, float, Ss, Stack, T, Ts, Tzr) ->
367 yeccpars1(S, 22, Ss, Stack, T, Ts, Tzr);
368yeccpars2_15(S, integer, Ss, Stack, T, Ts, Tzr) ->
369 yeccpars1(S, 23, Ss, Stack, T, Ts, Tzr);
370yeccpars2_15(S, reserved_symbol, Ss, Stack, T, Ts, Tzr) ->
371 yeccpars1(S, 24, Ss, Stack, T, Ts, Tzr);
372yeccpars2_15(S, reserved_word, Ss, Stack, T, Ts, Tzr) ->
373 yeccpars1(S, 25, Ss, Stack, T, Ts, Tzr);
374yeccpars2_15(S, string, Ss, Stack, T, Ts, Tzr) ->
375 yeccpars1(S, 26, Ss, Stack, T, Ts, Tzr);
376yeccpars2_15(S, var, Ss, Stack, T, Ts, Tzr) ->
377 yeccpars1(S, 27, Ss, Stack, T, Ts, Tzr);
378yeccpars2_15(_, _, _, _, T, _, _) ->
379 yeccerror(T).
380
381yeccpars2_16(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
382 [_|Nss] = Ss,
383 NewStack = yeccpars2_16_(Stack),
384 yeccgoto_attached_code(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
385
386yeccpars2_17(S, '->', Ss, Stack, T, Ts, Tzr) ->
387 yeccpars1(S, 18, Ss, Stack, T, Ts, Tzr);
388yeccpars2_17(S, ':', Ss, Stack, T, Ts, Tzr) ->
389 yeccpars1(S, 19, Ss, Stack, T, Ts, Tzr);
390yeccpars2_17(S, atom, Ss, Stack, T, Ts, Tzr) ->
391 yeccpars1(S, 20, Ss, Stack, T, Ts, Tzr);
392yeccpars2_17(S, char, Ss, Stack, T, Ts, Tzr) ->
393 yeccpars1(S, 21, Ss, Stack, T, Ts, Tzr);
394yeccpars2_17(S, float, Ss, Stack, T, Ts, Tzr) ->
395 yeccpars1(S, 22, Ss, Stack, T, Ts, Tzr);
396yeccpars2_17(S, integer, Ss, Stack, T, Ts, Tzr) ->
397 yeccpars1(S, 23, Ss, Stack, T, Ts, Tzr);
398yeccpars2_17(S, reserved_symbol, Ss, Stack, T, Ts, Tzr) ->
399 yeccpars1(S, 24, Ss, Stack, T, Ts, Tzr);
400yeccpars2_17(S, reserved_word, Ss, Stack, T, Ts, Tzr) ->
401 yeccpars1(S, 25, Ss, Stack, T, Ts, Tzr);
402yeccpars2_17(S, string, Ss, Stack, T, Ts, Tzr) ->
403 yeccpars1(S, 26, Ss, Stack, T, Ts, Tzr);
404yeccpars2_17(S, var, Ss, Stack, T, Ts, Tzr) ->
405 yeccpars1(S, 27, Ss, Stack, T, Ts, Tzr);
406yeccpars2_17(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
407 NewStack = yeccpars2_17_(Stack),
408 yeccgoto_tokens(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
409
410yeccpars2_18(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
411 NewStack = yeccpars2_18_(Stack),
412 yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
413
414yeccpars2_19(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
415 NewStack = yeccpars2_19_(Stack),
416 yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
417
418yeccpars2_20(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
419 NewStack = yeccpars2_20_(Stack),
420 yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
421
422yeccpars2_21(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
423 NewStack = yeccpars2_21_(Stack),
424 yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
425
426yeccpars2_22(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
427 NewStack = yeccpars2_22_(Stack),
428 yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
429
430yeccpars2_23(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
431 NewStack = yeccpars2_23_(Stack),
432 yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
433
434yeccpars2_24(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
435 NewStack = yeccpars2_24_(Stack),
436 yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
437
438yeccpars2_25(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
439 NewStack = yeccpars2_25_(Stack),
440 yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
441
442yeccpars2_26(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
443 NewStack = yeccpars2_26_(Stack),
444 yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
445
446yeccpars2_27(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
447 NewStack = yeccpars2_27_(Stack),
448 yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
449
450yeccpars2_28(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
451 [_|Nss] = Ss,
452 NewStack = yeccpars2_28_(Stack),
453 yeccgoto_tokens(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
454
455yeccpars2_29(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
456 [_,_,_,_|Nss] = Ss,
457 NewStack = yeccpars2_29_(Stack),
458 yeccgoto_rule(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
459
460-dialyzer({nowarn_function, yeccpars2_30/7}).
461yeccpars2_30(S, dot, Ss, Stack, T, Ts, Tzr) ->
462 yeccpars1(S, 35, Ss, Stack, T, Ts, Tzr);
463yeccpars2_30(_, _, _, _, T, _, _) ->
464 yeccerror(T).
465
466-dialyzer({nowarn_function, yeccpars2_31/7}).
467yeccpars2_31(S, dot, Ss, Stack, T, Ts, Tzr) ->
468 yeccpars1(S, 34, Ss, Stack, T, Ts, Tzr);
469yeccpars2_31(_, _, _, _, T, _, _) ->
470 yeccerror(T).
471
472yeccpars2_32(S, string, Ss, Stack, T, Ts, Tzr) ->
473 yeccpars1(S, 32, Ss, Stack, T, Ts, Tzr);
474yeccpars2_32(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
475 NewStack = yeccpars2_32_(Stack),
476 yeccgoto_strings(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
477
478yeccpars2_33(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
479 [_|Nss] = Ss,
480 NewStack = yeccpars2_33_(Stack),
481 yeccgoto_strings(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
482
483yeccpars2_34(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
484 [_,_|Nss] = Ss,
485 NewStack = yeccpars2_34_(Stack),
486 yeccgoto_declaration(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
487
488yeccpars2_35(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
489 [_,_|Nss] = Ss,
490 NewStack = yeccpars2_35_(Stack),
491 yeccgoto_declaration(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
492
493-dialyzer({nowarn_function, yeccgoto_attached_code/7}).
494yeccgoto_attached_code(11, Cat, Ss, Stack, T, Ts, Tzr) ->
495 yeccpars2_14(14, Cat, Ss, Stack, T, Ts, Tzr).
496
497-dialyzer({nowarn_function, yeccgoto_declaration/7}).
498yeccgoto_declaration(0=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
499 yeccpars2_5(_S, Cat, Ss, Stack, T, Ts, Tzr).
500
501-dialyzer({nowarn_function, yeccgoto_grammar/7}).
502yeccgoto_grammar(0, Cat, Ss, Stack, T, Ts, Tzr) ->
503 yeccpars2_4(4, Cat, Ss, Stack, T, Ts, Tzr).
504
505-dialyzer({nowarn_function, yeccgoto_head/7}).
506yeccgoto_head(0, Cat, Ss, Stack, T, Ts, Tzr) ->
507 yeccpars2_3(3, Cat, Ss, Stack, T, Ts, Tzr).
508
509-dialyzer({nowarn_function, yeccgoto_rule/7}).
510yeccgoto_rule(0=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
511 yeccpars2_2(_S, Cat, Ss, Stack, T, Ts, Tzr).
512
513-dialyzer({nowarn_function, yeccgoto_strings/7}).
514yeccgoto_strings(1, Cat, Ss, Stack, T, Ts, Tzr) ->
515 yeccpars2_31(31, Cat, Ss, Stack, T, Ts, Tzr);
516yeccgoto_strings(32=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
517 yeccpars2_33(_S, Cat, Ss, Stack, T, Ts, Tzr).
518
519-dialyzer({nowarn_function, yeccgoto_symbol/7}).
520yeccgoto_symbol(0, Cat, Ss, Stack, T, Ts, Tzr) ->
521 yeccpars2_1(1, Cat, Ss, Stack, T, Ts, Tzr);
522yeccgoto_symbol(1, Cat, Ss, Stack, T, Ts, Tzr) ->
523 yeccpars2_12(12, Cat, Ss, Stack, T, Ts, Tzr);
524yeccgoto_symbol(10, Cat, Ss, Stack, T, Ts, Tzr) ->
525 yeccpars2_12(12, Cat, Ss, Stack, T, Ts, Tzr);
526yeccgoto_symbol(12, Cat, Ss, Stack, T, Ts, Tzr) ->
527 yeccpars2_12(12, Cat, Ss, Stack, T, Ts, Tzr).
528
529-dialyzer({nowarn_function, yeccgoto_symbols/7}).
530yeccgoto_symbols(1, Cat, Ss, Stack, T, Ts, Tzr) ->
531 yeccpars2_30(30, Cat, Ss, Stack, T, Ts, Tzr);
532yeccgoto_symbols(10, Cat, Ss, Stack, T, Ts, Tzr) ->
533 yeccpars2_11(11, Cat, Ss, Stack, T, Ts, Tzr);
534yeccgoto_symbols(12=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
535 yeccpars2_13(_S, Cat, Ss, Stack, T, Ts, Tzr).
536
537-dialyzer({nowarn_function, yeccgoto_token/7}).
538yeccgoto_token(15, Cat, Ss, Stack, T, Ts, Tzr) ->
539 yeccpars2_17(17, Cat, Ss, Stack, T, Ts, Tzr);
540yeccgoto_token(17, Cat, Ss, Stack, T, Ts, Tzr) ->
541 yeccpars2_17(17, Cat, Ss, Stack, T, Ts, Tzr).
542
543-dialyzer({nowarn_function, yeccgoto_tokens/7}).
544yeccgoto_tokens(15=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
545 yeccpars2_16(_S, Cat, Ss, Stack, T, Ts, Tzr);
546yeccgoto_tokens(17=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
547 yeccpars2_28(_S, Cat, Ss, Stack, T, Ts, Tzr).
548
549-compile({inline,yeccpars2_1_/1}).
550-file("yeccgramm.yrl", 35).
551yeccpars2_1_(__Stack0) ->
552 [___1 | __Stack] = __Stack0,
553 [begin
554                 ___1
555  end | __Stack].
556
557-compile({inline,yeccpars2_2_/1}).
558-file("yeccgramm.yrl", 31).
559yeccpars2_2_(__Stack0) ->
560 [___1 | __Stack] = __Stack0,
561 [begin
562                  ___1
563  end | __Stack].
564
565-compile({inline,yeccpars2_5_/1}).
566-file("yeccgramm.yrl", 30).
567yeccpars2_5_(__Stack0) ->
568 [___1 | __Stack] = __Stack0,
569 [begin
570                         ___1
571  end | __Stack].
572
573-compile({inline,yeccpars2_6_/1}).
574-file("yeccgramm.yrl", 49).
575yeccpars2_6_(__Stack0) ->
576 [___1 | __Stack] = __Stack0,
577 [begin
578                 symbol(___1)
579  end | __Stack].
580
581-compile({inline,yeccpars2_7_/1}).
582-file("yeccgramm.yrl", 50).
583yeccpars2_7_(__Stack0) ->
584 [___1 | __Stack] = __Stack0,
585 [begin
586                    symbol(___1)
587  end | __Stack].
588
589-compile({inline,yeccpars2_8_/1}).
590-file("yeccgramm.yrl", 51).
591yeccpars2_8_(__Stack0) ->
592 [___1 | __Stack] = __Stack0,
593 [begin
594                          symbol(___1)
595  end | __Stack].
596
597-compile({inline,yeccpars2_9_/1}).
598-file("yeccgramm.yrl", 48).
599yeccpars2_9_(__Stack0) ->
600 [___1 | __Stack] = __Stack0,
601 [begin
602                symbol(___1)
603  end | __Stack].
604
605-compile({inline,yeccpars2_11_/1}).
606-file("yeccgramm.yrl", 41).
607yeccpars2_11_(__Stack0) ->
608 [begin
609                            {erlang_code,
610                             [{atom,
611                               erl_anno:set_text("'$undefined'",
612                                                 erl_anno:new(0)),
613                               '$undefined'}]}
614  end | __Stack0].
615
616-compile({inline,yeccpars2_12_/1}).
617-file("yeccgramm.yrl", 36).
618yeccpars2_12_(__Stack0) ->
619 [___1 | __Stack] = __Stack0,
620 [begin
621                    [___1]
622  end | __Stack].
623
624-compile({inline,yeccpars2_13_/1}).
625-file("yeccgramm.yrl", 37).
626yeccpars2_13_(__Stack0) ->
627 [___2,___1 | __Stack] = __Stack0,
628 [begin
629                            [___1 | ___2]
630  end | __Stack].
631
632-compile({inline,yeccpars2_16_/1}).
633-file("yeccgramm.yrl", 40).
634yeccpars2_16_(__Stack0) ->
635 [___2,___1 | __Stack] = __Stack0,
636 [begin
637                              {erlang_code, ___2}
638  end | __Stack].
639
640-compile({inline,yeccpars2_17_/1}).
641-file("yeccgramm.yrl", 46).
642yeccpars2_17_(__Stack0) ->
643 [___1 | __Stack] = __Stack0,
644 [begin
645                  [___1]
646  end | __Stack].
647
648-compile({inline,yeccpars2_18_/1}).
649-file("yeccgramm.yrl", 60).
650yeccpars2_18_(__Stack0) ->
651 [___1 | __Stack] = __Stack0,
652 [begin
653                {'->', anno_of(___1)}
654  end | __Stack].
655
656-compile({inline,yeccpars2_19_/1}).
657-file("yeccgramm.yrl", 61).
658yeccpars2_19_(__Stack0) ->
659 [___1 | __Stack] = __Stack0,
660 [begin
661               {':', anno_of(___1)}
662  end | __Stack].
663
664-compile({inline,yeccpars2_20_/1}).
665-file("yeccgramm.yrl", 53).
666yeccpars2_20_(__Stack0) ->
667 [___1 | __Stack] = __Stack0,
668 [begin
669                ___1
670  end | __Stack].
671
672-compile({inline,yeccpars2_21_/1}).
673-file("yeccgramm.yrl", 57).
674yeccpars2_21_(__Stack0) ->
675 [___1 | __Stack] = __Stack0,
676 [begin
677                ___1
678  end | __Stack].
679
680-compile({inline,yeccpars2_22_/1}).
681-file("yeccgramm.yrl", 54).
682yeccpars2_22_(__Stack0) ->
683 [___1 | __Stack] = __Stack0,
684 [begin
685                 ___1
686  end | __Stack].
687
688-compile({inline,yeccpars2_23_/1}).
689-file("yeccgramm.yrl", 55).
690yeccpars2_23_(__Stack0) ->
691 [___1 | __Stack] = __Stack0,
692 [begin
693                   ___1
694  end | __Stack].
695
696-compile({inline,yeccpars2_24_/1}).
697-file("yeccgramm.yrl", 58).
698yeccpars2_24_(__Stack0) ->
699 [___1 | __Stack] = __Stack0,
700 [begin
701                           {value_of(___1), anno_of(___1)}
702  end | __Stack].
703
704-compile({inline,yeccpars2_25_/1}).
705-file("yeccgramm.yrl", 59).
706yeccpars2_25_(__Stack0) ->
707 [___1 | __Stack] = __Stack0,
708 [begin
709                         {value_of(___1), anno_of(___1)}
710  end | __Stack].
711
712-compile({inline,yeccpars2_26_/1}).
713-file("yeccgramm.yrl", 56).
714yeccpars2_26_(__Stack0) ->
715 [___1 | __Stack] = __Stack0,
716 [begin
717                  ___1
718  end | __Stack].
719
720-compile({inline,yeccpars2_27_/1}).
721-file("yeccgramm.yrl", 52).
722yeccpars2_27_(__Stack0) ->
723 [___1 | __Stack] = __Stack0,
724 [begin
725               ___1
726  end | __Stack].
727
728-compile({inline,yeccpars2_28_/1}).
729-file("yeccgramm.yrl", 47).
730yeccpars2_28_(__Stack0) ->
731 [___2,___1 | __Stack] = __Stack0,
732 [begin
733                         [___1 | ___2]
734  end | __Stack].
735
736-compile({inline,yeccpars2_29_/1}).
737-file("yeccgramm.yrl", 34).
738yeccpars2_29_(__Stack0) ->
739 [___5,___4,___3,___2,___1 | __Stack] = __Stack0,
740 [begin
741                                             {rule, [___1 | ___3], ___4}
742  end | __Stack].
743
744-compile({inline,yeccpars2_32_/1}).
745-file("yeccgramm.yrl", 38).
746yeccpars2_32_(__Stack0) ->
747 [___1 | __Stack] = __Stack0,
748 [begin
749                    [___1]
750  end | __Stack].
751
752-compile({inline,yeccpars2_33_/1}).
753-file("yeccgramm.yrl", 39).
754yeccpars2_33_(__Stack0) ->
755 [___2,___1 | __Stack] = __Stack0,
756 [begin
757                            [___1 | ___2]
758  end | __Stack].
759
760-compile({inline,yeccpars2_34_/1}).
761-file("yeccgramm.yrl", 33).
762yeccpars2_34_(__Stack0) ->
763 [___3,___2,___1 | __Stack] = __Stack0,
764 [begin
765                                   {___1, ___2}
766  end | __Stack].
767
768-compile({inline,yeccpars2_35_/1}).
769-file("yeccgramm.yrl", 32).
770yeccpars2_35_(__Stack0) ->
771 [___3,___2,___1 | __Stack] = __Stack0,
772 [begin
773                                   {___1, ___2}
774  end | __Stack].
775
776
777-file("yeccgramm.yrl", 80).
778