Changeset 4685 for branches/CloningRefactoring
- Timestamp:
- 10/29/10 20:02:11 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/Grammars.cs
r4106 r4685 23 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 24 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols; 25 using HeuristicLab.Common; 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 27 26 28 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._3.Tests { 27 29 public static class Grammars { 28 private class Addition : Symbol { public Addition() : base("Addition", "") { } } 29 private class Subtraction : Symbol { public Subtraction() : base("Subtraction", "") { } } 30 private class Multiplication : Symbol { public Multiplication() : base("Multiplication", "") { } } 31 private class Division : Symbol { public Division() : base("Division", "") { } } 32 private class Terminal : Symbol { public Terminal() : base("Terminal", "") { } } 30 private class Addition : Symbol { 31 protected Addition(Addition original, Cloner cloner) : base(original, cloner) { } 32 public Addition() : base("Addition", "") { } 33 public override IDeepCloneable Clone(Cloner cloner) { 34 return new Addition(this, cloner); 35 } 36 } 37 private class Subtraction : Symbol { 38 protected Subtraction(Subtraction original, Cloner cloner) : base(original, cloner) { } 39 public Subtraction() : base("Subtraction", "") { } 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new Subtraction(this, cloner); 42 } 43 } 44 private class Multiplication : Symbol { 45 protected Multiplication(Multiplication original, Cloner cloner) : base(original, cloner) { } 46 public Multiplication() : base("Multiplication", "") { } 47 public override IDeepCloneable Clone(Cloner cloner) { 48 return new Multiplication(this, cloner); 49 } 50 } 51 private class Division : Symbol { 52 protected Division(Division original, Cloner cloner) : base(original, cloner) { } 53 public Division() : base("Division", "") { } 54 public override IDeepCloneable Clone(Cloner cloner) { 55 return new Division(this, cloner); 56 } 57 } 58 private class Terminal : Symbol { 59 protected Terminal(Terminal original, Cloner cloner) : base(original, cloner) { } 60 public Terminal() : base("Terminal", "") { } 61 public override IDeepCloneable Clone(Cloner cloner) { 62 return new Terminal(this, cloner); 63 } 64 } 33 65 34 66 private class SimpleArithmeticGrammar : DefaultSymbolicExpressionGrammar { 67 protected SimpleArithmeticGrammar(SimpleArithmeticGrammar original, Cloner cloner) : base(original, cloner) { } 35 68 public SimpleArithmeticGrammar() 36 69 : base() { 37 70 Initialize(); 71 } 72 73 public override IDeepCloneable Clone(Cloner cloner) { 74 return new SimpleArithmeticGrammar(this, cloner); 38 75 } 39 76
Note: See TracChangeset
for help on using the changeset viewer.