메소드 | 설명 | |
---|---|---|
AppendNextNode ( |
Appends the next node.
|
|
BaseNode ( ) : System |
Initializes a new instance of the Equationator.EquationNode class.
|
|
GetHead ( ) : |
Add the ability for any node in a list to get the head node of the list.
|
|
Parse ( List |
Parse a list of tokens into a linked list of equation nodes. This will sort it out into a flat equation
|
|
Solve ( ParamDelegate paramCallback ) : float |
Solve the equation! This method recurses into the whole tree and returns a result from the equation.
|
|
Treeify ( ) : |
This method takes a node from a linked list, and folds it into a binary tree. The root node will have the highest pemdas value and the tree will be solved breadth first, ensuring that the root node is solved last.
|
메소드 | 설명 | |
---|---|---|
MakeHead ( ) : void |
Make this node into a head node.
|
|
MakeTail ( ) : void |
Makes this node into a tail node.
|
|
ParseOperNode ( List |
Given a list of tokens and the index, get an operator node based on whatever is at that index.
|
|
ParseToken ( List |
Parse the specified tokenList and curIndex. overloaded by child types to do there own specific parsing.
|
|
ParseValueNode ( List |
Given a list of tokens and the index, get a node based on whatever is at that index
|
메소드 | 설명 | |
---|---|---|
GetHighestPemdas ( ) : |
Gets the highest pemdas.
|
public AppendNextNode ( |
||
nextNode | Next node. | |
리턴 | void |
public static Parse ( List |
||
tokenList | List |
Token list. |
curIndex | int | Current index. When this function exits, will be incremented to the past any tokens consumed by this method |
owner | the equation that this node is part of. required to pull function delegates out of the dictionary | |
리턴 |
protected static ParseOperNode ( List |
||
tokenList | List |
Token list. |
curIndex | int | Current index. |
owner | the equation that this node is part of. required to pull function delegates out of the dictionary | |
리턴 |
protected abstract ParseToken ( List |
||
tokenList | List |
Token list. |
curIndex | int | Current index. |
owner | the equation that this node is part of. required to pull function delegates out of the dictionary | |
리턴 | void |
protected static ParseValueNode ( List |
||
tokenList | List |
Token list. |
curIndex | int | Current index. |
owner | the equation that this node is part of. required to pull function delegates out of the dictionary | |
리턴 |
public abstract Solve ( ParamDelegate paramCallback ) : float | ||
paramCallback | ParamDelegate | Parameter callback that will be used to get teh values of parameter nodes. |
리턴 | float |