xo-reader2 stack: + op<= setup
This commit is contained in:
parent
88bf0475ec
commit
8fda8c8f14
2 changed files with 18 additions and 0 deletions
|
|
@ -106,6 +106,8 @@ namespace xo {
|
|||
obj<AGCObject> cmpne_pm() const;
|
||||
/** polymorphich less-than comparison. Use to implement infix op< **/
|
||||
obj<AGCObject> cmplt_pm() const;
|
||||
/** polymorphich less-or-equal comparison. Use to implement infix op<= **/
|
||||
obj<AGCObject> cmple_pm() const;
|
||||
|
||||
/** true iff state machine is currently idle (at top-level) **/
|
||||
bool is_at_toplevel() const noexcept;
|
||||
|
|
@ -418,6 +420,7 @@ namespace xo {
|
|||
Binding cmpeq_binding_;
|
||||
Binding cmpne_binding_;
|
||||
Binding cmplt_binding_;
|
||||
Binding cmple_binding_;
|
||||
|
||||
/** current output from parser **/
|
||||
ParserResult result_;
|
||||
|
|
|
|||
|
|
@ -144,6 +144,12 @@ namespace xo {
|
|||
assert(name);
|
||||
this->cmplt_binding_ = global_symtab_->lookup_binding(name);
|
||||
}
|
||||
|
||||
{
|
||||
const DUniqueString * name = stringtable_.lookup("_cmple");
|
||||
assert(name);
|
||||
this->cmple_binding_ = global_symtab_->lookup_binding(name);
|
||||
}
|
||||
}
|
||||
|
||||
ParserStateMachine::~ParserStateMachine()
|
||||
|
|
@ -220,6 +226,15 @@ namespace xo {
|
|||
return retval;
|
||||
}
|
||||
|
||||
obj<AGCObject>
|
||||
ParserStateMachine::cmple_pm() const
|
||||
{
|
||||
obj<AGCObject> retval = global_env_->lookup_value(cmple_binding_);
|
||||
assert(retval);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
bool
|
||||
ParserStateMachine::is_at_toplevel() const noexcept
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue