Line | |
---|
1 | namespace HeuristicLab.Problems.ProgramSynthesis.Push.Data {
|
---|
2 | using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions;
|
---|
3 |
|
---|
4 | public class ExpressionTree {
|
---|
5 | public ExpressionNode Root { get; set; }
|
---|
6 |
|
---|
7 | public static ExpressionTree BuildTree(ExecExpandExpression program) {
|
---|
8 | var tree = new ExpressionTree { Root = new ExpressionNode(program) };
|
---|
9 |
|
---|
10 | for (var i = program.State.Expressions.Count - 1; i >= 0; i--) {
|
---|
11 | tree.Root.Children.Add(ExpressionNode.CreateNode(program.State.Expressions[i]));
|
---|
12 | }
|
---|
13 |
|
---|
14 | return tree;
|
---|
15 | }
|
---|
16 | }
|
---|
17 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.