2 #line 37 "axis-types.w" 5 #line 109 "axis-types.w" 8 #line 1211 "axis-types.w" 10 #line 1292 "axis-types.w" 13 #line 1448 "axis-types.w" 15 #line 2304 "axis-types.w" 17 #line 2465 "axis-types.w" 19 #line 40 "axis-types.w" 21 namespace atlas{
namespace interpreter{
22 #line 159 "axis-types.w" 27 #line 177 "axis-types.w" 33 #line 246 "axis-types.w" 40 #line 2504 "axis-types.w" 45 #line 251 "axis-types.w" 48 #line 403 "axis-types.w" 50 #line 313 "axis-types.w" 59 #line 364 "axis-types.w" 66 explicit type_expr(dressed_type_list&&l)noexcept;
70 #ifdef incompletecpp11 87 #line 322 "axis-types.w" 90 #line 698 "axis-types.w" 95 :arg_type(std::move(a)),result_type(std::move(r)){}
96 #ifdef incompletecpp11 115 #line 1257 "axis-types.w" 119 virtual void print(std::ostream&
out)
const=0;
121 static const char*
name();
132 #line 1317 "axis-types.w" 134 {std::vector<shared_value>
val;
143 static const char*
name(){
return "row value";}
151 #line 1357 "axis-types.w" 157 static const char*
name(){
return "tuple value";}
166 #line 1460 "axis-types.w" 175 :next(next),frame(){}
177 shared_value&elem(
size_t i,
size_t j);
179 {
return std::back_inserter(frame);}
180 const shared_context&
tail()
const{
return next;}
181 std::vector<shared_value>::const_iterator
begin()
const 182 {
return frame.begin();}
183 std::vector<shared_value>::const_iterator
end()
const 184 {
return frame.end();}
186 #line 1514 "axis-types.w" 197 virtual void evaluate(
level l)
const=0;
198 virtual void print(std::ostream&
out)
const=0;
201 void eval()
const{evaluate(single_value);}
208 #line 1833 "axis-types.w" 210 {
typedef void(*conv_f)();
221 :type(t),exp(std::move(e)){}
222 virtual void evaluate(
level l)
const;
223 virtual void print(std::ostream&
out)
const;
225 #line 1910 "axis-types.w" 231 const char*s,conv_f c)
234 #line 1967 "axis-types.w" 239 virtual void evaluate(
level l)
const;
240 virtual void print(std::ostream&
out)
const;
242 #line 2315 "axis-types.w" 246 #ifdef incompletecpp11 249 const char*
what()
const throw(){
return message.c_str();}
251 #line 2333 "axis-types.w" 254 #ifdef incompletecpp11 261 #ifdef incompletecpp11 268 #ifdef incompletecpp11 272 #line 2373 "axis-types.w" 279 #ifdef incompletecpp11 283 #line 2392 "axis-types.w" 290 ,actual(std::move(a)),required(std::move(r)){}
291 #ifdef incompletecpp11 294 ,actual(std::move(
e.actual)),required(std::move(
e.required)){}
300 #line 2416 "axis-types.w" 304 :
expr_error(e,
"No common type found"),variants(){}
306 #line 2433 "axis-types.w" 310 :
logic_error(
"Uncaught break from loop"),depth(n){}
311 #ifdef incompletecpp11 315 #line 2449 "axis-types.w" 319 :
logic_error(
"Uncaught return from function"),val(val){}
320 #ifdef incompletecpp11 324 #line 2486 "axis-types.w" 327 #ifdef incompletecpp11 331 #line 259 "axis-types.w" 333 #line 1088 "axis-types.w" 340 #line 1133 "axis-types.w" 359 #line 1565 "axis-types.w" 361 #line 2472 "axis-types.w" 363 #line 192 "axis-types.w" 365 #line 213 "axis-types.w" 369 #line 731 "axis-types.w" 372 #line 785 "axis-types.w" 376 #line 844 "axis-types.w" 389 #line 930 "axis-types.w" 390 type_ptr
mk_type(
const char*s);
392 #line 1185 "axis-types.w" 394 #line 1278 "axis-types.w" 396 #line 1391 "axis-types.w" 399 #line 1540 "axis-types.w" 402 #line 1581 "axis-types.w" 404 #line 1810 "axis-types.w" 409 ,expression_ptr&&d,
const expr&e);
415 #line 2126 "axis-types.w" 417 #line 2244 "axis-types.w" 419 #line 675 "axis-types.w" 424 #line 1103 "axis-types.w" 425 template<
typename T>T&
as_lvalue(T&&rvalue){
return rvalue;}
426 #line 1634 "axis-types.w" 428 {execution_stack.push_back(v);}
431 {execution_stack.push_back(std::move(v));}
432 #line 1648 "axis-types.w" 434 {shared_value arg(std::move(execution_stack.back()));
435 execution_stack.pop_back();
438 #line 1667 "axis-types.w" 441 {std::shared_ptr<const D>p=std::dynamic_pointer_cast<
const D>(
pop_value());
451 {
return std::const_pointer_cast<D>(get<D>());}
452 #line 1698 "axis-types.w" 455 {D*p=
dynamic_cast<D*
>(
v);
463 {
const D*p=
dynamic_cast<const D*
>(
v);
468 #line 1741 "axis-types.w" 471 {std::shared_ptr<const D>p=get<D>();
473 return std::const_pointer_cast<D>(p);
474 return std::shared_ptr<D>(p->clone());
480 return const_cast<value
>(v.get());
482 #line 1761 "axis-types.w" 484 template<
unsigned int>
485 void do_wrap(std::vector<shared_value>::iterator it);
488 template<
unsigned int n>
489 inline void do_wrap(std::vector<shared_value>::iterator it)
491 template<
unsigned int n>
493 {std::shared_ptr<tuple_value>result=std::make_shared<tuple_value>(
n);
494 do_wrap<n>(result->val.end());
497 #line 45 "axis-types.w" Definition: axis-types.h:44
const type_expr rd_type(root_datum_type)
Definition: axis-types.h:353
void push_expanded(expression_base::level l, const shared_value &v)
Definition: axis-types.cpp:447
void eval() const
Definition: axis-types.h:201
value_base()
Definition: axis-types.h:117
void swap(type_expr &t) noexcept
Definition: axis-types.cpp:143
std::shared_ptr< D > get_own()
Definition: axis-types.h:470
type_ptr mk_row_type(type_ptr &&c)
Definition: axis-types.cpp:289
func_type copy() const
Definition: axis-types.h:110
bool specialise(const type_expr &pattern)
Definition: axis-types.cpp:161
volatile std::sig_atomic_t interrupt_flag
Definition: axis-types.cpp:53
const type_expr gen_func_type(mk_type_expr("(*->*)"))
Definition: axis-types.h:339
Definition: axis-types.h:43
bool coerce(const type_expr &from_type, const type_expr &to_type, expression_ptr &e)
Definition: axis-types.cpp:484
bool operator!=(const type_expr &x, const type_expr &y)
Definition: axis-types.h:374
loop_break(int n)
Definition: axis-types.h:309
expression_base * expression
Definition: axis-types.h:205
const conversion_info & type
Definition: axis-types.h:217
std::ostream & operator<<(std::ostream &out, const raw_type_list &l)
Definition: axis-types.cpp:218
Definition: axis-types.h:38
Definition: axis-types.h:42
expression_ptr exp
Definition: axis-types.h:218
const char * what() const
Definition: axis-types.h:249
type_expr() noexcept
Definition: axis-types.h:60
uA p
Definition: lists.cpp:26
Definition: axis-types.h:44
~type_expr() noexcept
Definition: axis-types.h:78
bool can_specialise(const type_expr &pattern) const
Definition: axis-types.cpp:189
type_p make_prim_type(unsigned int p)
Definition: axis-types.cpp:299
error_base(const std::string &s)
Definition: axis-types.h:245
conversion_info(const char *s, conv_f c)
Definition: axis-types.h:213
Definition: axis-types.h:35
std::vector< shared_value > frame
Definition: axis-types.h:170
Definition: axis-types.h:216
Definition: axis-types.h:47
std::vector< shared_value > execution_stack
Definition: axis-types.cpp:49
type_ptr mk_type(const char *s)
Definition: axis-types.cpp:388
const id_pat & pattern
Definition: axis.cpp:21
const type_expr ic_type(inner_class_type)
Definition: axis-types.h:354
std::shared_ptr< tuple_value > own_tuple
Definition: axis-types.h:165
Definition: axis-types.h:307
Definition: axis-types.h:316
Definition: axis-types.h:38
Definition: axis-types.h:116
std::string name
Definition: axis-types.h:212
std::shared_ptr< row_value > own_row
Definition: axis-types.h:150
value_base * value
Definition: axis-types.h:129
Definition: axis-types.h:42
expression_base()
Definition: axis-types.h:190
void coercion(const type_expr &from, const type_expr &to, const char *s, conversion_info::conv_f f)
Definition: axis-types.cpp:470
const type_expr row_of_type(mk_type_expr("[*]"))
Definition: axis-types.h:338
containers::weak_sl_list_const_iterator< type_expr > wtl_const_iterator
Definition: axis-types.h:31
const type_expr * to
Definition: axis-types.h:227
Definition: axis-types.h:152
void do_wrap< 0u >(std::vector< shared_value >::iterator it)
Definition: axis-types.h:487
shared_value pop_value()
Definition: axis-types.h:433
const type_expr Lie_type_type(complex_lie_type_type)
Definition: axis-types.h:352
user_interrupt()
Definition: axis-types.h:326
void set_from(type_expr &&p) noexcept
Definition: axis-types.cpp:108
Definition: axis-types.h:133
Definition: axis-types.h:168
size_t length() const
Definition: axis-types.h:140
Definition: axis-types.h:38
virtual ~value_base()=0
Definition: axis-types.h:127
std::unique_ptr< expression_base > expression_ptr
Definition: axis-types.h:206
raw_type_list make_type_singleton(type_p t)
Definition: axis-types.cpp:316
type_expr arg_type
Definition: axis-types.h:92
std::vector< shared_value >::const_iterator end() const
Definition: axis-types.h:183
const conversion_record * row_coercion(const type_expr &final_type, type_expr &component_type)
Definition: axis-types.cpp:505
virtual value_base * clone() const
Definition: axis-types.h:120
const type_expr param_type(module_parameter_type)
Definition: axis-types.h:357
function_return(shared_value &&val)
Definition: axis-types.h:318
std::shared_ptr< const row_value > shared_row
Definition: axis-types.h:149
Definition: axis-types.h:35
Definition: axis-types.h:35
Definition: axis-types.h:274
bool broader_eq(const type_expr &a, const type_expr &b)
Definition: axis-types.cpp:543
static const char * name()
Definition: axis-types.h:143
balance_error(const expr &e)
Definition: axis-types.h:303
tuple_value(size_t n)
Definition: axis-types.h:153
Definition: axis-types.h:188
type_expr required
Definition: axis-types.h:286
std::back_insert_iterator< std::vector< shared_value > > back_inserter()
Definition: axis-types.h:178
logic_error(const std::string &s)
Definition: axis-types.h:253
Definition: axis-types.h:325
containers::weak_sl_list_iterator< type_expr > wtl_iterator
Definition: axis-types.h:32
std::unique_ptr< func_type > func_type_ptr
Definition: axis-types.h:114
void multi_eval() const
Definition: axis-types.h:202
const type_expr void_type(empty_tuple())
Definition: axis-types.h:335
std::shared_ptr< value_base > own_value
Definition: axis-types.h:131
value uniquify(shared_value &v)
Definition: axis-types.h:477
const type_expr vec_type(vector_type)
Definition: axis-types.h:343
tuple_value(I begin, I end)
Definition: axis-types.h:154
const expr & offender
Definition: axis-types.h:275
Definition: axis-types.h:187
std::vector< shared_value > val
Definition: axis-types.h:134
virtual ~expression_base()
Definition: axis-types.h:195
primitive_tag
Definition: axis-types.h:37
Definition: axis-types.h:51
type_expr & operator=(type_expr &&t) noexcept
Definition: axis-types.cpp:135
const type_expr row_row_of_int_type(mk_type_expr("[[int]]"))
Definition: axis-types.h:349
func_type * func
Definition: axis-types.h:57
Definition: axis-types.h:43
Definition: axis-types.h:226
program_error(const std::string &s)
Definition: axis-types.h:260
func_type * func_type_p
Definition: axis-types.h:113
Definition: axis-types.h:35
Definition: axis-types.h:41
type_ptr mk_prim_type(primitive_tag p)
Definition: axis-types.cpp:283
type_ptr acquire(const type_expr *t)
Definition: axis-types.cpp:55
void(* conv_f)()
Definition: axis-types.h:210
row_value(size_t n)
Definition: axis-types.h:136
Definition: axis-types.h:266
Definition: axis-types.h:91
const type_expr unknown_type
Definition: axis-types.cpp:23
void push_value(const shared_value &v)
Definition: axis-types.h:427
std::shared_ptr< D > non_const_get()
Definition: axis-types.h:450
type_ptr mk_function_type(type_expr &&a, type_expr &&r)
Definition: axis-types.cpp:295
containers::sl_list< type_expr > variants
Definition: axis-types.h:302
type_list & prefix(type_expr &&t, type_list &dst)
Definition: axis-types.cpp:60
type_error(const expr &e, type_expr &&a, type_expr &&r) noexcept
Definition: axis-types.h:288
Definition: axis-types.h:44
const type_expr str_type(string_type)
Definition: axis-types.h:342
Definition: axis-types.h:41
void push_tuple_components()
Definition: axis-types.cpp:426
type_expr actual
Definition: axis-types.h:285
type_list empty_tuple()
Definition: axis-types.cpp:58
containers::simple_list< type_expr > type_list
Definition: axis-types.h:28
D * force(value v)
Definition: axis-types.h:454
std::shared_ptr< const tuple_value > shared_tuple
Definition: axis-types.h:164
#define out(c)
Definition: cweave.c:205
conv_f convert
Definition: axis-types.h:211
Definition: axis-types.h:43
row_value * clone() const
Definition: axis-types.h:141
const type_expr bool_type(boolean_type)
Definition: axis-types.h:337
Definition: axis-types.h:42
const type_expr split_type(split_integer_type)
Definition: axis-types.h:356
unsigned depth
Definition: axis-types.h:308
raw_type_list make_type_list(raw_type_list l, type_p t)
Definition: axis-types.cpp:322
const type_expr param_pol_type(virtual_module_type)
Definition: axis-types.h:358
Definition: sl_list.h:174
containers::sl_list< type_expr > dressed_type_list
Definition: axis-types.h:30
type_p make_tuple_type(raw_type_list l)
Definition: axis-types.cpp:305
atlas::containers::sl_node< type_expr > * raw_type_list
Definition: axis-types.h:29
void reserve(size_t n)
Definition: axis-types.h:176
type_expr * type_p
Definition: axis-types.h:23
Definition: axis-types.h:284
const type_expr row_of_int_type(mk_type_expr("[int]"))
Definition: axis-types.h:346
std::shared_ptr< expression_base > shared_expression
Definition: axis-types.h:207
type_expr copy() const
Definition: axis-types.cpp:74
const char * prim_names[]
Definition: axis-types.cpp:11
static const char * name()
Definition: axis-types.h:157
primitive_tag prim
Definition: axis-types.h:54
const shared_context & tail() const
Definition: axis-types.h:180
type_tag
Definition: axis-types.h:34
virtual void print(std::ostream &out) const =0
type_expr mk_type_expr(const char *s)
Definition: axis-types.cpp:376
const type_expr rat_type(rational_type)
Definition: axis-types.h:341
const type_expr mat_type(matrix_type)
Definition: axis-types.h:345
conversion(const conversion_info &t, expression_ptr e)
Definition: axis-types.h:220
Definition: axis-types.h:42
expression_ptr conform_types(const type_expr &found, type_expr &required, expression_ptr &&d, const expr &e)
Definition: axis-types.cpp:499
std::vector< shared_value >::const_iterator begin() const
Definition: axis-types.h:181
func_type(type_expr &&a, type_expr &&r)
Definition: axis-types.h:94
unsigned int is_close(const type_expr &x, const type_expr &y)
Definition: axis-types.cpp:515
runtime_error(const std::string &s)
Definition: axis-types.h:267
type_expr(primitive_tag p) noexcept
Definition: axis-types.h:61
const type_expr ratvec_type(rational_vector_type)
Definition: axis-types.h:344
const type_expr rf_type(real_form_type)
Definition: axis-types.h:355
tuple_value(const tuple_value &v)
Definition: axis-types.h:159
type_p make_row_type(type_p c)
Definition: axis-types.cpp:302
std::string message
Definition: axis-types.h:244
std::shared_ptr< class evaluation_context > shared_context
Definition: axis-types.h:167
Definition: axis-types.h:209
type_tag kind
Definition: axis-types.h:52
char * name
Definition: common.c:103
Definition: axis-types.h:41
unsigned long n
Definition: axis.cpp:77
shared_context next
Definition: axis-types.h:169
bool operator==(const type_expr &x, const type_expr &y)
Definition: axis-types.cpp:257
simple_list< T, Alloc >::const_iterator end(const simple_list< T, Alloc > &l)
Definition: sl_list.h:650
std::unique_ptr< type_expr > type_ptr
Definition: axis-types.h:26
type_expr result_type
Definition: axis-types.h:92
Definition: axis-types.h:38
void print(char *s,...)
Definition: common.c:861
const type_expr int_int_type(mk_type_expr("(int,int)"))
Definition: axis-types.h:351
void do_wrap(std::vector< shared_value >::iterator it)
Definition: axis-types.h:489
tuple_value * clone() const
Definition: axis-types.h:155
Definition: axis-types.h:301
Definition: axis-types.h:259
expression_ptr exp
Definition: axis-types.h:236
type_ptr mk_tuple_type(type_list &&l)
Definition: axis-types.cpp:292
type_p component_type
Definition: axis-types.h:55
type_p make_function_type(type_p a, type_p r)
Definition: axis-types.cpp:310
Definition: axis-types.h:243
const type_expr * const_type_p
Definition: axis-types.h:25
Definition: sl_list.h:176
type_expr unknown_tuple(size_t n)
Definition: axis-types.cpp:402
Definition: axis-types.h:235
const expr & e
Definition: axis.cpp:95
const type_expr row_of_rat_type(mk_type_expr("[rat]"))
Definition: axis-types.h:347
shared_value val
Definition: axis-types.h:317
const type_expr int_type(integral_type)
Definition: axis-types.h:336
raw_type_list tupple
Definition: axis-types.h:56
evaluation_context(const shared_context &next)
Definition: axis-types.h:174
Definition: parse_types.h:156
const type_expr pair_type(mk_type_expr("(*,*)"))
Definition: axis-types.h:350
void wrap_tuple(size_t n)
Definition: axis-types.cpp:432
void void_eval() const
Definition: axis-types.h:200
level
Definition: axis-types.h:188
const type_expr row_of_vec_type(mk_type_expr("[vec]"))
Definition: axis-types.h:348
T & as_lvalue(T &&rvalue)
Definition: axis-types.h:425
expr_error(const expr &e, const std::string &s)
Definition: axis-types.h:277
Definition: axis-types.h:252
void clear() noexcept
Definition: axis-types.cpp:98
row_value(const row_value &v)
Definition: axis-types.h:145
voiding(expression_ptr e)
Definition: axis-types.h:238
std::shared_ptr< const value_base > shared_value
Definition: axis-types.h:130
Vertex v
Definition: graph.cpp:116
row_value(I begin, I end)
Definition: axis-types.h:137
Definition: axis-types.h:35
conversion_record(const type_expr &from_type, const type_expr &to_type, const char *s, conv_f c)
Definition: axis-types.h:229
type_expr(type_ptr &&c) noexcept
Definition: axis-types.h:63
std::unique_ptr< tuple_value > tuple_ptr
Definition: axis-types.h:163