1-module(yeccparser).
2-export([parse/1, parse_and_scan/1, format_error/1]).
3-file("yeccgramm.yrl", 65).
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_line}, 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_line}, 0, [], []);
50parse_and_scan({M, F, A}) ->
51    Arity = length(A),
52    yeccpars0([], {{fun M:F/Arity, A}, no_line}, 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(integer(), any()) -> no_return().
67return_error(Line, Message) ->
68    throw({error, {Line, ?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, {_Line, ?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},_Line}, State, States, Vstack) ->
101    case apply(F, A) of
102        {ok, Tokens, Endline} ->
103            yeccpars1(Tokens, {{F, A}, Endline}, State, States, Vstack);
104        {eof, Endline} ->
105            yeccpars1([], {no_func, Endline}, State, States, Vstack);
106        {error, Descriptor, _Endline} ->
107            {error, Descriptor}
108    end;
109yeccpars1([], {no_func, no_line}, State, States, Vstack) ->
110    Line = 999999,
111    yeccpars2(State, '$end', States, Vstack, yecc_end(Line), [],
112              {no_func, Line});
113yeccpars1([], {no_func, Endline}, State, States, Vstack) ->
114    yeccpars2(State, '$end', States, Vstack, yecc_end(Endline), [],
115              {no_func, Endline}).
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}, _Line}=Tzr) ->
127    yeccpars1([], Tzr, State, [State1 | States], [Token0 | Vstack]);
128yeccpars1(State1, State, States, Vstack, Token0, [], {no_func, no_line}) ->
129    Line = yecctoken_end_location(Token0),
130    yeccpars2(State, '$end', [State1 | States], [Token0 | Vstack],
131              yecc_end(Line), [], {no_func, Line});
132yeccpars1(State1, State, States, Vstack, Token0, [], {no_func, Line}) ->
133    yeccpars2(State, '$end', [State1 | States], [Token0 | Vstack],
134              yecc_end(Line), [], {no_func, Line}).
135
136%% For internal use only.
137yecc_end({Line,_Column}) ->
138    {'$end', Line};
139yecc_end(Line) ->
140    {'$end', Line}.
141
142yecctoken_end_location(Token) ->
143    try erl_anno:end_location(element(2, Token)) of
144        undefined -> yecctoken_location(Token);
145        Loc -> Loc
146    catch _:_ -> yecctoken_location(Token)
147    end.
148
149-compile({nowarn_unused_function, yeccerror/1}).
150yeccerror(Token) ->
151    Text = yecctoken_to_string(Token),
152    Location = yecctoken_location(Token),
153    {error, {Location, ?MODULE, ["syntax error before: ", Text]}}.
154
155-compile({nowarn_unused_function, yecctoken_to_string/1}).
156yecctoken_to_string(Token) ->
157    try erl_scan:text(Token) of
158        undefined -> yecctoken2string(Token);
159        Txt -> Txt
160    catch _:_ -> yecctoken2string(Token)
161    end.
162
163yecctoken_location(Token) ->
164    try erl_scan:location(Token)
165    catch _:_ -> element(2, Token)
166    end.
167
168-compile({nowarn_unused_function, yecctoken2string/1}).
169yecctoken2string({atom, _, A}) -> io_lib:write_atom(A);
170yecctoken2string({integer,_,N}) -> io_lib:write(N);
171yecctoken2string({float,_,F}) -> io_lib:write(F);
172yecctoken2string({char,_,C}) -> io_lib:write_char(C);
173yecctoken2string({var,_,V}) -> io_lib:format("~s", [V]);
174yecctoken2string({string,_,S}) -> io_lib:write_string(S);
175yecctoken2string({reserved_symbol, _, A}) -> io_lib:write(A);
176yecctoken2string({_Cat, _, Val}) -> io_lib:format("~tp", [Val]);
177yecctoken2string({dot, _}) -> "'.'";
178yecctoken2string({'$end', _}) -> [];
179yecctoken2string({Other, _}) when is_atom(Other) ->
180    io_lib:write_atom(Other);
181yecctoken2string(Other) ->
182    io_lib:format("~tp", [Other]).
183
184%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
185
186
187
188-file("yeccgramm.erl", 190).
189
190-dialyzer({nowarn_function, yeccpars2/7}).
191yeccpars2(0=S, Cat, Ss, Stack, T, Ts, Tzr) ->
192 yeccpars2_0(S, Cat, Ss, Stack, T, Ts, Tzr);
193%% yeccpars2(1=S, Cat, Ss, Stack, T, Ts, Tzr) ->
194%%  yeccpars2_1(S, Cat, Ss, Stack, T, Ts, Tzr);
195%% yeccpars2(2=S, Cat, Ss, Stack, T, Ts, Tzr) ->
196%%  yeccpars2_2(S, Cat, Ss, Stack, T, Ts, Tzr);
197%% yeccpars2(3=S, Cat, Ss, Stack, T, Ts, Tzr) ->
198%%  yeccpars2_3(S, Cat, Ss, Stack, T, Ts, Tzr);
199%% yeccpars2(4=S, Cat, Ss, Stack, T, Ts, Tzr) ->
200%%  yeccpars2_4(S, Cat, Ss, Stack, T, Ts, Tzr);
201%% yeccpars2(5=S, Cat, Ss, Stack, T, Ts, Tzr) ->
202%%  yeccpars2_5(S, Cat, Ss, Stack, T, Ts, Tzr);
203yeccpars2(6=S, Cat, Ss, Stack, T, Ts, Tzr) ->
204 yeccpars2_6(S, Cat, Ss, Stack, T, Ts, Tzr);
205yeccpars2(7=S, Cat, Ss, Stack, T, Ts, Tzr) ->
206 yeccpars2_7(S, Cat, Ss, Stack, T, Ts, Tzr);
207yeccpars2(8=S, Cat, Ss, Stack, T, Ts, Tzr) ->
208 yeccpars2_8(S, Cat, Ss, Stack, T, Ts, Tzr);
209yeccpars2(9=S, Cat, Ss, Stack, T, Ts, Tzr) ->
210 yeccpars2_9(S, Cat, Ss, Stack, T, Ts, Tzr);
211yeccpars2(10=S, Cat, Ss, Stack, T, Ts, Tzr) ->
212 yeccpars2_0(S, Cat, Ss, Stack, T, Ts, Tzr);
213%% yeccpars2(11=S, Cat, Ss, Stack, T, Ts, Tzr) ->
214%%  yeccpars2_11(S, Cat, Ss, Stack, T, Ts, Tzr);
215%% yeccpars2(12=S, Cat, Ss, Stack, T, Ts, Tzr) ->
216%%  yeccpars2_12(S, Cat, Ss, Stack, T, Ts, Tzr);
217%% yeccpars2(13=S, Cat, Ss, Stack, T, Ts, Tzr) ->
218%%  yeccpars2_13(S, Cat, Ss, Stack, T, Ts, Tzr);
219%% yeccpars2(14=S, Cat, Ss, Stack, T, Ts, Tzr) ->
220%%  yeccpars2_14(S, Cat, Ss, Stack, T, Ts, Tzr);
221yeccpars2(15=S, Cat, Ss, Stack, T, Ts, Tzr) ->
222 yeccpars2_15(S, Cat, Ss, Stack, T, Ts, Tzr);
223%% yeccpars2(16=S, Cat, Ss, Stack, T, Ts, Tzr) ->
224%%  yeccpars2_16(S, Cat, Ss, Stack, T, Ts, Tzr);
225%% yeccpars2(17=S, Cat, Ss, Stack, T, Ts, Tzr) ->
226%%  yeccpars2_17(S, Cat, Ss, Stack, T, Ts, Tzr);
227yeccpars2(18=S, Cat, Ss, Stack, T, Ts, Tzr) ->
228 yeccpars2_18(S, Cat, Ss, Stack, T, Ts, Tzr);
229yeccpars2(19=S, Cat, Ss, Stack, T, Ts, Tzr) ->
230 yeccpars2_19(S, Cat, Ss, Stack, T, Ts, Tzr);
231yeccpars2(20=S, Cat, Ss, Stack, T, Ts, Tzr) ->
232 yeccpars2_20(S, Cat, Ss, Stack, T, Ts, Tzr);
233yeccpars2(21=S, Cat, Ss, Stack, T, Ts, Tzr) ->
234 yeccpars2_21(S, Cat, Ss, Stack, T, Ts, Tzr);
235yeccpars2(22=S, Cat, Ss, Stack, T, Ts, Tzr) ->
236 yeccpars2_22(S, Cat, Ss, Stack, T, Ts, Tzr);
237yeccpars2(23=S, Cat, Ss, Stack, T, Ts, Tzr) ->
238 yeccpars2_23(S, Cat, Ss, Stack, T, Ts, Tzr);
239yeccpars2(24=S, Cat, Ss, Stack, T, Ts, Tzr) ->
240 yeccpars2_24(S, Cat, Ss, Stack, T, Ts, Tzr);
241yeccpars2(25=S, Cat, Ss, Stack, T, Ts, Tzr) ->
242 yeccpars2_25(S, Cat, Ss, Stack, T, Ts, Tzr);
243yeccpars2(26=S, Cat, Ss, Stack, T, Ts, Tzr) ->
244 yeccpars2_26(S, Cat, Ss, Stack, T, Ts, Tzr);
245yeccpars2(27=S, Cat, Ss, Stack, T, Ts, Tzr) ->
246 yeccpars2_27(S, Cat, Ss, Stack, T, Ts, Tzr);
247%% yeccpars2(28=S, Cat, Ss, Stack, T, Ts, Tzr) ->
248%%  yeccpars2_28(S, Cat, Ss, Stack, T, Ts, Tzr);
249yeccpars2(29=S, Cat, Ss, Stack, T, Ts, Tzr) ->
250 yeccpars2_29(S, Cat, Ss, Stack, T, Ts, Tzr);
251%% yeccpars2(30=S, Cat, Ss, Stack, T, Ts, Tzr) ->
252%%  yeccpars2_30(S, Cat, Ss, Stack, T, Ts, Tzr);
253%% yeccpars2(31=S, Cat, Ss, Stack, T, Ts, Tzr) ->
254%%  yeccpars2_31(S, Cat, Ss, Stack, T, Ts, Tzr);
255yeccpars2(32=S, Cat, Ss, Stack, T, Ts, Tzr) ->
256 yeccpars2_32(S, Cat, Ss, Stack, T, Ts, Tzr);
257%% yeccpars2(33=S, Cat, Ss, Stack, T, Ts, Tzr) ->
258%%  yeccpars2_33(S, Cat, Ss, Stack, T, Ts, Tzr);
259yeccpars2(34=S, Cat, Ss, Stack, T, Ts, Tzr) ->
260 yeccpars2_34(S, Cat, Ss, Stack, T, Ts, Tzr);
261yeccpars2(35=S, Cat, Ss, Stack, T, Ts, Tzr) ->
262 yeccpars2_35(S, Cat, Ss, Stack, T, Ts, Tzr);
263yeccpars2(Other, _, _, _, _, _, _) ->
264 erlang:error({yecc_bug,"1.4",{missing_state_in_action_table, Other}}).
265
266-dialyzer({nowarn_function, yeccpars2_0/7}).
267yeccpars2_0(S, atom, Ss, Stack, T, Ts, Tzr) ->
268 yeccpars1(S, 6, Ss, Stack, T, Ts, Tzr);
269yeccpars2_0(S, integer, Ss, Stack, T, Ts, Tzr) ->
270 yeccpars1(S, 7, Ss, Stack, T, Ts, Tzr);
271yeccpars2_0(S, reserved_word, Ss, Stack, T, Ts, Tzr) ->
272 yeccpars1(S, 8, Ss, Stack, T, Ts, Tzr);
273yeccpars2_0(S, var, Ss, Stack, T, Ts, Tzr) ->
274 yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr);
275yeccpars2_0(_, _, _, _, T, _, _) ->
276 yeccerror(T).
277
278yeccpars2_1(S, atom, Ss, Stack, T, Ts, Tzr) ->
279 yeccpars1(S, 6, Ss, Stack, T, Ts, Tzr);
280yeccpars2_1(S, integer, Ss, Stack, T, Ts, Tzr) ->
281 yeccpars1(S, 7, Ss, Stack, T, Ts, Tzr);
282yeccpars2_1(S, reserved_word, Ss, Stack, T, Ts, Tzr) ->
283 yeccpars1(S, 8, Ss, Stack, T, Ts, Tzr);
284yeccpars2_1(S, string, Ss, Stack, T, Ts, Tzr) ->
285 yeccpars1(S, 32, Ss, Stack, T, Ts, Tzr);
286yeccpars2_1(S, var, Ss, Stack, T, Ts, Tzr) ->
287 yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr);
288yeccpars2_1(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
289 yeccgoto_head(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
290
291yeccpars2_2(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
292 yeccgoto_grammar(hd(Ss), Cat, Ss, Stack, 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 yeccgoto_grammar(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
308
309yeccpars2_6(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
310 NewStack = yeccpars2_6_(Stack),
311 yeccgoto_symbol(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
312
313yeccpars2_7(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
314 NewStack = yeccpars2_7_(Stack),
315 yeccgoto_symbol(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
316
317yeccpars2_8(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
318 NewStack = yeccpars2_8_(Stack),
319 yeccgoto_symbol(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
320
321yeccpars2_9(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
322 NewStack = yeccpars2_9_(Stack),
323 yeccgoto_symbol(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
324
325%% yeccpars2_10: see yeccpars2_0
326
327yeccpars2_11(S, ':', Ss, Stack, T, Ts, Tzr) ->
328 yeccpars1(S, 15, Ss, Stack, T, Ts, Tzr);
329yeccpars2_11(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
330 NewStack = yeccpars2_11_(Stack),
331 yeccpars2_14(14, Cat, [11 | Ss], NewStack, T, Ts, Tzr).
332
333yeccpars2_12(S, atom, Ss, Stack, T, Ts, Tzr) ->
334 yeccpars1(S, 6, Ss, Stack, T, Ts, Tzr);
335yeccpars2_12(S, integer, Ss, Stack, T, Ts, Tzr) ->
336 yeccpars1(S, 7, Ss, Stack, T, Ts, Tzr);
337yeccpars2_12(S, reserved_word, Ss, Stack, T, Ts, Tzr) ->
338 yeccpars1(S, 8, Ss, Stack, T, Ts, Tzr);
339yeccpars2_12(S, var, Ss, Stack, T, Ts, Tzr) ->
340 yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr);
341yeccpars2_12(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
342 NewStack = yeccpars2_12_(Stack),
343 yeccgoto_symbols(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
344
345yeccpars2_13(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
346 [_|Nss] = Ss,
347 NewStack = yeccpars2_13_(Stack),
348 yeccgoto_symbols(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
349
350-dialyzer({nowarn_function, yeccpars2_14/7}).
351yeccpars2_14(S, dot, Ss, Stack, T, Ts, Tzr) ->
352 yeccpars1(S, 29, Ss, Stack, T, Ts, Tzr);
353yeccpars2_14(_, _, _, _, T, _, _) ->
354 yeccerror(T).
355
356-dialyzer({nowarn_function, yeccpars2_15/7}).
357yeccpars2_15(S, '->', Ss, Stack, T, Ts, Tzr) ->
358 yeccpars1(S, 18, Ss, Stack, T, Ts, Tzr);
359yeccpars2_15(S, ':', Ss, Stack, T, Ts, Tzr) ->
360 yeccpars1(S, 19, Ss, Stack, T, Ts, Tzr);
361yeccpars2_15(S, atom, Ss, Stack, T, Ts, Tzr) ->
362 yeccpars1(S, 20, Ss, Stack, T, Ts, Tzr);
363yeccpars2_15(S, char, Ss, Stack, T, Ts, Tzr) ->
364 yeccpars1(S, 21, Ss, Stack, T, Ts, Tzr);
365yeccpars2_15(S, float, Ss, Stack, T, Ts, Tzr) ->
366 yeccpars1(S, 22, Ss, Stack, T, Ts, Tzr);
367yeccpars2_15(S, integer, Ss, Stack, T, Ts, Tzr) ->
368 yeccpars1(S, 23, Ss, Stack, T, Ts, Tzr);
369yeccpars2_15(S, reserved_symbol, Ss, Stack, T, Ts, Tzr) ->
370 yeccpars1(S, 24, Ss, Stack, T, Ts, Tzr);
371yeccpars2_15(S, reserved_word, Ss, Stack, T, Ts, Tzr) ->
372 yeccpars1(S, 25, Ss, Stack, T, Ts, Tzr);
373yeccpars2_15(S, string, Ss, Stack, T, Ts, Tzr) ->
374 yeccpars1(S, 26, Ss, Stack, T, Ts, Tzr);
375yeccpars2_15(S, var, Ss, Stack, T, Ts, Tzr) ->
376 yeccpars1(S, 27, Ss, Stack, T, Ts, Tzr);
377yeccpars2_15(_, _, _, _, T, _, _) ->
378 yeccerror(T).
379
380yeccpars2_16(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
381 [_|Nss] = Ss,
382 NewStack = yeccpars2_16_(Stack),
383 yeccgoto_attached_code(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
384
385yeccpars2_17(S, '->', Ss, Stack, T, Ts, Tzr) ->
386 yeccpars1(S, 18, Ss, Stack, T, Ts, Tzr);
387yeccpars2_17(S, ':', Ss, Stack, T, Ts, Tzr) ->
388 yeccpars1(S, 19, Ss, Stack, T, Ts, Tzr);
389yeccpars2_17(S, atom, Ss, Stack, T, Ts, Tzr) ->
390 yeccpars1(S, 20, Ss, Stack, T, Ts, Tzr);
391yeccpars2_17(S, char, Ss, Stack, T, Ts, Tzr) ->
392 yeccpars1(S, 21, Ss, Stack, T, Ts, Tzr);
393yeccpars2_17(S, float, Ss, Stack, T, Ts, Tzr) ->
394 yeccpars1(S, 22, Ss, Stack, T, Ts, Tzr);
395yeccpars2_17(S, integer, Ss, Stack, T, Ts, Tzr) ->
396 yeccpars1(S, 23, Ss, Stack, T, Ts, Tzr);
397yeccpars2_17(S, reserved_symbol, Ss, Stack, T, Ts, Tzr) ->
398 yeccpars1(S, 24, Ss, Stack, T, Ts, Tzr);
399yeccpars2_17(S, reserved_word, Ss, Stack, T, Ts, Tzr) ->
400 yeccpars1(S, 25, Ss, Stack, T, Ts, Tzr);
401yeccpars2_17(S, string, Ss, Stack, T, Ts, Tzr) ->
402 yeccpars1(S, 26, Ss, Stack, T, Ts, Tzr);
403yeccpars2_17(S, var, Ss, Stack, T, Ts, Tzr) ->
404 yeccpars1(S, 27, Ss, Stack, T, Ts, Tzr);
405yeccpars2_17(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
406 NewStack = yeccpars2_17_(Stack),
407 yeccgoto_tokens(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
408
409yeccpars2_18(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
410 NewStack = yeccpars2_18_(Stack),
411 yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
412
413yeccpars2_19(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
414 NewStack = yeccpars2_19_(Stack),
415 yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
416
417yeccpars2_20(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
418 yeccgoto_token(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
419
420yeccpars2_21(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
421 yeccgoto_token(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
422
423yeccpars2_22(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
424 yeccgoto_token(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
425
426yeccpars2_23(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
427 yeccgoto_token(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
428
429yeccpars2_24(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
430 NewStack = yeccpars2_24_(Stack),
431 yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
432
433yeccpars2_25(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
434 NewStack = yeccpars2_25_(Stack),
435 yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
436
437yeccpars2_26(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
438 yeccgoto_token(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
439
440yeccpars2_27(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
441 yeccgoto_token(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
442
443yeccpars2_28(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
444 [_|Nss] = Ss,
445 NewStack = yeccpars2_28_(Stack),
446 yeccgoto_tokens(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
447
448yeccpars2_29(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
449 [_,_,_,_|Nss] = Ss,
450 NewStack = yeccpars2_29_(Stack),
451 yeccgoto_rule(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
452
453-dialyzer({nowarn_function, yeccpars2_30/7}).
454yeccpars2_30(S, dot, Ss, Stack, T, Ts, Tzr) ->
455 yeccpars1(S, 35, Ss, Stack, T, Ts, Tzr);
456yeccpars2_30(_, _, _, _, T, _, _) ->
457 yeccerror(T).
458
459-dialyzer({nowarn_function, yeccpars2_31/7}).
460yeccpars2_31(S, dot, Ss, Stack, T, Ts, Tzr) ->
461 yeccpars1(S, 34, Ss, Stack, T, Ts, Tzr);
462yeccpars2_31(_, _, _, _, T, _, _) ->
463 yeccerror(T).
464
465yeccpars2_32(S, string, Ss, Stack, T, Ts, Tzr) ->
466 yeccpars1(S, 32, Ss, Stack, T, Ts, Tzr);
467yeccpars2_32(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
468 NewStack = yeccpars2_32_(Stack),
469 yeccgoto_strings(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
470
471yeccpars2_33(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
472 [_|Nss] = Ss,
473 NewStack = yeccpars2_33_(Stack),
474 yeccgoto_strings(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
475
476yeccpars2_34(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
477 [_,_|Nss] = Ss,
478 NewStack = yeccpars2_34_(Stack),
479 yeccgoto_declaration(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
480
481yeccpars2_35(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
482 [_,_|Nss] = Ss,
483 NewStack = yeccpars2_35_(Stack),
484 yeccgoto_declaration(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
485
486-dialyzer({nowarn_function, yeccgoto_attached_code/7}).
487yeccgoto_attached_code(11, Cat, Ss, Stack, T, Ts, Tzr) ->
488 yeccpars2_14(14, Cat, Ss, Stack, T, Ts, Tzr).
489
490-dialyzer({nowarn_function, yeccgoto_declaration/7}).
491yeccgoto_declaration(0=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
492 yeccpars2_5(_S, Cat, Ss, Stack, T, Ts, Tzr).
493
494-dialyzer({nowarn_function, yeccgoto_grammar/7}).
495yeccgoto_grammar(0, Cat, Ss, Stack, T, Ts, Tzr) ->
496 yeccpars2_4(4, Cat, Ss, Stack, T, Ts, Tzr).
497
498-dialyzer({nowarn_function, yeccgoto_head/7}).
499yeccgoto_head(0, Cat, Ss, Stack, T, Ts, Tzr) ->
500 yeccpars2_3(3, Cat, Ss, Stack, T, Ts, Tzr).
501
502-dialyzer({nowarn_function, yeccgoto_rule/7}).
503yeccgoto_rule(0=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
504 yeccpars2_2(_S, Cat, Ss, Stack, T, Ts, Tzr).
505
506-dialyzer({nowarn_function, yeccgoto_strings/7}).
507yeccgoto_strings(1, Cat, Ss, Stack, T, Ts, Tzr) ->
508 yeccpars2_31(31, Cat, Ss, Stack, T, Ts, Tzr);
509yeccgoto_strings(32=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
510 yeccpars2_33(_S, Cat, Ss, Stack, T, Ts, Tzr).
511
512-dialyzer({nowarn_function, yeccgoto_symbol/7}).
513yeccgoto_symbol(0, Cat, Ss, Stack, T, Ts, Tzr) ->
514 yeccpars2_1(1, Cat, Ss, Stack, T, Ts, Tzr);
515yeccgoto_symbol(1, Cat, Ss, Stack, T, Ts, Tzr) ->
516 yeccpars2_12(12, Cat, Ss, Stack, T, Ts, Tzr);
517yeccgoto_symbol(10, Cat, Ss, Stack, T, Ts, Tzr) ->
518 yeccpars2_12(12, Cat, Ss, Stack, T, Ts, Tzr);
519yeccgoto_symbol(12, Cat, Ss, Stack, T, Ts, Tzr) ->
520 yeccpars2_12(12, Cat, Ss, Stack, T, Ts, Tzr).
521
522-dialyzer({nowarn_function, yeccgoto_symbols/7}).
523yeccgoto_symbols(1, Cat, Ss, Stack, T, Ts, Tzr) ->
524 yeccpars2_30(30, Cat, Ss, Stack, T, Ts, Tzr);
525yeccgoto_symbols(10, Cat, Ss, Stack, T, Ts, Tzr) ->
526 yeccpars2_11(11, Cat, Ss, Stack, T, Ts, Tzr);
527yeccgoto_symbols(12=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
528 yeccpars2_13(_S, Cat, Ss, Stack, T, Ts, Tzr).
529
530-dialyzer({nowarn_function, yeccgoto_token/7}).
531yeccgoto_token(15, Cat, Ss, Stack, T, Ts, Tzr) ->
532 yeccpars2_17(17, Cat, Ss, Stack, T, Ts, Tzr);
533yeccgoto_token(17, Cat, Ss, Stack, T, Ts, Tzr) ->
534 yeccpars2_17(17, Cat, Ss, Stack, T, Ts, Tzr).
535
536-dialyzer({nowarn_function, yeccgoto_tokens/7}).
537yeccgoto_tokens(15=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
538 yeccpars2_16(_S, Cat, Ss, Stack, T, Ts, Tzr);
539yeccgoto_tokens(17=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
540 yeccpars2_28(_S, Cat, Ss, Stack, T, Ts, Tzr).
541
542-compile({inline,yeccpars2_6_/1}).
543-file("yeccgramm.yrl", 46).
544yeccpars2_6_(__Stack0) ->
545 [__1 | __Stack] = __Stack0,
546 [begin
547   symbol ( __1 )
548  end | __Stack].
549
550-compile({inline,yeccpars2_7_/1}).
551-file("yeccgramm.yrl", 47).
552yeccpars2_7_(__Stack0) ->
553 [__1 | __Stack] = __Stack0,
554 [begin
555   symbol ( __1 )
556  end | __Stack].
557
558-compile({inline,yeccpars2_8_/1}).
559-file("yeccgramm.yrl", 48).
560yeccpars2_8_(__Stack0) ->
561 [__1 | __Stack] = __Stack0,
562 [begin
563   symbol ( __1 )
564  end | __Stack].
565
566-compile({inline,yeccpars2_9_/1}).
567-file("yeccgramm.yrl", 45).
568yeccpars2_9_(__Stack0) ->
569 [__1 | __Stack] = __Stack0,
570 [begin
571   symbol ( __1 )
572  end | __Stack].
573
574-compile({inline,yeccpars2_11_/1}).
575-file("yeccgramm.yrl", 41).
576yeccpars2_11_(__Stack0) ->
577 [begin
578   { erlang_code ,
579    [ { atom , erl_anno : new ( 0 ) , '$undefined' } ] }
580  end | __Stack0].
581
582-compile({inline,yeccpars2_12_/1}).
583-file("yeccgramm.yrl", 36).
584yeccpars2_12_(__Stack0) ->
585 [__1 | __Stack] = __Stack0,
586 [begin
587   [ __1 ]
588  end | __Stack].
589
590-compile({inline,yeccpars2_13_/1}).
591-file("yeccgramm.yrl", 37).
592yeccpars2_13_(__Stack0) ->
593 [__2,__1 | __Stack] = __Stack0,
594 [begin
595   [ __1 | __2 ]
596  end | __Stack].
597
598-compile({inline,yeccpars2_16_/1}).
599-file("yeccgramm.yrl", 40).
600yeccpars2_16_(__Stack0) ->
601 [__2,__1 | __Stack] = __Stack0,
602 [begin
603   { erlang_code , __2 }
604  end | __Stack].
605
606-compile({inline,yeccpars2_17_/1}).
607-file("yeccgramm.yrl", 43).
608yeccpars2_17_(__Stack0) ->
609 [__1 | __Stack] = __Stack0,
610 [begin
611   [ __1 ]
612  end | __Stack].
613
614-compile({inline,yeccpars2_18_/1}).
615-file("yeccgramm.yrl", 57).
616yeccpars2_18_(__Stack0) ->
617 [__1 | __Stack] = __Stack0,
618 [begin
619   { '->' , anno_of ( __1 ) }
620  end | __Stack].
621
622-compile({inline,yeccpars2_19_/1}).
623-file("yeccgramm.yrl", 58).
624yeccpars2_19_(__Stack0) ->
625 [__1 | __Stack] = __Stack0,
626 [begin
627   { ':' , anno_of ( __1 ) }
628  end | __Stack].
629
630-compile({inline,yeccpars2_24_/1}).
631-file("yeccgramm.yrl", 55).
632yeccpars2_24_(__Stack0) ->
633 [__1 | __Stack] = __Stack0,
634 [begin
635   { value_of ( __1 ) , anno_of ( __1 ) }
636  end | __Stack].
637
638-compile({inline,yeccpars2_25_/1}).
639-file("yeccgramm.yrl", 56).
640yeccpars2_25_(__Stack0) ->
641 [__1 | __Stack] = __Stack0,
642 [begin
643   { value_of ( __1 ) , anno_of ( __1 ) }
644  end | __Stack].
645
646-compile({inline,yeccpars2_28_/1}).
647-file("yeccgramm.yrl", 44).
648yeccpars2_28_(__Stack0) ->
649 [__2,__1 | __Stack] = __Stack0,
650 [begin
651   [ __1 | __2 ]
652  end | __Stack].
653
654-compile({inline,yeccpars2_29_/1}).
655-file("yeccgramm.yrl", 34).
656yeccpars2_29_(__Stack0) ->
657 [__5,__4,__3,__2,__1 | __Stack] = __Stack0,
658 [begin
659   { rule , [ __1 | __3 ] , __4 }
660  end | __Stack].
661
662-compile({inline,yeccpars2_32_/1}).
663-file("yeccgramm.yrl", 38).
664yeccpars2_32_(__Stack0) ->
665 [__1 | __Stack] = __Stack0,
666 [begin
667   [ __1 ]
668  end | __Stack].
669
670-compile({inline,yeccpars2_33_/1}).
671-file("yeccgramm.yrl", 39).
672yeccpars2_33_(__Stack0) ->
673 [__2,__1 | __Stack] = __Stack0,
674 [begin
675   [ __1 | __2 ]
676  end | __Stack].
677
678-compile({inline,yeccpars2_34_/1}).
679-file("yeccgramm.yrl", 33).
680yeccpars2_34_(__Stack0) ->
681 [__3,__2,__1 | __Stack] = __Stack0,
682 [begin
683   { __1 , __2 }
684  end | __Stack].
685
686-compile({inline,yeccpars2_35_/1}).
687-file("yeccgramm.yrl", 32).
688yeccpars2_35_(__Stack0) ->
689 [__3,__2,__1 | __Stack] = __Stack0,
690 [begin
691   { __1 , __2 }
692  end | __Stack].
693
694
695-file("yeccgramm.yrl", 77).
696