1%% ``Licensed under the Apache License, Version 2.0 (the "License");
2%% you may not use this file except in compliance with the License.
3%% You may obtain a copy of the License at
4%%
5%%     http://www.apache.org/licenses/LICENSE-2.0
6%%
7%% Unless required by applicable law or agreed to in writing, software
8%% distributed under the License is distributed on an "AS IS" BASIS,
9%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10%% See the License for the specific language governing permissions and
11%% limitations under the License.
12%%
13%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
14%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
15%% AB. All Rights Reserved.''
16%%
17%%     $Id: core_parse.hrl,v 1.1 2008/12/17 09:53:42 mikpe Exp $
18%%
19%% Purpose : Core Erlang syntax trees as records.
20
21%% It would be nice to incorporate some generic functions as well but
22%% this could make including this file difficult.
23
24%% Note: the annotation list is *always* the first record field.
25%% Thus it is possible to define the macros:
26%% -define(get_ann(X), element(2, X)).
27%% -define(set_ann(X, Y), setelement(2, X, Y)).
28
29-record(c_int, {anno=[], val}).		% val :: integer()
30
31-record(c_float, {anno=[], val}).	% val :: float()
32
33-record(c_atom, {anno=[], val}).	% val :: atom()
34
35-record(c_char, {anno=[], val}).	% val :: char()
36
37-record(c_string, {anno=[], val}).	% val :: string()
38
39-record(c_nil, {anno=[]}).
40
41-record(c_binary, {anno=[], segments}).	% segments :: [#ce_bitstr{}]
42
43-record(c_bitstr, {anno=[],val,	% val :: Tree,
44		   size,		% size :: Tree,
45		   unit,		% unit :: integer(),
46		   type,		% type :: atom(),
47		   flags}).		% flags :: [atom()],
48
49-record(c_cons, {anno=[], hd,		% hd :: Tree,
50		 tl}).			% tl :: Tree
51
52-record(c_tuple, {anno=[], es}).	% es :: [Tree]
53
54-record(c_var, {anno=[], name}).	% name :: integer() | atom()
55
56-record(c_fname, {anno=[], id,		% id :: atom(),
57		  arity}).		% arity :: integer()
58
59-record(c_values, {anno=[], es}).	% es :: [Tree]
60
61-record(c_fun, {anno=[], vars,		% vars :: [Tree],
62		body}).			% body :: Tree
63
64-record(c_seq, {anno=[], arg,		% arg :: Tree,
65		body}).			% body :: Tree
66
67-record(c_let, {anno=[], vars,		% vars :: [Tree],
68		arg,			% arg :: Tree,
69		body}).			% body :: Tree
70
71-record(c_letrec, {anno=[], defs,	% defs :: [#ce_def{}],
72		   body}).		% body :: Tree
73
74-record(c_def, {anno=[], name,		% name :: Tree,
75		val}).			% val :: Tree,
76
77-record(c_case, {anno=[], arg,		% arg :: Tree,
78		 clauses}).		% clauses :: [Tree]
79
80-record(c_clause, {anno=[], pats,	% pats :: [Tree],
81		   guard,		% guard :: Tree,
82		   body}).		% body :: Tree
83
84-record(c_alias, {anno=[], var,		% var :: Tree,
85		  pat}).		% pat :: Tree
86
87-record(c_receive, {anno=[], clauses,	% clauses :: [Tree],
88		    timeout,		% timeout :: Tree,
89		    action}).		% action :: Tree
90
91-record(c_apply, {anno=[], op,		% op :: Tree,
92		  args}).		% args :: [Tree]
93
94-record(c_call, {anno=[], module,	% module :: Tree,
95		 name,			% name :: Tree,
96		 args}).		% args :: [Tree]
97
98-record(c_primop, {anno=[], name,	% name :: Tree,
99		   args}).		% args :: [Tree]
100
101-record(c_try, {anno=[], arg,		% arg :: Tree,
102		vars,			% vars :: [Tree],
103		body,			% body :: Tree
104		evars,			% evars :: [Tree],
105		handler}).		% handler :: Tree
106
107-record(c_catch, {anno=[], body}).	% body :: Tree
108
109-record(c_module, {anno=[], name,	% name :: Tree,
110		   exports,		% exports :: [Tree],
111		   attrs,		% attrs :: [#ce_def{}],
112		   defs}).		% defs :: [#ce_def{}]
113