xo-reader2/xo-reader/include/xo/reader/envframe.hpp
Roland Conybeare 0ae98c211d Add 'xo-reader/' from commit 'c46c0f1cc4'
git-subtree-dir: xo-reader
git-subtree-mainline: dacdeb2cd7
git-subtree-split: c46c0f1cc4
2025-05-11 01:40:20 -05:00

48 lines
1.1 KiB
C++

/* file envframe.hpp
*
* author: Roland Conybeare, Aug 2024
*/
#pragma once
#include "xo/expression/Variable.hpp"
#include <vector>
namespace xo {
namespace scm {
/** @class envframe
* @brief names/types of formal paremeters introduced by a function
*
*
**/
class envframe {
public:
using Variable = xo::ast::Variable;
public:
envframe() = default;
envframe(const std::vector<rp<Variable>> & argl) : argl_(argl) {}
const std::vector<rp<Variable>> & argl() const { return argl_; }
/** lookup variable by name. If found, return it.
* Otherwise return nullptr
**/
rp<Variable> lookup(const std::string & name) const;
void print (std::ostream & os) const;
private:
std::vector<rp<Variable>> argl_;
};
inline std::ostream &
operator<< (std::ostream & os, const envframe & x) {
x.print(os);
return os;
}
} /*namespace scm*/
} /*namespace xo*/
/* end envframe.hpp */