Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/08/16 12:04:25 (8 years ago)
Author:
pkimmesw
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/Expressions/Expression.cs

    r14323 r14328  
    11using System;
    22using System.Collections.Generic;
     3using HeuristicLab.Algorithms.PushGP.Interpreter;
    34using HeuristicLab.Algorithms.PushGP.Stack;
    45
     
    78    public abstract class Expression
    89    {
    9         public Expression(OpCode opCode)
    10         {
    11             this.OpCode = opCode;
    12         }
     10        public abstract bool IsCodeOp { get; }
     11        public abstract void Eval(IInterpreter interpreter);
    1312
    14         public OpCode OpCode { get; }
    15 
    16         public abstract void Eval(IInterpreterService interpreterService);
    17 
    18         public override string ToString()
    19         {
    20             return SymbolTable.GetSymbol(this.OpCode);
    21         }
    22 
    23         protected static void PushResult<T>(IStack<T> stack, int count, Func<T[], T> templateFunc)
     13        public void PushResult<T>(IStack<T> stack, int count, Func<T[], T> templateFunc)
    2414        {
    2515            PushResult(stack, stack, count, templateFunc);
    2616        }
    2717
    28         protected static void PushResult<T, R>(IStack<T> sourceStack, IStack<R> targetStack, int count, Func<T[], R> templateFunc)
     18        public void PushResult<T, R>(IStack<T> sourceStack, IStack<R> targetStack, int count, Func<T[], R> templateFunc)
    2919        {
    3020            // not enough arguments on stack
     
    3828        }
    3929
    40         protected static void Duplicate<T>(IStack<T> stack)
     30        public void Duplicate<T>(IStack<T> stack)
    4131        {
    4232            // not enough arguments on stack
Note: See TracChangeset for help on using the changeset viewer.