atlas  0.6
axis.h
Go to the documentation of this file.
1 /*1:*/
2 #line 40 "axis.w"
3 #ifndef EVALUATOR_H
4 #define EVALUATOR_H
5 
6 #include "axis-types.h"/*61:*/
7 #line 1589 "axis.w"
8 #include "global.h" /*:61*/
9 #line 45 "axis.w"
10 
11 namespace atlas{namespace interpreter{/*7:*/
12 #line 211 "axis.w"
13 class layer
14 {
16 public:
17 typedef std::vector<std::pair<id_type,type_expr> >vec;
18 static list lexical_context;
19 private:
21 BitMap constness;
22 const unsigned loop_depth;
24 
25 public:
26 layer(const layer&)=delete;
27 layer&operator=(const layer&)=delete;
28 layer(size_t n);
29 layer(size_t n,type_p return_type);
30 
31 ~layer(){lexical_context.pop_front();}
32 
33 void add(id_type id,type_expr&&t,bool is_const);
34 static const_type_p lookup
35 (id_type id,size_t&depth,size_t&offset,bool&is_const);
36 static void specialise(size_t depth,size_t offset,const type_expr&t);
37 
38 bool empty()const{return variable.empty();}
39 std::pair<id_type,type_expr> &operator[](size_t i)
40 {return variable[i];}
41 vec::iterator begin(){return variable.begin();}
42 vec::iterator end(){return variable.end();}
43 vec::const_iterator cbegin()const{return variable.begin();}
44 vec::const_iterator cend()const{return variable.end();}
45 bool is_const(vec::const_iterator it)const
46 {return constness.isMember(it-cbegin());}
47 static bool may_break(unsigned depth)
48 {return not lexical_context.empty()
49 and lexical_context.front()->loop_depth>depth;}
50 static bool may_return()
51 {return not lexical_context.empty()
52 and lexical_context.front()->return_type!=nullptr;}
54 {return*lexical_context.front()->return_type;}
55 };/*:7*//*14:*/
56 #line 400 "axis.w"
59 
60 explicit denotation(const shared_value&v):denoted_value(v){}
61 explicit denotation(shared_value&&v):denoted_value(std::move(v)){}
62 virtual void evaluate(level l)const{push_expanded(l,denoted_value);}
63 virtual void print(std::ostream&out)const
64 {denoted_value->print(out);}
65 };/*:14*//*18:*/
66 #line 465 "axis.w"
69 public:
71 :denotation(v),print_name(name){}
72 virtual void print(std::ostream&out)const{out<<print_name;}
73 };/*:18*//*20:*/
74 #line 505 "axis.w"
75 struct shell:public expression_base
76 {
77 virtual void evaluate(level l)const;
78 virtual void print(std::ostream&out)const{out<<" die ";}
79 };/*:20*//*23:*/
80 #line 530 "axis.w"
81 struct breaker:public expression_base
82 {unsigned depth;
83 breaker(unsigned depth):depth(depth){}
84 virtual void evaluate(level l)const;
85 virtual void print(std::ostream&out)const
86 {out<<" break ";
87 if(depth>0)
88 out<<depth<<' ';
89 }
90 };/*:23*//*26:*/
91 #line 564 "axis.w"
94 returner(expression_ptr&&exp):exp(std::move(exp)){}
95 virtual void evaluate(level l)const;
96 virtual void print(std::ostream&out)const
97 {out<<" return "<< *exp;}
98 };/*:26*//*29:*/
99 #line 610 "axis.w"
101 {std::vector<expression_ptr>component;
102 
103 #ifdef incompletecpp11
104 explicit tuple_expression(size_t n):component()
105 
106 {component.reserve(n);
107 while(n-- >0)
108 component.push_back(expression_ptr());
109 }
110 #else
111 explicit tuple_expression(size_t n):component(n){}
112 #endif
113 
114 virtual void evaluate(level l)const;
115 virtual void print(std::ostream&out)const;
116 };/*:29*//*33:*/
117 #line 748 "axis.w"
119 {explicit list_expression(size_t n):tuple_expression(n){}
120 virtual void evaluate(level l)const;
121 virtual void print(std::ostream&out)const;
122 };/*:33*//*42:*/
123 #line 1029 "axis.w"
124 #ifdef incompletecpp11
125 #define nothing_new_here {}
126 #else
127 #define nothing_new_here =default
128 #endif
129 
132 
133 explicit identifier(id_type id):code(id){}
135 const char*name()const;
136 virtual void print(std::ostream&out)const;
137 };/*:42*//*44:*/
138 #line 1067 "axis.w"
141 public:
142 explicit global_identifier(id_type id);
144 virtual void evaluate(level l)const;
145 };/*:44*//*48:*/
146 #line 1141 "axis.w"
148 {size_t depth,offset;
149 public:
150 explicit local_identifier(id_type id,size_t i,size_t j)
151 :identifier(id),depth(i),offset(j){}
152 virtual void evaluate(level l)const;
153 };/*:48*//*57:*/
154 #line 1502 "axis.w"
158 
160 :expression_base(),argument(arg.release()),loc(loc){}
161 virtual~call_base()nothing_new_here;
162 virtual std::string function_name()const=0;
163 };/*:57*//*58:*/
164 #line 1525 "axis.w"
165 
166 
167 
169 {
172 virtual void apply(expression_base::level l)const=0;
173 
174 virtual expression_base::level argument_policy()const=0;
175 
176 virtual void report_origin(std::ostream&o)const=0;
177 
178 virtual expression_ptr build_call
179 (const shared_function&owner,const std::string&name,
180 expression_ptr&&arg,const source_location&loc)const=0;
181 };/*:58*//*59:*/
182 #line 1553 "axis.w"
184 {expression_ptr function;
185 
188 :call_base(std::move(a),loc),function(f.release()){}
190 virtual void evaluate(level l)const;
191 virtual void print(std::ostream&out)const;
193 
194 {std::ostringstream o;o<< *function;return o.str();}
195 
196 };/*:59*//*62:*/
197 #line 1612 "axis.w"
198 template<bool variadic>
202 
204 :function_base(),val(v),print_name(n){}
206 virtual void print(std::ostream&out)const
207 {out<<'{'<<print_name<<'}';}
208 virtual void apply(expression_base::level l)const
209 {(*val)(l);}
211 {return variadic
213 virtual void report_origin(std::ostream&o)const
214 {o<<"built-in";}
215 virtual expression_ptr build_call
216 (const shared_function&owner,const std::string&name,
217 expression_ptr&&arg,const source_location&loc)const;
218 
219 virtual builtin_value*clone()const{return new builtin_value(*this);}
220 static const char*name(){return "built-in function";}
221 private:
222 builtin_value(const builtin_value&v)=default;
223 };
224 typedef std::shared_ptr<const builtin_value<false> >shared_builtin;
225 typedef std::shared_ptr<const builtin_value<true> >shared_variadic_builtin;/*:62*//*63:*/
226 #line 1652 "axis.w"
229 
231 (const std::string&name,
232 expression_ptr&&arg,
233 const source_location&loc)
234 :call_base(std::move(arg),loc),name(name){}
236 virtual std::string function_name()const{return name;}
237 virtual void print(std::ostream&out)const;
238 };/*:63*//*65:*/
239 #line 1693 "axis.w"
240 template<bool variadic>
242 {typedef std::shared_ptr<const builtin_value<variadic> >ptr_to_builtin;
243 
244 ptr_to_builtin f;
245 
247 
249 (const ptr_to_builtin&fun,
250 const std::string&name,
251 expression_ptr&&arg,
252 const source_location&loc)
253 :overloaded_call(name,std::move(arg),loc),f(fun),f_ptr(fun->val){}
255 (const ptr_to_builtin&fun,
256 expression_ptr&&arg,
257 const source_location&loc)
258 :overloaded_call(fun->print_name,std::move(arg),loc)
259 ,f(fun),f_ptr(fun->val){}
261 virtual void evaluate(level l)const;
262 };
263 
266 #line 2214 "axis.w"
270 
273 virtual void evaluate(level l)const;
274 virtual void print(std::ostream&out)const;
275 };/*:81*//*94:*/
276 #line 2492 "axis.w"
280 (id_pat&&param,expression_ptr&&body,const source_location&loc)
281 :param(std::move(param)),body(std::move(body)),loc(loc){}
282 };
283 typedef std::shared_ptr<lambda_struct>shared_lambda;
284 
286 {shared_lambda p;
287 
289 (const id_pat&p,expression_ptr&&b,const source_location&loc);
291 
292 virtual void evaluate(level l)const;
293 virtual void print(std::ostream&out)const;
294 };/*:94*//*98:*/
295 #line 2636 "axis.w"
298 shared_lambda p;
300 
301 closure_value(const shared_context&c,const shared_lambda&l)
302 :function_base(),context(c),p(l),body(*p->body){}
304 virtual void print(std::ostream&out)const;
305 virtual void apply(expression_base::level l)const;
308 virtual void report_origin(std::ostream&o)const
309 {o<<"defined "<<p->loc;}
310 virtual expression_ptr build_call
311 (const shared_function&owner,const std::string&name,
312 expression_ptr&&arg,const source_location&loc)const;
313 
314 virtual closure_value*clone()const
315 {return new closure_value(context,p);}
316 static const char*name(){return "closure";}
317 };
318 typedef std::unique_ptr<closure_value>closure_ptr;
319 typedef std::shared_ptr<const closure_value>shared_closure;/*:98*//*103:*/
320 #line 2789 "axis.w"
322 {shared_closure f;
323 
325 (shared_closure f,const std::string&n,expression_ptr&&a
326 ,const source_location&loc)
327 :overloaded_call(n,std::move(a),loc),f(f){}
329 virtual void evaluate(level l)const;
330 };/*:103*//*108:*/
331 #line 2935 "axis.w"
334 
336 :first(f.release()),last(l.release()){}
338 virtual void evaluate(level l)const;
339 virtual void print(std::ostream&out)const;
340 };
341 
344 
346 :first(f.release()),last(l.release()){}
348 virtual void evaluate(level l)const;
349 virtual void print(std::ostream&out)const;
350 };/*:108*//*113:*/
351 #line 3022 "axis.w"
353 {enum sub_type
354 {row_entry,vector_entry,ratvec_entry,string_char
355 ,matrix_entry,matrix_column,mod_poly_term,not_so};
357 
359 :array(a.release())
360 ,index(i.release())
361 {}
363 
364 void print(std::ostream&out,bool reversed)const;
365 static sub_type index_kind
366 (const type_expr&aggr,
367 const type_expr&index,
368 type_expr&subscr);
369 static sub_type slice_kind(const type_expr&aggr);
370 static bool assignable(sub_type);
371 };
372 
374 {expression_ptr array,lower,upper;
375 
377 :array(a.release())
378 ,lower(l.release())
379 ,upper(u.release())
380 {}
382 
383 void print(std::ostream&out,unsigned flags)const;
384 };/*:113*//*114:*/
385 #line 3061 "axis.w"
386 template<bool reversed>
389 :subscr_base(std::move(a),std::move(i)){}
390 virtual void evaluate(level l)const;
391 virtual void print(std::ostream&out)const
392 {subscr_base::print(out,reversed);}
393 };
394 
395 
396 template<bool reversed>
399 :subscr_base(std::move(a),std::move(i)){}
400 virtual void evaluate(level l)const;
401 virtual void print(std::ostream&out)const
402 {subscr_base::print(out,reversed);}
403 };
404 
405 template<bool reversed>
408 :subscr_base(std::move(a),std::move(i)){}
409 virtual void evaluate(level l)const;
410 virtual void print(std::ostream&out)const
411 {subscr_base::print(out,reversed);}
412 };
413 
414 template<bool reversed>
417 :subscr_base(std::move(a),std::move(i)){}
418 virtual void evaluate(level l)const;
419 virtual void print(std::ostream&out)const
420 {subscr_base::print(out,reversed);}
421 };
422 
423 template<bool reversed>
426 :subscr_base(std::move(a),std::move(ij)){}
427 virtual void evaluate(level l)const;
428 virtual void print(std::ostream&out)const;
429 };
430 
431 template<bool reversed>
434 :subscr_base(std::move(a),std::move(j)){}
435 virtual void evaluate(level l)const;
436 virtual void print(std::ostream&out)const
437 {subscr_base::print(out,reversed);}
438 };
439 
442 :subscr_base(std::move(pol),std::move(param)){}
443 virtual void evaluate(level l)const;
444 virtual void print(std::ostream&out)const
445 {out<< *array<<'['<<']';}
446 };/*:114*//*115:*/
447 #line 3130 "axis.w"
448 template<unsigned flags>
449 struct row_slice:public slice_base
451 :slice_base(std::move(a),std::move(l),std::move(u)){}
452 virtual void evaluate(level l)const;
453 virtual void print(std::ostream&out)const
454 {slice_base::print(out,flags);}
455 };
456 
457 
458 template<unsigned flags>
461 :slice_base(std::move(a),std::move(l),std::move(u)){}
462 virtual void evaluate(level l)const;
463 virtual void print(std::ostream&out)const
464 {slice_base::print(out,flags);}
465 };
466 
467 template<unsigned flags>
470 :slice_base(std::move(a),std::move(l),std::move(u)){}
471 virtual void evaluate(level l)const;
472 virtual void print(std::ostream&out)const
473 {slice_base::print(out,flags);}
474 };
475 
476 template<unsigned flags>
479 :slice_base(std::move(a),std::move(l),std::move(u)){}
480 virtual void evaluate(level l)const;
481 virtual void print(std::ostream&out)const
482 {slice_base::print(out,flags);}
483 };
484 
485 template<unsigned flags>
488 :slice_base(std::move(a),std::move(l),std::move(u)){}
489 virtual void evaluate(level l)const;
490 virtual void print(std::ostream&out)const
491 {slice_base::print(out,flags);}
492 };/*:115*//*130:*/
493 #line 3709 "axis.w"
496 unsigned position;
499 
501 (const type_expr&t,unsigned i,id_type id,const source_location&loc)
502 :type(t.copy()),position(i),id(id),loc(loc){}
504 virtual void print(std::ostream&out)const;
505 virtual void apply(expression_base::level l)const;
506 virtual expression_base::level argument_policy()const;
507 virtual void report_origin(std::ostream&o)const;
508 virtual expression_ptr build_call
509 (const shared_function&owner,const std::string&name,
510 expression_ptr&&arg,const source_location&loc)const;
511 
512 virtual projector_value*clone()const
513 {return new projector_value(*this);}
514 static const char*name(){return "built-in function";}
515 private:
517 :type(v.type.copy()),position(v.position),loc(v.loc){}
518 };/*:130*//*133:*/
519 #line 3760 "axis.w"
521 {unsigned position;id_type id;
522 
525 ,const source_location&loc)
526 :overloaded_call(n,std::move(a),loc),position(f.position),id(f.id){}
528 virtual void evaluate(level l)const;
529 virtual void print(std::ostream&out)const;
530 };/*:133*//*139:*/
531 #line 3901 "axis.w"
533 {expression_ptr condition,then_branch,else_branch;
534 
537 :condition(c.release()),then_branch(t.release()),else_branch(e.release())
538 {}
540 virtual void evaluate(level l)const;
541 virtual void print(std::ostream&out)const;
542 };/*:139*//*143:*/
543 #line 3970 "axis.w"
545 {expression_ptr condition;std::vector<expression_ptr>branches;
546 
548 (expression_ptr&&c,std::vector<expression_ptr> &&b)
549 :condition(c.release()),branches(std::move(b))
550 {}
552 virtual void evaluate(level l)const;
553 virtual void print(std::ostream&out)const;
554 };/*:143*//*148:*/
555 #line 4055 "axis.w"
556 template<unsigned flags>
559 while_expression(expression_ptr&&b):body(std::move(b)){}
561 virtual void evaluate(level l)const;
562 virtual void print(std::ostream&out)const;
563 };/*:148*//*154:*/
564 #line 4161 "axis.w"
565 template<bool negated>
568 
570 :condition(c.release()),body(b.release()){}
572 virtual void evaluate(level l)const;
573 virtual void print(std::ostream&out)const;
574 };/*:154*//*155:*/
575 #line 4179 "axis.w"
578 
579 forever_expression(expression_ptr&&b):body(b.release()){}
581 virtual void evaluate(level l)const;
582 virtual void print(std::ostream&out)const;
583 };
587 virtual void evaluate(level l)const;
588 virtual void print(std::ostream&out)const;
589 };/*:155*//*161:*/
590 #line 4398 "axis.w"
591 template<unsigned flags,subscr_base::sub_type kind>
595 
598 virtual void evaluate(level l)const;
599 virtual void print(std::ostream&out)const;
600 };/*:161*//*174:*/
601 #line 4850 "axis.w"
602 template<unsigned flags>
606 
607 
610 expression_ptr&&b)
611 :id(i),count(cnt.release()),bound(bnd.release()),body(b.release())
612 {}
614 virtual void evaluate(level l)const;
615 virtual void print(std::ostream&out)const;
616 };/*:174*//*188:*/
617 #line 5310 "axis.w"
621 
623 :lhs(l),rhs(r.release()){}
625 virtual void print(std::ostream&out)const;
626 };/*:188*//*190:*/
627 #line 5330 "axis.w"
630 public:
633 virtual void evaluate(level l)const;
634 };/*:190*//*193:*/
635 #line 5364 "axis.w"
637 {size_t depth,offset;
638 public:
639 local_assignment(id_type l,size_t i,size_t j,expression_ptr&&r);
641 virtual void evaluate(level l)const;
642 };/*:193*//*196:*/
643 #line 5405 "axis.w"
645 {
646 public:
647 struct local_dest{size_t depth,offset;};
650 private:
653 loc_list locals;
654 glob_list globals;
655 BitMap is_global;
656 public:
658 (const id_pat&lhs,expression_ptr&&r
659 ,loc_list&&ll,glob_list&&gl,BitMap&&bm);
661 virtual void print(std::ostream&out)const;
662 virtual void evaluate(level l)const;
663 };/*:196*//*212:*/
664 #line 5792 "axis.w"
665 template<bool reversed>
668 
671 :assignment_expr(a,std::move(r)),index(i.release()){}
673 
674 virtual void print(std::ostream&out)const;
675 
676 void assign(level l,shared_value&aggregate,subscr_base::sub_type kind)const;
677 };/*:212*//*214:*/
678 #line 5818 "axis.w"
679 template<bool reversed>
682 
685 public:
689 virtual void evaluate(expression_base::level l)const;
690 };/*:214*//*222:*/
691 #line 5981 "axis.w"
692 template<bool reversed>
695 
697 size_t depth,offset;
698 public:
700 (id_type arr,expression_ptr&&i,size_t d,size_t o,
702 virtual void evaluate(expression_base::level l)const;
703 };/*:222*//*16:*/
704 #line 445 "axis.w"
705 extern type_expr last_type;
706 extern shared_value last_value;/*:16*//*3:*/
707 #line 75 "axis.w"
708 void reset_evaluator();/*:3*//*6:*/
709 #line 179 "axis.w"
710 expression_ptr convert_expr(const expr&e,type_expr&type);/*:6*//*51:*/
711 #line 1230 "axis.w"
713 (const expr&e,
714 type_expr&type,
715 const overload_table::variant_list&variants);/*:51*//*84:*/
716 #line 2253 "axis.w"
717 type_expr pattern_type(const id_pat&pat);
718 size_t count_identifiers(const id_pat&pat);
719 void list_identifiers(const id_pat&pat,std::vector<id_type> &d);
720 void thread_bindings
721 (const id_pat&pat,const type_expr&type,layer&dst,bool is_const);
723 (const id_pat&pat,const shared_value&val,
724 std::back_insert_iterator<std::vector<shared_value> >dst);/*:84*/
725 #line 49 "axis.w"
726 
727 }}
728 #endif/*:1*/
function_base()
Definition: axis.h:170
Definition: axis.h:486
id_type id
Definition: axis.h:497
void push_expanded(expression_base::level l, const shared_value &v)
Definition: axis-types.cpp:447
expression_ptr rhs
Definition: axis.h:620
virtual expression_base::level argument_policy() const
Definition: axis.h:306
char * loc
Definition: common.c:89
virtual void print(std::ostream &out) const
Definition: axis.h:436
virtual void print(std::ostream &out) const
Definition: axis.h:472
shared_closure f
Definition: axis.h:322
expression_ptr condition
Definition: axis.h:545
virtual void apply(expression_base::level l) const
Definition: axis.h:208
std::shared_ptr< lambda_struct > shared_lambda
Definition: axis.h:283
size_t offset
Definition: axis.h:148
tuple_expression(size_t n)
Definition: axis.h:111
row_slice(expression_ptr &&a, expression_ptr &&l, expression_ptr &&u)
Definition: axis.h:450
overloaded_builtin_call< true > variadic_builtin_call
Definition: axis.h:265
virtual void print(std::ostream &out) const
Definition: axis.h:401
shared_lambda p
Definition: axis.h:298
std::vector< overload_data > variant_list
Definition: global.h:122
virtual closure_value * clone() const
Definition: axis.h:314
containers::simple_list< layer * > list
Definition: axis.h:15
void thread_components(const id_pat &pat, const shared_value &val, std::back_insert_iterator< std::vector< shared_value > >dst)
Definition: axis.cpp:1864
void add(id_type id, type_expr &&t, bool is_const)
Definition: axis.cpp:654
Hash_table::id_type id_type
Definition: parse_types.h:22
const unsigned loop_depth
Definition: axis.h:22
id_pat pattern
Definition: axis.h:593
std::string print_name
Definition: axis.h:68
ratvec_subscription(expression_ptr &&a, expression_ptr &&i)
Definition: axis.h:407
layer & operator=(const layer &)=delete
uA p
Definition: lists.cpp:26
virtual void print(std::ostream &out) const
Definition: axis.h:444
shared_share address
Definition: axis.h:684
virtual void print(std::ostream &out) const
Definition: axis.h:410
subscr_base::sub_type kind
Definition: axis.h:696
#define nothing_new_here
Definition: axis.h:127
expression_ptr resolve_overload(const expr &e, type_expr &type, const overload_table::variant_list &variants)
Definition: axis.cpp:1516
bool empty() const
Definition: sl_list.h:468
Definition: axis.h:130
Definition: axis.h:468
virtual expression_base::level argument_policy() const
Definition: axis.h:210
ratvec_slice(expression_ptr &&a, expression_ptr &&l, expression_ptr &&u)
Definition: axis.h:469
id_type lhs
Definition: axis.h:619
glob_list globals
Definition: axis.h:654
Definition: axis.h:352
std::shared_ptr< const closure_value > shared_closure
Definition: axis.h:319
std::string print_name
Definition: axis.h:201
Definition: axis-types.h:116
Definition: axis.h:277
const expression_base & body
Definition: axis.h:299
loc_list locals
Definition: axis.h:653
static bool may_break(unsigned depth)
Definition: axis.h:47
matrix_slice(expression_ptr &&a, expression_ptr &&l, expression_ptr &&u)
Definition: axis.h:487
~layer()
Definition: axis.h:31
expression_ptr index
Definition: axis.h:356
local_identifier(id_type id, size_t i, size_t j)
Definition: axis.h:150
std::unique_ptr< expression_base > expression_ptr
Definition: axis-types.h:206
slice_base(expression_ptr &&a, expression_ptr &&l, expression_ptr &&u)
Definition: axis.h:376
virtual void evaluate(level l) const
Definition: axis.h:62
virtual void print(std::ostream &out) const
Definition: axis.h:463
virtual void print(std::ostream &out) const
Definition: axis.h:419
containers::simple_list< local_dest > loc_list
Definition: axis.h:648
row_subscription(expression_ptr &&a, expression_ptr &&i)
Definition: axis.h:388
static list lexical_context
Definition: axis.h:18
std::unique_ptr< closure_value > closure_ptr
Definition: axis.h:318
Definition: axis.h:75
vector_slice(expression_ptr &&a, expression_ptr &&l, expression_ptr &&u)
Definition: axis.h:460
virtual std::string function_name() const
Definition: axis.h:236
BitMap is_global
Definition: axis.h:655
expression_ptr convert_expr(const expr &e, type_expr &type)
Definition: axis.cpp:691
returner(expression_ptr &&exp)
Definition: axis.h:94
expression_ptr body
Definition: axis.h:558
shared_value denoted_value
Definition: axis.h:58
id_pat lhs
Definition: axis.h:651
void print(std::ostream &out, unsigned flags) const
Definition: axis.cpp:2045
void reset_evaluator()
Definition: axis.cpp:624
assignment_expr(id_type l, expression_ptr &&r)
Definition: axis.h:622
virtual void print(std::ostream &out) const
Definition: axis.h:63
void thread_bindings(const id_pat &pat, const type_expr &type, layer &dst, bool is_const)
Definition: axis.cpp:1851
overloaded_builtin_call< false > builtin_call
Definition: axis.h:264
expression_ptr initialiser
Definition: axis.h:269
const shared_share address
Definition: axis.h:140
Definition: parse_types.h:26
type_expr last_type
Definition: axis.cpp:13
subscr_base(expression_ptr &&a, expression_ptr &&i)
Definition: axis.h:358
const type_p return_type
Definition: axis.h:23
Definition: axis-types.h:187
Definition: axis-types.h:51
Definition: axis.h:81
id_type code
Definition: axis.h:131
string_slice(expression_ptr &&a, expression_ptr &&l, expression_ptr &&u)
Definition: axis.h:478
closure_value(const shared_context &c, const shared_lambda &l)
Definition: axis.h:301
expression_ptr exp
Definition: axis.h:93
call_base(expression_ptr &&arg, const source_location &loc)
Definition: axis.h:159
static type_expr & current_return_type()
Definition: axis.h:53
vec::iterator begin()
Definition: axis.h:41
virtual void print(std::ostream &out) const
Definition: axis.h:490
Definition: axis.h:92
vector_subscription(expression_ptr &&a, expression_ptr &&i)
Definition: axis.h:398
id_pat param
Definition: axis.h:278
containers::simple_list< shared_share > glob_list
Definition: axis.h:649
unsigned position
Definition: axis.h:496
Definition: axis.h:296
ptr_to_builtin f
Definition: axis.h:244
void pop_front()
Definition: sl_list.h:439
layer(const layer &)=delete
Definition: axis.h:155
virtual void print(std::ostream &out) const
Definition: axis.h:96
component_assignment< reversed > base
Definition: axis.h:694
size_t count_identifiers(const id_pat &pat)
Definition: axis.cpp:1834
virtual void print(std::ostream &out) const
Definition: axis.h:391
unsigned depth
Definition: axis.h:82
expression_ptr last
Definition: axis.h:333
Definition: axis.h:57
next_expression(expression_ptr &&f, expression_ptr &&l)
Definition: axis.h:345
Definition: axis.h:13
expression_ptr condition
Definition: axis.h:567
static void specialise(size_t depth, size_t offset, const type_expr &t)
Definition: axis.cpp:684
unsigned position
Definition: axis.h:521
std::shared_ptr< const builtin_value< variadic > > ptr_to_builtin
Definition: axis.h:242
expression_ptr rhs
Definition: axis.h:652
while_expression(expression_ptr &&b)
Definition: axis.h:559
Definition: sl_list.h:28
shared_share address
Definition: axis.h:629
type_expr pattern_type(const id_pat &pat)
Definition: axis.cpp:1828
Definition: axis.h:321
BitMap constness
Definition: axis.h:21
#define out(c)
Definition: cweave.c:205
Definition: axis.h:566
expression_ptr body
Definition: axis.h:577
Definition: axis.h:199
wrapper_function val
Definition: axis.h:200
void(* wrapper_function)(expression_base::level)
Definition: global.h:262
dont_expression()
Definition: axis.h:585
static const char * name()
Definition: axis.h:220
Definition: axis.h:477
identifier(id_type id)
Definition: axis.h:133
type_expr copy() const
Definition: axis-types.cpp:74
virtual void print(std::ostream &out) const
Definition: axis.h:206
static const_type_p lookup(id_type id, size_t &depth, size_t &offset, bool &is_const)
Definition: axis.cpp:667
matrix_get_column(expression_ptr &&a, expression_ptr &&j)
Definition: axis.h:433
denotation(shared_value &&v)
Definition: axis.h:61
virtual projector_value * clone() const
Definition: axis.h:512
std::vector< std::pair< id_type, type_expr > > vec
Definition: axis.h:17
expression_ptr body
Definition: axis.h:594
std::shared_ptr< const builtin_value< false > > shared_builtin
Definition: axis.h:224
type_expr type
Definition: axis.h:495
Definition: axis.h:168
bool empty() const
Definition: axis.h:38
virtual std::string function_name() const
Definition: axis.h:192
virtual void print(std::ostream &out) const
Definition: axis.h:453
builtin_value(wrapper_function v, const std::string &n)
Definition: axis.h:203
breaker(unsigned depth)
Definition: axis.h:83
wrapper_function f_ptr
Definition: axis.h:246
vec variable
Definition: axis.h:20
static const char * name()
Definition: axis.h:514
source_location loc
Definition: axis.h:157
expression_ptr count
Definition: axis.h:605
bool is_const(vec::const_iterator it) const
Definition: axis.h:45
source_location loc
Definition: axis.h:498
std::shared_ptr< class evaluation_context > shared_context
Definition: axis-types.h:167
std::pair< id_type, type_expr > & operator[](size_t i)
Definition: axis.h:39
char * name
Definition: common.c:103
const id_pat variable
Definition: axis.h:268
seq_expression(expression_ptr &&f, expression_ptr &&l)
Definition: axis.h:335
unsigned long n
Definition: axis.cpp:77
module_coefficient(expression_ptr &&pol, expression_ptr &&param)
Definition: axis.h:441
vec::const_iterator cbegin() const
Definition: axis.h:43
forever_expression(expression_ptr &&b)
Definition: axis.h:579
virtual void print(std::ostream &out) const
Definition: axis.h:78
boolean flags[UCHAR_MAX+1]
Definition: common.c:136
Definition: Atlas.h:38
void print(char *s,...)
Definition: common.c:861
expression_ptr upper
Definition: axis.h:374
component_assignment< reversed > base
Definition: axis.h:681
expression_ptr argument
Definition: axis.h:156
denotation(const shared_value &v)
Definition: axis.h:60
std::string name
Definition: axis.h:228
std::shared_ptr< const builtin_value< true > > shared_variadic_builtin
Definition: axis.h:225
virtual void report_origin(std::ostream &o) const
Definition: axis.h:308
Definition: axis.h:449
sub_type
Definition: axis.h:353
virtual builtin_value * clone() const
Definition: axis.h:219
Definition: axis.h:373
static const char * name()
Definition: axis.h:316
virtual void print(std::ostream &out) const
Definition: axis.h:72
Definition: parse_types.h:57
const expr & e
Definition: axis.cpp:95
Definition: common.h:36
T & front()
Definition: sl_list.h:438
matrix_subscription(expression_ptr &&a, expression_ptr &&ij)
Definition: axis.h:425
Definition: cweave.c:262
static bool may_return()
Definition: axis.h:50
virtual void print(std::ostream &out) const
Definition: axis.h:85
Definition: parse_types.h:156
std::vector< expression_ptr > component
Definition: axis.h:101
vec::iterator end()
Definition: axis.h:42
expression_ptr index
Definition: axis.h:667
virtual void report_origin(std::ostream &o) const
Definition: axis.h:213
projector_value(const projector_value &v)
Definition: axis.h:516
do_expression(expression_ptr &&c, expression_ptr &&b)
Definition: axis.h:569
size_t offset
Definition: axis.h:637
void list_identifiers(const id_pat &pat, std::vector< id_type > &d)
Definition: axis.cpp:1842
virtual void print(std::ostream &out) const
Definition: axis.h:481
expression_ptr last
Definition: axis.h:343
list_expression(size_t n)
Definition: axis.h:119
level
Definition: axis-types.h:188
std::shared_ptr< shared_value > shared_share
Definition: global.h:22
unsigned int depth
Definition: output.cpp:74
id_type id
Definition: axis.h:604
void print(std::ostream &out, bool reversed) const
Definition: axis.cpp:2032
shared_context context
Definition: axis.h:297
shared_value last_value
Definition: axis.cpp:14
capture_expression(const shared_value &v, const std::string &name)
Definition: axis.h:70
vec::const_iterator cend() const
Definition: axis.h:44
std::shared_ptr< const value_base > shared_value
Definition: axis-types.h:130
string_subscription(expression_ptr &&a, expression_ptr &&i)
Definition: axis.h:416
std::shared_ptr< const function_base > shared_function
Definition: global.h:80
expression_ptr then_branch
Definition: axis.h:533
shared_lambda p
Definition: axis.h:286
Vertex v
Definition: graph.cpp:116
subscr_base::sub_type kind
Definition: axis.h:683
Definition: axis.h:459