00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00022 #ifndef INTELIB_LISPFORM_HPP_SENTRY
00023 #define INTELIB_LISPFORM_HPP_SENTRY
00024
00025 #include "../sexpress/sexpress.hpp"
00026 #include "../sexpress/iexcept.hpp"
00027
00028 class IntelibContinuation;
00029
00031
00039 class SExpressionFunction : public SExpression {
00040 protected:
00041 int min_param, max_param;
00042 public:
00043 static IntelibTypeId TypeId;
00044 SExpressionFunction(int min, int max)
00045 : SExpression(TypeId), min_param(min), max_param(max) {}
00046 protected:
00047 SExpressionFunction(const IntelibTypeId& id, int min, int max)
00048 : SExpression(id), min_param(min), max_param(max) {}
00049 virtual ~SExpressionFunction() {}
00050 public:
00051 void Apply(int paramc, const SReference *paramv,
00052 IntelibContinuation &cont) const;
00053 protected:
00054 virtual void DoApply(int paramc,
00055 const SReference *paramv,
00056 IntelibContinuation &cont) const = 0;
00057 };
00058
00060
00068 class SExpressionForm : public SExpression {
00069 public:
00070 static IntelibTypeId TypeId;
00071 SExpressionForm() : SExpression(TypeId) {}
00072 protected:
00073 SExpressionForm(const IntelibTypeId& id) : SExpression(id) {}
00074 virtual ~SExpressionForm() {}
00075
00076 public:
00077 virtual void Call(const SReference &formtail,
00078 IntelibContinuation &cont) const = 0;
00079 };
00080
00082 class IntelibX_too_many_params : public IntelibX {
00083 public:
00084 IntelibX_too_many_params(SReference a_param);
00085 };
00086
00088 class IntelibX_too_few_params : public IntelibX {
00089 public:
00090 IntelibX_too_few_params(SReference a_param);
00091 };
00092
00093 #endif