Changeset 14744 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/FlushExpressions.cs
- Timestamp:
- 03/10/17 21:42:09 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/FlushExpressions.cs
r14733 r14744 10 10 /// <typeparam name="T">Stacktype</typeparam> 11 11 public abstract class FlushExpression<T> : StatelessExpression { 12 public voidEval(IStack<T> stack) {12 public bool Eval(IStack<T> stack) { 13 13 stack.Clear(); 14 return true; 14 15 } 15 16 } … … 17 18 [PushExpression(StackType.Integer, "INTEGER.FLUSH")] 18 19 public class IntegerFlushExpression : FlushExpression<long> { 19 public override voidEval(IPushInterpreter interpreter) {20 Eval(interpreter.IntegerStack);20 public override bool Eval(IPushInterpreter interpreter) { 21 return Eval(interpreter.IntegerStack); 21 22 } 22 23 } … … 24 25 [PushExpression(StackType.Float, "FLOAT.FLUSH")] 25 26 public class FloatFlushExpression : FlushExpression<double> { 26 public override voidEval(IPushInterpreter interpreter) {27 Eval(interpreter.FloatStack);27 public override bool Eval(IPushInterpreter interpreter) { 28 return Eval(interpreter.FloatStack); 28 29 } 29 30 } … … 31 32 [PushExpression(StackType.Boolean, "BOOLEAN.FLUSH")] 32 33 public class BooleanFlushExpression : FlushExpression<bool> { 33 public override voidEval(IPushInterpreter interpreter) {34 Eval(interpreter.BooleanStack);34 public override bool Eval(IPushInterpreter interpreter) { 35 return Eval(interpreter.BooleanStack); 35 36 } 36 37 } … … 38 39 [PushExpression(StackType.Name, "NAME.FLUSH")] 39 40 public class NameFlushExpression : FlushExpression<string> { 40 public override voidEval(IPushInterpreter interpreter) {41 Eval(interpreter.NameStack);41 public override bool Eval(IPushInterpreter interpreter) { 42 return Eval(interpreter.NameStack); 42 43 } 43 44 } … … 45 46 [PushExpression(StackType.Exec, "EXEC.FLUSH")] 46 47 public class ExecFlushExpression : FlushExpression<Expression> { 47 public override voidEval(IPushInterpreter interpreter) {48 Eval(interpreter.ExecStack);48 public override bool Eval(IPushInterpreter interpreter) { 49 return Eval(interpreter.ExecStack); 49 50 } 50 51 } … … 52 53 [PushExpression(StackType.Code, "CODE.FLUSH")] 53 54 public class CodeFlushExpression : FlushExpression<Expression> { 54 public override voidEval(IPushInterpreter interpreter) {55 Eval(interpreter.CodeStack);55 public override bool Eval(IPushInterpreter interpreter) { 56 return Eval(interpreter.CodeStack); 56 57 } 57 58 }
Note: See TracChangeset
for help on using the changeset viewer.