4 #include <ail/types.hpp>
8 namespace variable_type_identifier
30 typedef variable_type_identifier::variable_type variable_type
;
35 std::string
& error_message
;
37 unary_argument(variable
& output
, std::string
& error_message
);
40 struct binary_argument
42 variable
const & other
;
44 std::string
& error_message
;
46 binary_argument(variable
const & other
, variable
& output
, std::string
& error_message
);
54 typedef word signed_integer
;
55 typedef uword unsigned_integer
;
56 typedef double floating_point_value
;
57 typedef std::string string
;
58 typedef std::vector
<variable
> vector
;
59 typedef std::map
<variable
, variable
> map
;
66 variable(variable
const & other
);
69 variable_type
get_type() const;
73 void new_boolean(types::boolean new_boolean
);
74 void new_signed_integer(types::signed_integer new_signed_integer
);
75 void new_unsigned_integer(types::unsigned_integer new_unsigned_integer
);
76 void new_floating_point_value(types::floating_point_value new_floating_point_value
);
77 void new_string(types::string
const & new_string
);
81 bool addition(binary_argument
& argument
) const;
82 bool subtraction(binary_argument
& argument
) const;
83 bool multiplication(binary_argument
& argument
) const;
84 bool division(binary_argument
& argument
) const;
85 bool modulo(binary_argument
& argument
) const;
87 bool negative(unary_argument
& argument
) const;
89 bool less_than(binary_argument
& argument
) const;
90 bool less_than_or_equal(binary_argument
& argument
) const;
91 bool greater_than(binary_argument
& argument
) const;
92 bool greater_than_or_equal(binary_argument
& argument
) const;
93 bool unequal(binary_argument
& argument
) const;
94 bool equal(binary_argument
& argument
) const;
96 bool logical_not(unary_argument
& argument
) const;
98 bool logical_and(binary_argument
& argument
) const;
99 bool logical_or(binary_argument
& argument
) const;
101 bool shift_left(binary_argument
& argument
) const;
102 bool shift_right(binary_argument
& argument
) const;
104 bool binary_and(binary_argument
& argument
) const;
105 bool binary_or(binary_argument
& argument
) const;
106 bool binary_xor(binary_argument
& argument
) const;
108 bool binary_not(unary_argument
& argument
) const;
110 bool operator==(variable
const & other
) const;
111 bool operator!=(variable
const & other
) const;
112 bool operator<(variable
const & other
) const;
117 types::boolean boolean
;
118 types::signed_integer signed_integer
;
119 types::unsigned_integer unsigned_integer
;
120 types::floating_point_value floating_point_value
;
121 types::string
* string
;
122 types::vector
* array
;
124 function
* function_pointer
;
130 bool is_floating_point_operation(binary_argument
& argument
) const;
131 bool is_integer_type() const;
132 bool is_numeric_type() const;
133 bool is_zero() const;
135 types::floating_point_value
get_floating_point_value() const;
136 bool get_string_representation(std::string
& output
) const;
137 bool get_boolean_value(bool & output
) const;
139 bool array_addition(binary_argument
& argument
) const;
140 bool perform_string_conversion(std::string
& output
, bool & error
) const;
141 bool string_addition(binary_argument
& argument
, bool & error
) const;
143 bool array_equality(variable
const & other
) const;
144 bool map_equality(variable
const & other
) const;
146 uword
array_hash(uword previous_hash
) const;
147 uword
map_hash(uword previous_hash
) const;
148 uword
hash(uword previous_hash
= 0) const;
151 std::string
get_type_string(variable_type type
);
152 std::string
get_unary_argument_type_error(std::string
const & operation
, variable_type type
);
153 std::string
get_binary_argument_type_error(std::string
const & operation
, variable_type left
, variable_type right
);