1 package net.sf.yacas; 2 3 4 /// Abstract class providing the basic user function API. 5 /// Instances of this class are associated to the name of the function 6 /// via an associated hash table. When obtained, they can be used to 7 /// evaluate the function with some arguments. 8 9 abstract class LispUserFunction extends EvalFuncBase 10 { LispUserFunction()11 public LispUserFunction() 12 { 13 iFenced = true; 14 iTraced = false; 15 } 16 @Override Evaluate(LispPtr aResult,LispEnvironment aEnvironment, LispPtr aArguments)17 public abstract void Evaluate(LispPtr aResult,LispEnvironment aEnvironment, LispPtr aArguments) throws Exception; HoldArgument(String aVariable)18 public abstract void HoldArgument(String aVariable); DeclareRule(int aPrecedence, LispPtr aPredicate, LispPtr aBody)19 public abstract void DeclareRule(int aPrecedence, LispPtr aPredicate, LispPtr aBody) throws Exception; DeclareRule(int aPrecedence, LispPtr aBody)20 public abstract void DeclareRule(int aPrecedence, LispPtr aBody) throws Exception; DeclarePattern(int aPrecedence, LispPtr aPredicate, LispPtr aBody)21 public abstract void DeclarePattern(int aPrecedence, LispPtr aPredicate, LispPtr aBody) throws Exception; ArgList()22 public abstract LispPtr ArgList(); 23 UnFence()24 public void UnFence() 25 { 26 iFenced = false; 27 } Fenced()28 public boolean Fenced() 29 { 30 return iFenced; 31 } 32 Trace()33 public void Trace() 34 { 35 iTraced = true; 36 } UnTrace()37 public void UnTrace() 38 { 39 iTraced = false; 40 } Traced()41 public boolean Traced() 42 { 43 return iTraced; 44 } 45 46 boolean iFenced; 47 boolean iTraced; 48 } 49