Changeset 14328 for branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Code/CodeDoExpression.cs
- Timestamp:
- 10/08/16 12:04:25 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Code/CodeDoExpression.cs
r14320 r14328 1 using HeuristicLab.Algorithms.PushGP. Stack;1 using HeuristicLab.Algorithms.PushGP.Interpreter; 2 2 3 namespace HeuristicLab.Algorithms.PushGP.Expressions 3 namespace HeuristicLab.Algorithms.PushGP.Expressions.Code 4 4 { 5 5 public class CodeDoExpression : Expression 6 6 { 7 public CodeDoExpression() : base(OpCode.CodeDo) 8 { } 7 public override bool IsCodeOp { get { return true; } } 9 8 10 public override void Eval(IInterpreter Service interpreterService)9 public override void Eval(IInterpreter interpreter) 11 10 { 12 11 // not enough arguments on stack 13 if (interpreter Service.CodeStack.Count == 0)12 if (interpreter.CodeStack.Count == 0) 14 13 return; 15 14 16 var expression = interpreterService.CodeStack.Pop(); 17 interpreterService.ExecStack.Push(expression); 15 var expression = interpreter.CodeStack.Pop(); 16 interpreter.ExecStack.Push(expression); 17 } 18 19 public override string ToString() 20 { 21 return Symbols.CodeDo; 18 22 } 19 23 }
Note: See TracChangeset
for help on using the changeset viewer.