Changeset 14834 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/FlushExpressions.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/FlushExpressions.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 … … 10 12 /// <typeparam name="T">Stacktype</typeparam> 11 13 public abstract class FlushExpression<T> : StatelessExpression { 12 public bool Eval(I Stack<T> stack) {14 public bool Eval(IPushStack<T> stack) { 13 15 stack.Clear(); 14 16 return true; … … 18 20 [PushExpression(StackTypes.Integer, "INTEGER.FLUSH")] 19 21 public class IntegerFlushExpression : FlushExpression<long> { 20 public override bool Eval(I PushInterpreter interpreter) {22 public override bool Eval(IInternalPushInterpreter interpreter) { 21 23 return Eval(interpreter.IntegerStack); 22 24 } … … 25 27 [PushExpression(StackTypes.Float, "FLOAT.FLUSH")] 26 28 public class FloatFlushExpression : FlushExpression<double> { 27 public override bool Eval(I PushInterpreter interpreter) {29 public override bool Eval(IInternalPushInterpreter interpreter) { 28 30 return Eval(interpreter.FloatStack); 29 31 } … … 32 34 [PushExpression(StackTypes.Boolean, "BOOLEAN.FLUSH")] 33 35 public class BooleanFlushExpression : FlushExpression<bool> { 34 public override bool Eval(I PushInterpreter interpreter) {36 public override bool Eval(IInternalPushInterpreter interpreter) { 35 37 return Eval(interpreter.BooleanStack); 36 38 } … … 39 41 [PushExpression(StackTypes.Name, "NAME.FLUSH")] 40 42 public class NameFlushExpression : FlushExpression<string> { 41 public override bool Eval(I PushInterpreter interpreter) {43 public override bool Eval(IInternalPushInterpreter interpreter) { 42 44 return Eval(interpreter.NameStack); 43 45 } … … 46 48 [PushExpression(StackTypes.Exec, "EXEC.FLUSH")] 47 49 public class ExecFlushExpression : FlushExpression<Expression> { 48 public override bool Eval(I PushInterpreter interpreter) {50 public override bool Eval(IInternalPushInterpreter interpreter) { 49 51 return Eval(interpreter.ExecStack); 50 52 } … … 53 55 [PushExpression(StackTypes.Code, "CODE.FLUSH")] 54 56 public class CodeFlushExpression : FlushExpression<Expression> { 55 public override bool Eval(I PushInterpreter interpreter) {57 public override bool Eval(IInternalPushInterpreter interpreter) { 56 58 return Eval(interpreter.CodeStack); 57 59 } … … 60 62 [PushExpression(StackTypes.Char, "CHAR.FLUSH")] 61 63 public class CharFlushExpression : FlushExpression<char> { 62 public override bool Eval(I PushInterpreter interpreter) {64 public override bool Eval(IInternalPushInterpreter interpreter) { 63 65 return Eval(interpreter.CharStack); 64 66 } … … 67 69 [PushExpression(StackTypes.String, "STRING.FLUSH")] 68 70 public class StringFlushExpression : FlushExpression<string> { 69 public override bool Eval(I PushInterpreter interpreter) {71 public override bool Eval(IInternalPushInterpreter interpreter) { 70 72 return Eval(interpreter.StringStack); 71 73 } 72 74 } 75 76 [PushExpression(StackTypes.IntegerVector, "INTEGER[].FLUSH")] 77 public class IntegerVectorFlushExpression : FlushExpression<List<long>> { 78 public override bool Eval(IInternalPushInterpreter interpreter) { 79 return Eval(interpreter.IntegerVectorStack); 80 } 81 } 73 82 }
Note: See TracChangeset
for help on using the changeset viewer.