kolibrios-gitea/contrib/media/updf/include/lispevalhash.h
right-hearted 4f7ee97ec9 uPDF with buttons
git-svn-id: svn://kolibrios.org@4680 a494cfbc-eb01-0410-851d-a64ba20cac60
2014-03-22 21:00:40 +00:00

47 lines
1.1 KiB
C++

/** \file lispevalhash.h
* Storage of executable commands
*
*/
#ifndef __lispevalhash_h__
#define __lispevalhash_h__
#include "yacasbase.h"
#include "lispobject.h"
#include "lisphash.h"
#include "evalfunc.h"
// new-style evaluator, passing arguments onto the stack in LispEnvironment
typedef void (*YacasEvalCaller)(LispEnvironment& aEnvironment,LispInt aStackTop);
class YacasEvaluator : public EvalFuncBase
{
public:
// FunctionFlags can be orred when passed to the constructor of this function
enum FunctionFlags
{
Function=0, // Function: evaluate arguments
Macro=1, // Function: don't evaluate arguments
Fixed = 0, // fixed number of arguments
Variable = 2 // variable number of arguments
};
YacasEvaluator(YacasEvalCaller aCaller,LispInt aNrArgs, LispInt aFlags)
: iCaller(aCaller), iNrArgs(aNrArgs), iFlags(aFlags)
{
}
virtual void Evaluate(LispPtr& aResult,LispEnvironment& aEnvironment,
LispPtr& aArguments);
private:
YacasEvalCaller iCaller;
LispInt iNrArgs;
LispInt iFlags;
};
class YacasCoreCommands : public LispAssociatedHash<YacasEvaluator>
{
};
#endif