public abstract class AbstractBinder<MS,B extends E,E,O> extends Object
expression (velocity: length/time): 5 mi/hr (bad) (good) ÷ ? / \ / \ ? hr 5 ÷ / \ / \ 5 mi mi hr
A list of all the terminal operands maintains the operators in RHS operand nodes. The binding algorithm uses type information to test for operator compatibility and binding reactions between adjacent operands to recursively reduce the list to a single expression:
initial list ==> (? 5) -> (? mi) -> (/ hr) ==> (5) -> (? (mi/hr)) ==> ((5(mi/hr)))
Modifier and Type | Class and Description |
---|---|
static class |
AbstractBinder.Node<E,O> |
Constructor and Description |
---|
AbstractBinder() |
Modifier and Type | Method and Description |
---|---|
B |
bind(ArrayList<AbstractBinder.Node<E,O>> operands) |
protected abstract MS |
findBinderMethod(AbstractBinder.Node<E,O> left,
AbstractBinder.Node<E,O> right) |
protected abstract AbstractBinder.Node<E,O> |
makeBinaryExpression(AbstractBinder.Node<E,O> left,
AbstractBinder.Node<E,O> right,
MS binderMethod) |
protected abstract MS findBinderMethod(AbstractBinder.Node<E,O> left, AbstractBinder.Node<E,O> right)
protected abstract AbstractBinder.Node<E,O> makeBinaryExpression(AbstractBinder.Node<E,O> left, AbstractBinder.Node<E,O> right, MS binderMethod)
public B bind(ArrayList<AbstractBinder.Node<E,O>> operands)
Copyright © 2024. All rights reserved.