xo-expression: refactor: Lambda/Primitive share FunctionInterface
This commit is contained in:
parent
0595c7c74e
commit
5c4b062cf8
6 changed files with 63 additions and 22 deletions
34
include/xo/expression/FunctionInterface.hpp
Normal file
34
include/xo/expression/FunctionInterface.hpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/** @file FunctionInterface.hpp
|
||||
*
|
||||
* Author: Roland Conybeare
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Expression.hpp"
|
||||
//#include <cstdint>
|
||||
|
||||
namespace xo {
|
||||
namespace ast {
|
||||
class FunctionInterface : public Expression {
|
||||
public:
|
||||
FunctionInterface(exprtype extype, TypeDescr fn_type)
|
||||
: Expression(extype, fn_type) {}
|
||||
|
||||
/** downcast from Expression **/
|
||||
static ref::brw<FunctionInterface> from(ref::brw<Expression> x) {
|
||||
return ref::brw<FunctionInterface>::from(x);
|
||||
}
|
||||
|
||||
virtual const std::string & name() const = 0;
|
||||
virtual int n_arg() const = 0; // { return this->value_td()->n_fn_arg(); }
|
||||
virtual TypeDescr fn_retval() const = 0; // { return this->value_td()->fn_retval(); }
|
||||
virtual TypeDescr fn_arg(uint32_t i) const = 0; // { return this->value_td()->fn_arg(i); }
|
||||
|
||||
private:
|
||||
}; /*FunctionInterface*/
|
||||
} /*namespace ast*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
||||
/** end FunctionInterface.hpp **/
|
||||
Loading…
Add table
Add a link
Reference in a new issue