[Mathlib-commitlog] SF.net SVN: mathlib:[748] JMathLib/trunk/src/jmathlib/core/tokens
Status: Beta
Brought to you by:
st_mueller
|
From: <st_...@us...> - 2009-01-24 09:22:46
|
Revision: 748
http://mathlib.svn.sourceforge.net/mathlib/?rev=748&view=rev
Author: st_mueller
Date: 2009-01-24 09:22:42 +0000 (Sat, 24 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/ColonOperatorToken.java
JMathLib/trunk/src/jmathlib/core/tokens/CommandToken.java
JMathLib/trunk/src/jmathlib/core/tokens/ConditionToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/ColonOperatorToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/ColonOperatorToken.java 2009-01-24 09:20:41 UTC (rev 747)
+++ JMathLib/trunk/src/jmathlib/core/tokens/ColonOperatorToken.java 2009-01-24 09:22:42 UTC (rev 748)
@@ -16,7 +16,7 @@
}
/**evaluates the operator*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
double x1; // minimum
Modified: JMathLib/trunk/src/jmathlib/core/tokens/CommandToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/CommandToken.java 2009-01-24 09:20:41 UTC (rev 747)
+++ JMathLib/trunk/src/jmathlib/core/tokens/CommandToken.java 2009-01-24 09:22:42 UTC (rev 748)
@@ -1,5 +1,7 @@
package jmathlib.core.tokens;
+import jmathlib.core.interpreter.GlobalValues;
+
/**Class for implementing commands */
public class CommandToken extends OperandToken
{
@@ -18,7 +20,7 @@
/**Evaluates the command
@param operands = the commands operands
@return the result of the command as an OperandToken*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
return null;
}
Modified: JMathLib/trunk/src/jmathlib/core/tokens/ConditionToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/ConditionToken.java 2009-01-24 09:20:41 UTC (rev 747)
+++ JMathLib/trunk/src/jmathlib/core/tokens/ConditionToken.java 2009-01-24 09:22:42 UTC (rev 748)
@@ -13,8 +13,9 @@
private OperandToken code;
/**Constructor setting ifRelation and ifCode
- @param _ifRelation = the test relation
- @param _ifCode = the code to execute if the test is true*/
+ * @param _ifRelation = the test relation
+ * @param _ifCode = the code to execute if the test is true
+ */
public ConditionToken(OperandToken _condition, OperandToken _code)
{
condition = _condition;
@@ -40,14 +41,15 @@
}
/**evaluates the operator
- @param operands = the operators operands
- @return the result of the test as an OperandToken*/
- public OperandToken evaluate(Token[] operands)
+ * @param operands = the operators operands
+ * @param
+ * @return the result of the test as an OperandToken*/
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
if(condition != null)
{
ErrorLogger.debugLine("ConditionToken: testing " + condition.toString());
- OperandToken result = condition.evaluate(null);
+ OperandToken result = condition.evaluate(null, globals);
if(result instanceof DoubleNumberToken)
{
@@ -64,7 +66,7 @@
if(tag)
{
// evaluate Code
- code.evaluate(null);
+ code.evaluate(null, globals);
return DoubleNumberToken.one;
}
}
@@ -83,21 +85,20 @@
if (tag)
{
// evaluate Code
- code.evaluate(null);
+ code.evaluate(null, globals);
return DoubleNumberToken.one;
}
}
}
else
{
- code.evaluate(null);
+ code.evaluate(null, globals);
return DoubleNumberToken.one;
}
return null;
}
-
/**Convert the operator to a string
* @return the operator as a string
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|