blob: 36b03f16d1c7239e83e41e4575e961b7e6aaf937 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
package bjc.dicelang.ast.optimization;
import bjc.utils.funcdata.IList;
import bjc.utils.funcdata.ITree;
import bjc.dicelang.ast.nodes.IDiceASTNode;
/**
* Represents a pass of optimizations over a dice AST
*
* @author ben
*
*/
public interface IOptimizationPass {
/**
* Optimize a leaf in the tree
*
* @param leafNode
* The node to optimize
* @return The optimized node
*/
public ITree<IDiceASTNode> optimizeLeaf(IDiceASTNode leafNode);
/**
* Optimize an operator in an AST node
*
* @param operator
* The operator being optimized
* @param children
* The children of the operator being optimized
* @return The optimized node
*/
public ITree<IDiceASTNode> optimizeOperator(IDiceASTNode operator,
IList<ITree<IDiceASTNode>> children);
}
|