Changeset 14834 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/DefineExpressions.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/DefineExpressions.cs
r14777 r14834 14 14 public abstract class DefineExpression<T> : StatelessExpression { 15 15 protected bool Eval( 16 I Stack<T> stack,17 I Stack<string> nameStack,16 IPushStack<T> stack, 17 IPushStack<string> nameStack, 18 18 IDictionary<string, Expression> customExpressions, 19 19 Func<T, Expression> creator) { … … 33 33 [PushExpression(StackTypes.Code, "CODE.DEFINE", StackTypes.Name)] 34 34 public class CodeDefineExpression : DefineExpression<Expression> { 35 public override bool Eval(I PushInterpreter interpreter) {35 public override bool Eval(IInternalPushInterpreter interpreter) { 36 36 if (interpreter.Configuration.TopLevelPushCode && (interpreter.CodeStack.Count < 2)) return false; 37 37 … … 50 50 [PushExpression(StackTypes.Exec, "EXEC.DEFINE", StackTypes.Name)] 51 51 public class ExecDefineExpression : DefineExpression<Expression> { 52 public override bool Eval(I PushInterpreter interpreter) {52 public override bool Eval(IInternalPushInterpreter interpreter) { 53 53 if (interpreter.ExecStack.Count < 2) return false; 54 54 … … 69 69 public class FloatDefineExpression : DefineExpression<double> { 70 70 71 public override bool Eval(I PushInterpreter interpreter) {71 public override bool Eval(IInternalPushInterpreter interpreter) { 72 72 return this.Eval( 73 73 interpreter.FloatStack, … … 80 80 [PushExpression(StackTypes.Integer, "INTEGER.DEFINE", StackTypes.Name)] 81 81 public class IntegerDefineExpression : DefineExpression<long> { 82 public override bool Eval(I PushInterpreter interpreter) {82 public override bool Eval(IInternalPushInterpreter interpreter) { 83 83 return this.Eval( 84 84 interpreter.IntegerStack, … … 91 91 [PushExpression(StackTypes.Boolean, "BOOLEAN.DEFINE", StackTypes.Name)] 92 92 public class BooleanDefineExpression : DefineExpression<bool> { 93 public override bool Eval(I PushInterpreter interpreter) {93 public override bool Eval(IInternalPushInterpreter interpreter) { 94 94 return this.Eval( 95 95 interpreter.BooleanStack, … … 102 102 [PushExpression(StackTypes.Char, "CHAR.DEFINE", StackTypes.Name)] 103 103 public class CharDefineExpression : DefineExpression<char> { 104 public override bool Eval(I PushInterpreter interpreter) {104 public override bool Eval(IInternalPushInterpreter interpreter) { 105 105 return Eval( 106 106 interpreter.CharStack, … … 113 113 [PushExpression(StackTypes.String, "STRING.DEFINE", StackTypes.Name)] 114 114 public class StringDefineExpression : DefineExpression<string> { 115 public override bool Eval(I PushInterpreter interpreter) {115 public override bool Eval(IInternalPushInterpreter interpreter) { 116 116 return Eval( 117 117 interpreter.StringStack, … … 121 121 } 122 122 } 123 124 [PushExpression(StackTypes.IntegerVector, "INTEGER[].DEFINE", StackTypes.Name)] 125 public class IntegerVectorDefineExpression : DefineExpression<List<long>> { 126 public override bool Eval(IInternalPushInterpreter interpreter) { 127 return Eval( 128 interpreter.IntegerVectorStack, 129 interpreter.NameStack, 130 interpreter.CustomExpressions, 131 v => new IntegerVectorPushExpression(v)); 132 } 133 } 123 134 }
Note: See TracChangeset
for help on using the changeset viewer.