Last change
on this file since 14320 was
14320,
checked in by pkimmesw, 8 years ago
|
#2665 Added Interpreter, Parser, 16 Examples, Expressions needed for the examples
|
File size:
607 bytes
|
Rev | Line | |
---|
[14320] | 1 | using HeuristicLab.Algorithms.PushGP.Stack;
|
---|
| 2 |
|
---|
| 3 | namespace HeuristicLab.Algorithms.PushGP.Expressions
|
---|
| 4 | {
|
---|
| 5 | public class CodeQuoteExpression : Expression
|
---|
| 6 | {
|
---|
| 7 | public CodeQuoteExpression() : base(OpCode.CodeQuote)
|
---|
| 8 | { }
|
---|
| 9 |
|
---|
| 10 | public override void Eval(IInterpreterService interpreterService)
|
---|
| 11 | {
|
---|
| 12 | // not enough arguments on stack
|
---|
| 13 | if (interpreterService.ExecStack.Count == 0)
|
---|
| 14 | return;
|
---|
| 15 |
|
---|
| 16 | var expression = interpreterService.ExecStack.Pop();
|
---|
| 17 | interpreterService.CodeStack.Push(expression);
|
---|
| 18 | }
|
---|
| 19 | }
|
---|
| 20 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.