[Mathlib-commitlog] SF.net SVN: mathlib:[772] JMathLib/trunk/src/jmathlib/core/tokens/ WhileOperato
Status: Beta
Brought to you by:
st_mueller
|
From: <st_...@us...> - 2009-01-25 08:01:59
|
Revision: 772
http://mathlib.svn.sourceforge.net/mathlib/?rev=772&view=rev
Author: st_mueller
Date: 2009-01-25 08:01:50 +0000 (Sun, 25 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/tokens/WhileOperatorToken.java
Modified: JMathLib/trunk/src/jmathlib/core/tokens/WhileOperatorToken.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/tokens/WhileOperatorToken.java 2009-01-25 07:59:07 UTC (rev 771)
+++ JMathLib/trunk/src/jmathlib/core/tokens/WhileOperatorToken.java 2009-01-25 08:01:50 UTC (rev 772)
@@ -7,7 +7,6 @@
/**Used to implement if-then-else operations within an expression*/
public class WhileOperatorToken extends CommandToken
{
-
/**condition */
OperandToken whileRelation;
@@ -15,19 +14,21 @@
OperandToken whileCode;
/**Constructor setting the whileRelation and whileCode
- @param _whileRelation = the test relationship
- @param _whileCode = the code to execute while the test is true*/
+ * @param _whileRelation = the test relationship
+ * @param _whileCode = the code to execute while the test is true
+ */
public WhileOperatorToken(OperandToken _whileRelation, OperandToken _whileCode)
{
whileRelation = _whileRelation;
whileCode = _whileCode;
}
-
/**evaluates the operator
- @param operands = the tokens parameters (not used)
- @return the result as an OperandToken*/
- public OperandToken evaluate(Token[] operands)
+ * @param operands = the tokens parameters (not used)
+ * @param globals
+ * @return the result as an OperandToken
+ * */
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
ErrorLogger.debugLine("Parser: While: evaluate");
@@ -37,7 +38,7 @@
// Check condition of while(...)
OperandToken relationLine = ((OperandToken)whileRelation.clone());
ErrorLogger.debugLine("line = " + relationLine.toString());
- OperandToken result = relationLine.evaluate(null);
+ OperandToken result = relationLine.evaluate(null, globals);
if (result instanceof DoubleNumberToken)
{
@@ -72,7 +73,7 @@
{
OperandToken codeLine = ((OperandToken)whileCode.clone());
ErrorLogger.debugLine("Parser: while number is true");
- code = codeLine.evaluate(null);
+ code = codeLine.evaluate(null, globals);
}
}
else if (result instanceof LogicalToken)
@@ -88,7 +89,7 @@
{
OperandToken codeLine = ((OperandToken)whileCode.clone());
ErrorLogger.debugLine("Parser: while boolean is true");
- code = codeLine.evaluate(null);
+ code = codeLine.evaluate(null, globals);
}
}
@@ -100,12 +101,12 @@
return null;
}
-
- /**@return the operator as a string*/
+ /**
+ * @return the operator as a string
+ */
public String toString()
{
return "while";
}
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|