Changeset 14834 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/YankExpressions.cs
- Timestamp:
- 04/10/17 00:27:31 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/YankExpressions.cs
r14777 r14834 1 1 namespace HeuristicLab.Problems.ProgramSynthesis.Push.Expressions { 2 using System.Collections.Generic; 3 2 4 using HeuristicLab.Problems.ProgramSynthesis.Push.Attributes; 3 5 using HeuristicLab.Problems.ProgramSynthesis.Push.Interpreter; … … 10 12 /// <typeparam name="T">Stacktype</typeparam> 11 13 public abstract class YankExpression<T> : StatelessExpression { 12 public bool Eval(I Stack<T> stack, IStack<long> integerStack, int count = 1) {14 public bool Eval(IPushStack<T> stack, IPushStack<long> integerStack, int count = 1) { 13 15 if (integerStack.Count == 0) return false; 14 16 … … 26 28 [PushExpression(StackTypes.Integer, "INTEGER.YANK")] 27 29 public class IntegerYankExpression : YankExpression<long> { 28 public override bool Eval(I PushInterpreter interpreter) {30 public override bool Eval(IInternalPushInterpreter interpreter) { 29 31 return this.Eval(interpreter.IntegerStack, interpreter.IntegerStack, 2); 30 32 } … … 33 35 [PushExpression(StackTypes.Float, "FLOAT.YANK", StackTypes.Integer)] 34 36 public class FloatYankExpression : YankExpression<double> { 35 public override bool Eval(I PushInterpreter interpreter) {37 public override bool Eval(IInternalPushInterpreter interpreter) { 36 38 return this.Eval(interpreter.FloatStack, interpreter.IntegerStack); 37 39 } … … 40 42 [PushExpression(StackTypes.Boolean, "BOOLEAN.YANK", StackTypes.Integer)] 41 43 public class BooleanYankExpression : YankExpression<bool> { 42 public override bool Eval(I PushInterpreter interpreter) {44 public override bool Eval(IInternalPushInterpreter interpreter) { 43 45 return this.Eval(interpreter.BooleanStack, interpreter.IntegerStack); 44 46 } … … 47 49 [PushExpression(StackTypes.Name, "NAME.YANK", StackTypes.Integer)] 48 50 public class NameYankExpression : YankExpression<string> { 49 public override bool Eval(I PushInterpreter interpreter) {51 public override bool Eval(IInternalPushInterpreter interpreter) { 50 52 return this.Eval(interpreter.NameStack, interpreter.IntegerStack); 51 53 } … … 54 56 [PushExpression(StackTypes.Exec, "EXEC.YANK", StackTypes.Integer)] 55 57 public class ExecYankExpression : YankExpression<Expression> { 56 public override bool Eval(I PushInterpreter interpreter) {58 public override bool Eval(IInternalPushInterpreter interpreter) { 57 59 return this.Eval(interpreter.ExecStack, interpreter.IntegerStack); 58 60 } … … 61 63 [PushExpression(StackTypes.Code, "CODE.YANK", StackTypes.Integer)] 62 64 public class CodeYankExpression : YankExpression<Expression> { 63 public override bool Eval(I PushInterpreter interpreter) {65 public override bool Eval(IInternalPushInterpreter interpreter) { 64 66 return this.Eval(interpreter.CodeStack, interpreter.IntegerStack); 65 67 } … … 68 70 [PushExpression(StackTypes.Char, "CHAR.YANK", StackTypes.Integer)] 69 71 public class CharYankExpression : YankExpression<char> { 70 public override bool Eval(I PushInterpreter interpreter) {72 public override bool Eval(IInternalPushInterpreter interpreter) { 71 73 return Eval(interpreter.CharStack, interpreter.IntegerStack); 72 74 } … … 75 77 [PushExpression(StackTypes.String, "STRING.YANK", StackTypes.Integer)] 76 78 public class StringYankExpression : YankExpression<string> { 77 public override bool Eval(I PushInterpreter interpreter) {79 public override bool Eval(IInternalPushInterpreter interpreter) { 78 80 return Eval(interpreter.StringStack, interpreter.IntegerStack); 79 81 } 80 82 } 83 84 [PushExpression(StackTypes.IntegerVector, "INTEGER[].YANK", StackTypes.Integer)] 85 public class IntegerVectorYankExpression : YankExpression<List<long>> { 86 public override bool Eval(IInternalPushInterpreter interpreter) { 87 return Eval(interpreter.IntegerVectorStack, interpreter.IntegerStack); 88 } 89 } 81 90 }
Note: See TracChangeset
for help on using the changeset viewer.