Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Exec/ExecPushExpression.cs @ 14328

Last change on this file since 14328 was 14328, checked in by pkimmesw, 8 years ago

#2665 Set .NET version to 4.5, C# version to 5.0, Added expression templates and factory

File size: 652 bytes
Line 
1using HeuristicLab.Algorithms.PushGP.Interpreter;
2
3namespace HeuristicLab.Algorithms.PushGP.Expressions.Exec
4{
5    public class ExecPushExpression : Expression
6    {
7        private readonly Expression value;
8        public ExecPushExpression(Expression value)
9        {
10            this.value = value;
11        }
12
13        public override bool IsCodeOp { get { return false; } }
14
15        public override void Eval(IInterpreter interpreter)
16        {
17            interpreter.ExecStack.Push(this.value);
18        }
19
20        public override string ToString()
21        {
22            return this.value.ToString();
23        }
24    }
25}
Note: See TracBrowser for help on using the repository browser.