xo-reader2: + op>= support
This commit is contained in:
parent
6b46975642
commit
a68aaf41ec
35 changed files with 143 additions and 43 deletions
|
|
@ -36,6 +36,8 @@ namespace xo {
|
|||
DFloat * x, DInteger * y);
|
||||
static obj<AGCObject> cmp_lessequal(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DInteger * y);
|
||||
static obj<AGCObject> cmp_greatequal(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DInteger * y);
|
||||
};
|
||||
|
||||
class IntegerFloatOps {
|
||||
|
|
@ -60,6 +62,8 @@ namespace xo {
|
|||
DInteger * x, DFloat * y);
|
||||
static obj<AGCObject> cmp_lessequal(obj<ARuntimeContext> rcx,
|
||||
DInteger * x, DFloat * y);
|
||||
static obj<AGCObject> cmp_greatequal(obj<ARuntimeContext> rcx,
|
||||
DInteger * x, DFloat * y);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ namespace xo {
|
|||
DFloat * x, DFloat * y);
|
||||
static obj<AGCObject> cmp_lessequal(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DFloat * y);
|
||||
static obj<AGCObject> cmp_greatequal(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DFloat * y);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ namespace xo {
|
|||
DInteger * x, DInteger * y);
|
||||
static obj<AGCObject> cmp_lessequal(obj<ARuntimeContext> rcx,
|
||||
DInteger * x, DInteger * y);
|
||||
static obj<AGCObject> cmp_greatequal(obj<ARuntimeContext> rcx,
|
||||
DInteger * x, DInteger * y);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -113,6 +113,11 @@ namespace xo {
|
|||
obj<AGCObject> x,
|
||||
obj<AGCObject> y);
|
||||
|
||||
/** compare two numeric values for greater-or-equal **/
|
||||
static obj<AGCObject> cmp_greatequal(obj<ARuntimeContext> rcx,
|
||||
obj<AGCObject> x,
|
||||
obj<AGCObject> y);
|
||||
|
||||
/** report memory use for owned arenas to @p visitor **/
|
||||
void visit_pools(const MemorySizeVisitor & visitor);
|
||||
|
||||
|
|
@ -129,7 +134,8 @@ namespace xo {
|
|||
typename NumericOps<DRepr1, DRepr2>::BinaryOp_Impl cmpeq_fn,
|
||||
typename NumericOps<DRepr1, DRepr2>::BinaryOp_Impl cmpne_fn,
|
||||
typename NumericOps<DRepr1, DRepr2>::BinaryOp_Impl cmplt_fn,
|
||||
typename NumericOps<DRepr1, DRepr2>::BinaryOp_Impl cmple_fn) {
|
||||
typename NumericOps<DRepr1, DRepr2>::BinaryOp_Impl cmple_fn,
|
||||
typename NumericOps<DRepr1, DRepr2>::BinaryOp_Impl cmpge_fn) {
|
||||
|
||||
KeyType key(typeseq::id<DRepr1>().seqno(),
|
||||
typeseq::id<DRepr2>().seqno());
|
||||
|
|
@ -143,7 +149,8 @@ namespace xo {
|
|||
cmpeq_fn,
|
||||
cmpne_fn,
|
||||
cmplt_fn,
|
||||
cmple_fn);
|
||||
cmple_fn,
|
||||
cmpge_fn);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -29,9 +29,10 @@ namespace xo {
|
|||
BinaryOp cmpeq,
|
||||
BinaryOp cmpne,
|
||||
BinaryOp cmplt,
|
||||
BinaryOp cmple)
|
||||
BinaryOp cmple,
|
||||
BinaryOp cmpge)
|
||||
: multiply_{multiply}, divide_{divide}, add_{add}, subtract_{subtract},
|
||||
cmpeq_{cmpeq}, cmpne_{cmpne}, cmplt_{cmplt}, cmple_{cmple} {}
|
||||
cmpeq_{cmpeq}, cmpne_{cmpne}, cmplt_{cmplt}, cmple_{cmple}, cmpge_{cmpge} {}
|
||||
|
||||
BinaryOp multiply_ = nullptr;
|
||||
BinaryOp divide_ = nullptr;
|
||||
|
|
@ -46,6 +47,8 @@ namespace xo {
|
|||
BinaryOp cmplt_ = nullptr;
|
||||
/** compare numerics (<=) **/
|
||||
BinaryOp cmple_ = nullptr;
|
||||
/** compare numerics (>=) **/
|
||||
BinaryOp cmpge_ = nullptr;
|
||||
};
|
||||
|
||||
template <typename DRepr1, typename DRepr2>
|
||||
|
|
@ -64,7 +67,8 @@ namespace xo {
|
|||
BinaryOp_Impl cmpeq,
|
||||
BinaryOp_Impl cmpne,
|
||||
BinaryOp_Impl cmplt,
|
||||
BinaryOp_Impl cmple) {
|
||||
BinaryOp_Impl cmple,
|
||||
BinaryOp_Impl cmpge) {
|
||||
return AnonymizedNumericOps(reinterpret_cast<BinaryOp_Anon>(multiply),
|
||||
reinterpret_cast<BinaryOp_Anon>(divide),
|
||||
reinterpret_cast<BinaryOp_Anon>(add),
|
||||
|
|
@ -72,7 +76,8 @@ namespace xo {
|
|||
reinterpret_cast<BinaryOp_Anon>(cmpeq),
|
||||
reinterpret_cast<BinaryOp_Anon>(cmpne),
|
||||
reinterpret_cast<BinaryOp_Anon>(cmplt),
|
||||
reinterpret_cast<BinaryOp_Anon>(cmple));
|
||||
reinterpret_cast<BinaryOp_Anon>(cmple),
|
||||
reinterpret_cast<BinaryOp_Anon>(cmpge));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,14 @@ namespace xo {
|
|||
x->value() <= DFloat::value_type(y->value()));
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
FloatIntegerOps::cmp_greatequal(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DInteger * y)
|
||||
{
|
||||
return DBoolean::box<AGCObject>(rcx.allocator(),
|
||||
x->value() >= DFloat::value_type(y->value()));
|
||||
}
|
||||
|
||||
// ----- Integer op Float -----
|
||||
|
||||
obj<AGCObject>
|
||||
|
|
@ -136,6 +144,14 @@ namespace xo {
|
|||
DFloat::value_type(x->value()) <= y->value());
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
IntegerFloatOps::cmp_greatequal(obj<ARuntimeContext> rcx,
|
||||
DInteger * x, DFloat * y)
|
||||
{
|
||||
return DBoolean::box<AGCObject>(rcx.allocator(),
|
||||
DFloat::value_type(x->value()) >= y->value());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,49 +23,64 @@ namespace xo {
|
|||
FloatOps::divide(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DFloat * y)
|
||||
{
|
||||
return DFloat::box<AGCObject>(rcx.allocator(), x->value() / y->value());
|
||||
return DFloat::box<AGCObject>(rcx.allocator(),
|
||||
x->value() / y->value());
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
FloatOps::add(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DFloat * y)
|
||||
{
|
||||
return DFloat::box<AGCObject>(rcx.allocator(), x->value() + y->value());
|
||||
return DFloat::box<AGCObject>(rcx.allocator(),
|
||||
x->value() + y->value());
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
FloatOps::subtract(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DFloat * y)
|
||||
{
|
||||
return DFloat::box<AGCObject>(rcx.allocator(), x->value() - y->value());
|
||||
return DFloat::box<AGCObject>(rcx.allocator(),
|
||||
x->value() - y->value());
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
FloatOps::cmp_equal(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DFloat * y)
|
||||
{
|
||||
return DBoolean::box<AGCObject>(rcx.allocator(), x->value() == y->value());
|
||||
return DBoolean::box<AGCObject>(rcx.allocator(),
|
||||
x->value() == y->value());
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
FloatOps::cmp_notequal(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DFloat * y)
|
||||
{
|
||||
return DBoolean::box<AGCObject>(rcx.allocator(), x->value() != y->value());
|
||||
return DBoolean::box<AGCObject>(rcx.allocator(),
|
||||
x->value() != y->value());
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
FloatOps::cmp_less(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DFloat * y)
|
||||
{
|
||||
return DBoolean::box<AGCObject>(rcx.allocator(), x->value() < y->value());
|
||||
return DBoolean::box<AGCObject>(rcx.allocator(),
|
||||
x->value() < y->value());
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
FloatOps::cmp_lessequal(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DFloat * y)
|
||||
{
|
||||
return DBoolean::box<AGCObject>(rcx.allocator(), x->value() <= y->value());
|
||||
return DBoolean::box<AGCObject>(rcx.allocator(),
|
||||
x->value() <= y->value());
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
FloatOps::cmp_greatequal(obj<ARuntimeContext> rcx,
|
||||
DFloat * x, DFloat * y)
|
||||
{
|
||||
return DBoolean::box<AGCObject>(rcx.allocator(),
|
||||
x->value() >= y->value());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,13 @@ namespace xo {
|
|||
return DBoolean::box<AGCObject>(rcx.allocator(), x->value() <= y->value());
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
IntegerOps::cmp_greatequal(obj<ARuntimeContext> rcx,
|
||||
DInteger * x, DInteger * y)
|
||||
{
|
||||
return DBoolean::box<AGCObject>(rcx.allocator(), x->value() >= y->value());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -162,6 +162,18 @@ namespace xo {
|
|||
x, y);
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
NumericDispatch::cmp_greatequal(obj<ARuntimeContext> rcx,
|
||||
obj<AGCObject> x,
|
||||
obj<AGCObject> y)
|
||||
{
|
||||
return dispatch(rcx,
|
||||
"NumericDispatch::cmp_great",
|
||||
"incomparable types in x>=y",
|
||||
&AnonymizedNumericOps::cmpge_,
|
||||
x, y);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ namespace xo {
|
|||
&FloatOps::cmp_equal,
|
||||
&FloatOps::cmp_notequal,
|
||||
&FloatOps::cmp_less,
|
||||
&FloatOps::cmp_lessequal);
|
||||
&FloatOps::cmp_lessequal,
|
||||
&FloatOps::cmp_greatequal);
|
||||
|
||||
NumericDispatch::instance().register_impl<DFloat, DInteger>
|
||||
(&FloatIntegerOps::multiply,
|
||||
|
|
@ -52,7 +53,8 @@ namespace xo {
|
|||
&FloatIntegerOps::cmp_equal,
|
||||
&FloatIntegerOps::cmp_notequal,
|
||||
&FloatIntegerOps::cmp_less,
|
||||
&FloatIntegerOps::cmp_lessequal);
|
||||
&FloatIntegerOps::cmp_lessequal,
|
||||
&FloatIntegerOps::cmp_greatequal);
|
||||
|
||||
NumericDispatch::instance().register_impl<DInteger, DFloat>
|
||||
(&IntegerFloatOps::multiply,
|
||||
|
|
@ -62,7 +64,8 @@ namespace xo {
|
|||
&IntegerFloatOps::cmp_equal,
|
||||
&IntegerFloatOps::cmp_notequal,
|
||||
&IntegerFloatOps::cmp_less,
|
||||
&IntegerFloatOps::cmp_lessequal);
|
||||
&IntegerFloatOps::cmp_lessequal,
|
||||
&IntegerFloatOps::cmp_greatequal);
|
||||
|
||||
NumericDispatch::instance().register_impl<DInteger, DInteger>
|
||||
(&IntegerOps::multiply,
|
||||
|
|
@ -72,7 +75,8 @@ namespace xo {
|
|||
&IntegerOps::cmp_equal,
|
||||
&IntegerOps::cmp_notequal,
|
||||
&IntegerOps::cmp_less,
|
||||
&IntegerOps::cmp_lessequal);
|
||||
&IntegerOps::cmp_lessequal,
|
||||
&IntegerOps::cmp_greatequal);
|
||||
|
||||
log && log(xtag("ANumeric.tseq", typeseq::id<ANumeric>()));
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@ namespace xo {
|
|||
flags & InstallFlags::f_essential);
|
||||
ok = ok & install_aux(sink, mm, "_cmple", &NumericDispatch::cmp_lessequal,
|
||||
flags & InstallFlags::f_essential);
|
||||
ok = ok & install_aux(sink, mm, "_cmpge", &NumericDispatch::cmp_greatequal,
|
||||
flags & InstallFlags::f_essential);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,10 +104,12 @@ namespace xo {
|
|||
obj<AGCObject> cmpeq_pm() const;
|
||||
/** polymorphic inequality comparison. Use to implement infix op!= **/
|
||||
obj<AGCObject> cmpne_pm() const;
|
||||
/** polymorphich less-than comparison. Use to implement infix op< **/
|
||||
/** polymorphic less-than comparison. Use to implement infix op< **/
|
||||
obj<AGCObject> cmplt_pm() const;
|
||||
/** polymorphich less-or-equal comparison. Use to implement infix op<= **/
|
||||
/** polymorphic less-or-equal comparison. Use to implement infix op<= **/
|
||||
obj<AGCObject> cmple_pm() const;
|
||||
/** polymorphic greater-or-equal comparison. Use to implement infix op>= **/
|
||||
obj<AGCObject> cmpge_pm() const;
|
||||
|
||||
/** true iff state machine is currently idle (at top-level) **/
|
||||
bool is_at_toplevel() const noexcept;
|
||||
|
|
@ -421,6 +423,7 @@ namespace xo {
|
|||
Binding cmpne_binding_;
|
||||
Binding cmplt_binding_;
|
||||
Binding cmple_binding_;
|
||||
Binding cmpge_binding_;
|
||||
|
||||
/** current output from parser **/
|
||||
ParserResult result_;
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_doublecolon:
|
||||
|
|
|
|||
|
|
@ -534,7 +534,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_doublecolon:
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_assign:
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_doublecolon:
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_doublecolon:
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_doublecolon:
|
||||
case tokentype::tk_assign:
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ namespace xo {
|
|||
case tokentype::tk_leftbracket:
|
||||
case tokentype::tk_rightbracket:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_doublecolon:
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_doublecolon:
|
||||
case tokentype::tk_assign:
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_doublecolon:
|
||||
case tokentype::tk_assign:
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_doublecolon:
|
||||
case tokentype::tk_assign:
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_doublecolon:
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_colon:
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_doublecolon:
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_doublecolon:
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_doublecolon:
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ namespace xo {
|
|||
return optype::op_less_equal;
|
||||
case tokentype::tk_rightangle:
|
||||
return optype::op_great;
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge: // [>=]
|
||||
return optype::op_great_equal;
|
||||
default:
|
||||
assert(false);
|
||||
|
|
@ -291,7 +291,6 @@ namespace xo {
|
|||
case tokentype::tk_rightbracket:
|
||||
case tokentype::tk_leftbrace:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_doublecolon:
|
||||
case tokentype::tk_assign:
|
||||
|
|
@ -306,6 +305,7 @@ namespace xo {
|
|||
case tokentype::tk_cmpne:
|
||||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_cmpge:
|
||||
this->on_operator_token(tk, p_psm);
|
||||
return;
|
||||
|
||||
|
|
@ -1170,10 +1170,16 @@ namespace xo {
|
|||
lhs_, rhs_);
|
||||
|
||||
case optype::op_great:
|
||||
case optype::op_great_equal:
|
||||
assert(false);
|
||||
break;
|
||||
|
||||
case optype::op_great_equal:
|
||||
return assemble_numeric_expr_aux
|
||||
(p_psm->expr_alloc(),
|
||||
TypeRef::prefix_type::from_chars("_cmpge_gco"),
|
||||
p_psm->cmpge_pm(),
|
||||
lhs_, rhs_);
|
||||
|
||||
case optype::op_multiply:
|
||||
return assemble_numeric_expr_aux
|
||||
(p_psm->expr_alloc(),
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_doublecolon:
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_doublecolon:
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ namespace xo {
|
|||
case tokentype::tk_leftangle:
|
||||
case tokentype::tk_rightangle:
|
||||
case tokentype::tk_cmple:
|
||||
case tokentype::tk_greatequal:
|
||||
case tokentype::tk_cmpge:
|
||||
case tokentype::tk_dot:
|
||||
case tokentype::tk_comma:
|
||||
case tokentype::tk_colon:
|
||||
|
|
|
|||
|
|
@ -150,6 +150,12 @@ namespace xo {
|
|||
assert(name);
|
||||
this->cmple_binding_ = global_symtab_->lookup_binding(name);
|
||||
}
|
||||
|
||||
{
|
||||
const DUniqueString * name = stringtable_.lookup("_cmpge");
|
||||
assert(name);
|
||||
this->cmpge_binding_ = global_symtab_->lookup_binding(name);
|
||||
}
|
||||
}
|
||||
|
||||
ParserStateMachine::~ParserStateMachine()
|
||||
|
|
@ -235,6 +241,15 @@ namespace xo {
|
|||
return retval;
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
ParserStateMachine::cmpge_pm() const
|
||||
{
|
||||
obj<AGCObject> retval = global_env_->lookup_value(cmpge_binding_);
|
||||
assert(retval);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
bool
|
||||
ParserStateMachine::is_at_toplevel() const noexcept
|
||||
{
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ namespace xo {
|
|||
tk_cmple,
|
||||
|
||||
/** great-equal @c '>=' **/
|
||||
tk_greatequal,
|
||||
tk_cmpge,
|
||||
|
||||
/** dot @c '.' **/
|
||||
tk_dot,
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ namespace xo {
|
|||
log && log("rightangle or greatequal token");
|
||||
|
||||
if (*(ix + 1) == '=') {
|
||||
tk_type = tokentype::tk_greatequal;
|
||||
tk_type = tokentype::tk_cmpge;
|
||||
++ix;
|
||||
++ix;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ namespace xo {
|
|||
CASE(tk_rightangle);
|
||||
|
||||
CASE(tk_cmple);
|
||||
CASE(tk_greatequal);
|
||||
CASE(tk_cmpge);
|
||||
CASE(tk_dot);
|
||||
CASE(tk_comma);
|
||||
CASE(tk_colon);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue