Changeset 14328 for branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Code/CodeQuoteExpression.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/CodeQuoteExpression.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 CodeQuoteExpression : Expression 6 6 { 7 public CodeQuoteExpression() : base(OpCode.CodeQuote) 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.ExecStack.Count == 0)12 if (interpreter.ExecStack.Count == 0) 14 13 return; 15 14 16 var expression = interpreterService.ExecStack.Pop(); 17 interpreterService.CodeStack.Push(expression); 15 var expression = interpreter.ExecStack.Pop(); 16 interpreter.CodeStack.Push(expression); 17 } 18 19 public override string ToString() 20 { 21 return Symbols.CodeQuote; 18 22 } 19 23 }
Note: See TracChangeset
for help on using the changeset viewer.