Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

lispform.hpp

Go to the documentation of this file.
00001 // +-------------------------------------------------------------------------+
00002 // |               I__n__t__e__L__i__b           0.6.10 development          |
00003 // | Copyright (c) Andrey Vikt. Stolyarov <crocodil_AT_croco.net> 2000-2007. |
00004 // |                                                                         |
00005 // | This is free software. The library part is available under              |
00006 // |                               GNU LESSER GENERAL PUBLIC LICENSE v.2.1.  |
00007 // | GNU LGPL v2.1 is found in docs/gnu_gpl2.txt,  or at  http://www.gnu.org |
00008 // |     Please see also docs/readme.txt and visit http://www.intelib.org    |
00009 // |                                                                         |
00010 // | !!! THERE IS NO WARRANTY OF ANY KIND, NEITHER EXPRESSED NOR IMPLIED !!! |
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

Generated on Tue Dec 18 00:39:43 2007 for InteLib by  doxygen 1.4.1