atlas  0.6
parsetree.h
Go to the documentation of this file.
1 /*2:*/
2 #line 68 "parsetree.w"
3 #ifndef PARSETREE_H
4 #define PARSETREE_H
5 
6 #include <iostream>
7 #include <memory>
8 #include <string>
9 
10 #include "parse_types.h"
11 #include "parser.tab.h"
12 namespace atlas
13 {
14 namespace interpreter
15 {/*14:*/
16 #line 254 "parsetree.w"
17 void destroy_expr(expr_p e);/*:14*//*25:*/
18 #line 414 "parsetree.w"
19 expr_p make_int_denotation(int val,const YYLTYPE&loc);
20 expr_p make_bool_denotation(bool val,const YYLTYPE&loc);
21 expr_p make_string_denotation(std::string*val_p,const YYLTYPE&loc);/*:25*//*33:*/
22 #line 537 "parsetree.w"
25 expr_p make_break(unsigned n,const YYLTYPE&loc);
26 expr_p make_die(const YYLTYPE&loc);
27 expr_p make_return(expr_p exp,const YYLTYPE&loc);/*:33*//*44:*/
28 #line 696 "parsetree.w"
32 expr_p wrap_list_display(raw_expr_list l,const YYLTYPE&loc);/*:44*//*47:*/
33 #line 735 "parsetree.w"
34 void destroy_exprlist(raw_expr_list l);/*:47*//*58:*/
35 #line 880 "parsetree.w"
37 const YYLTYPE&loc,const YYLTYPE&left,const YYLTYPE&right);
38 expr_p make_application_node(expr_p f,expr_p arg,const YYLTYPE&loc);/*:58*//*63:*/
39 #line 949 "parsetree.w"
41 const YYLTYPE&loc,const YYLTYPE&op_loc);
43 const YYLTYPE&loc,const YYLTYPE&op_loc);/*:63*//*69:*/
44 #line 1022 "parsetree.w"
45 expr_p make_negation(expr_p exp,const YYLTYPE&loc);/*:69*//*76:*/
46 #line 1179 "parsetree.w"
48 (expr_p e,id_type op,int prio,const YYLTYPE&op_loc);
49 raw_form_stack start_unary_formula(id_type op,int prio,const YYLTYPE&op_loc);
51 (raw_form_stack pre,expr_p e,id_type op,int prio,const YYLTYPE&op_loc);
53 void destroy_formula(raw_form_stack s);/*:76*//*83:*/
54 #line 1348 "parsetree.w"
55 raw_patlist make_pattern_node(raw_patlist prev,raw_id_pat&pattern);/*:83*//*85:*/
56 #line 1361 "parsetree.w"
58 void destroy_id_pat(const raw_id_pat&p);
60 #line 1489 "parsetree.w"
64 std::pair<id_pat,expr>zip_decls(raw_let_list decls);/*:94*//*98:*/
65 #line 1569 "parsetree.w"
66 void destroy_letlist(raw_let_list l);/*:98*//*102:*/
67 #line 1618 "parsetree.w"
68 void destroy_type(type_p t);
69 void destroy_type_list(raw_type_list t);/*:102*//*109:*/
70 #line 1670 "parsetree.w"
72 const YYLTYPE&loc);/*:109*//*120:*/
73 #line 1789 "parsetree.w"
74 expr_p make_conditional_node(expr_p c,expr_p t,expr_p e,const YYLTYPE&loc);/*:120*//*127:*/
75 #line 1854 "parsetree.w"
76 expr_p make_int_case_node(expr_p selector,raw_expr_list ins,const YYLTYPE&loc);/*:127*//*138:*/
77 #line 1999 "parsetree.w"
78 expr_p make_while_node(expr_p b,unsigned flags,const YYLTYPE&loc);
80 (raw_id_pat&id,expr_p ip,expr_p b,unsigned flags,const YYLTYPE&loc);
82 (id_type id,expr_p count,expr_p bound,expr_p b,unsigned flags,
83 const YYLTYPE&loc);/*:138*//*148:*/
84 #line 2152 "parsetree.w"
86 (expr_p a,expr_p i,bool reversed,const YYLTYPE&loc);
88 (expr_p a,expr_p lower,expr_p upper,unsigned flags,const YYLTYPE&loc);/*:148*//*158:*/
89 #line 2259 "parsetree.w"
90 expr_p make_cast(type_p type,expr_p exp,const YYLTYPE&loc);/*:158*//*168:*/
91 #line 2328 "parsetree.w"
92 expr_p make_op_cast(id_type name,type_p type,const YYLTYPE&loc);/*:168*//*178:*/
93 #line 2409 "parsetree.w"
95 expr_p make_multi_assignment(raw_id_pat&lhs,expr_p rhs,const YYLTYPE&loc);/*:178*//*188:*/
96 #line 2506 "parsetree.w"
99 const YYLTYPE&loc,const YYLTYPE&op_loc);/*:188*//*194:*/
100 #line 2600 "parsetree.w"
102 const YYLTYPE&loc,const YYLTYPE&f_loc);/*:194*//*201:*/
103 #line 2680 "parsetree.w"
105 (expr_p first,expr_p last,unsigned which,const YYLTYPE&loc);/*:201*//*206:*/
106 #line 2734 "parsetree.w"
107 id_type lookup_identifier(const char*);
108 void include_file(int skip_seen);/*:206*//*9:*/
109 #line 175 "parsetree.w"
110 std::ostream&operator<<(std::ostream&out,const source_location&sl);/*:9*//*19:*/
111 #line 333 "parsetree.w"
112 std::ostream&operator<<(std::ostream&out,const expr&e);/*:19*//*51:*/
113 #line 799 "parsetree.w"
114 bool is_empty(const expr&e);/*:51*//*87:*/
115 #line 1387 "parsetree.w"
116 std::ostream&operator<<(std::ostream&out,const id_pat&p);/*:87*/
117 #line 83 "parsetree.w"
118 
119 }
120 }
121 
122 #endif/*:2*/
expr_p make_subscription_node(expr_p a, expr_p i, bool reversed, const YYLTYPE &loc)
Definition: parsetree.cpp:339
char * loc
Definition: common.c:89
raw_form_stack extend_formula(raw_form_stack pre, expr_p ep, id_type op, int prio, const YYLTYPE &op_loc)
Definition: parsetree.cpp:148
void destroy_type_list(raw_type_list t)
Definition: parsetree.cpp:272
expr_p make_comp_upd_ass(expr_p l, id_type op, expr_p r, const YYLTYPE &loc, const YYLTYPE &op_loc)
Definition: parsetree.cpp:393
expr_p make_cast(type_p t, expr_p e, const YYLTYPE &loc)
Definition: parsetree.cpp:353
expr_p make_bool_denotation(bool val, const YYLTYPE &loc)
Definition: parsetree.cpp:36
struct expr * expr_p
Definition: parse_types.h:155
std::ostream & operator<<(std::ostream &out, const raw_type_list &l)
Definition: axis-types.cpp:218
Hash_table::id_type id_type
Definition: parse_types.h:22
uA p
Definition: lists.cpp:26
expr_p make_slice_node(expr_p a, expr_p lower, expr_p upper, unsigned flags, const YYLTYPE &loc)
Definition: parsetree.cpp:346
expr_p make_conditional_node(expr_p c, expr_p t, expr_p e, const YYLTYPE &loc)
Definition: parsetree.cpp:295
expr_p make_applied_identifier(id_type id, const YYLTYPE &loc)
Definition: parsetree.cpp:45
void destroy_pattern(raw_patlist p)
Definition: parsetree.cpp:211
const id_pat & pattern
Definition: axis.cpp:21
expr_p make_assignment(id_type id, expr_p r, const YYLTYPE &loc)
Definition: parsetree.cpp:366
expr_p make_unary_call(id_type name, expr_p a, const YYLTYPE &loc, const YYLTYPE &op_loc)
Definition: parsetree.cpp:120
raw_expr_list make_exprlist_node(expr_p e, raw_expr_list raw)
Definition: parsetree.cpp:71
raw_expr_list reverse_expr_list(raw_expr_list raw)
Definition: parsetree.cpp:77
expr_p make_sequence(expr_p f, expr_p l, unsigned which, const YYLTYPE &loc)
Definition: parsetree.cpp:439
void include_file(int skip_seen)
Definition: parsetree.cpp:449
raw_form_stack start_formula(expr_p e, id_type op, int prio, const YYLTYPE &op_loc)
Definition: parsetree.cpp:134
expr_p make_while_node(expr_p b, unsigned flags, const YYLTYPE &loc)
Definition: parsetree.cpp:313
raw_patlist reverse_patlist(raw_patlist raw)
Definition: parsetree.cpp:219
expr_p make_cfor_node(id_type id, expr_p c, expr_p l, expr_p b, unsigned flags, const YYLTYPE &loc)
Definition: parsetree.cpp:329
expr_p make_let_expr_node(raw_let_list d, expr_p b, const YYLTYPE &loc)
Definition: parsetree.cpp:258
raw_let_list make_let_node(raw_id_pat &pattern, expr_p val)
Definition: parsetree.cpp:225
void destroy_type(type_p t)
Definition: parsetree.cpp:271
void destroy_exprlist(raw_expr_list l)
Definition: parsetree.cpp:85
containers::sl_node< struct id_pat > * raw_patlist
Definition: parse_types.h:49
Definition: parser.tab.h:139
expr_p make_op_cast(id_type name, type_p t, const YYLTYPE &loc)
Definition: parsetree.cpp:360
raw_form_stack start_unary_formula(id_type op, int prio, const YYLTYPE &op_loc)
Definition: parsetree.cpp:141
expr_p make_int_case_node(expr_p s, raw_expr_list i, const YYLTYPE &loc)
Definition: parsetree.cpp:303
containers::sl_node< let_pair > * raw_let_list
Definition: parse_types.h:396
#define out(c)
Definition: cweave.c:205
containers::sl_node< expr > * raw_expr_list
Definition: parse_types.h:40
void destroy_formula(raw_form_stack s)
Definition: parsetree.cpp:205
atlas::containers::sl_node< type_expr > * raw_type_list
Definition: axis-types.h:29
type_expr * type_p
Definition: axis-types.h:23
expr_p make_recfun(id_type f, expr_p d, const YYLTYPE &loc, const YYLTYPE &f_loc)
Definition: parsetree.cpp:420
containers::sl_node< formula_node > * raw_form_stack
Definition: parse_types.h:383
expr_p make_comp_ass(expr_p l, expr_p r, const YYLTYPE &loc)
Definition: parsetree.cpp:378
expr_p make_binary_call(id_type name, expr_p x, expr_p y, const YYLTYPE &loc, const YYLTYPE &op_loc)
Definition: parsetree.cpp:106
bool is_empty(const expr &e)
Definition: parsetree.cpp:825
expr_p make_return(expr_p exp, const YYLTYPE &loc)
Definition: parsetree.cpp:52
expr_p make_string_denotation(std::string *val_p, const YYLTYPE &loc)
Definition: parsetree.cpp:39
expr_p make_dollar(const YYLTYPE &loc)
Definition: parsetree.cpp:48
expr_p make_application_node(expr_p f, raw_expr_list r_args, const YYLTYPE &loc, const YYLTYPE &left, const YYLTYPE &right)
Definition: parsetree.cpp:88
expr_p wrap_list_display(raw_expr_list l, const YYLTYPE &loc)
Definition: parsetree.cpp:82
expr_p wrap_tuple_display(raw_expr_list l, const YYLTYPE &loc)
Definition: parsetree.cpp:80
expr_p make_negation(expr_p e, const YYLTYPE &loc)
Definition: parsetree.cpp:128
char * name
Definition: common.c:103
unsigned long n
Definition: axis.cpp:77
void destroy_id_pat(const raw_id_pat &p)
Definition: parsetree.cpp:214
boolean flags[UCHAR_MAX+1]
Definition: common.c:136
Definition: Atlas.h:38
expr_p make_die(const YYLTYPE &loc)
Definition: parsetree.cpp:54
expr_p make_break(unsigned n, const YYLTYPE &loc)
Definition: parsetree.cpp:50
raw_patlist make_pattern_node(raw_patlist prev, raw_id_pat &pattern)
Definition: parsetree.cpp:208
void destroy_letlist(raw_let_list l)
Definition: parsetree.cpp:268
const expr & e
Definition: axis.cpp:95
Definition: common.h:36
Definition: cweave.c:262
id_type lookup_identifier(const char *name)
Definition: parsetree.cpp:446
void destroy_expr(expr_p p)
Definition: parsetree.cpp:31
expr_p make_int_denotation(int val, const YYLTYPE &loc)
Definition: parsetree.cpp:33
expr_p end_formula(raw_form_stack pre, expr_p ep, const YYLTYPE &loc)
Definition: parsetree.cpp:177
raw_let_list append_let_node(raw_let_list prev, raw_let_list cur)
Definition: parsetree.cpp:231
std::pair< id_pat, expr > zip_decls(raw_let_list d)
Definition: parsetree.cpp:237
expr_p make_for_node(raw_id_pat &id, expr_p ip, expr_p b, unsigned flags, const YYLTYPE &loc)
Definition: parsetree.cpp:320
expr_p make_lambda_node(raw_patlist p, raw_type_list tl, expr_p b, const YYLTYPE &loc)
Definition: parsetree.cpp:274
expr_p make_multi_assignment(raw_id_pat &lhs, expr_p r, const YYLTYPE &loc)
Definition: parsetree.cpp:372