|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.shiwa.fgi.iwir.condition.ConditionAST
public final class ConditionAST
The Class AST provides the most important methods for creating and evaluating an IWIR condition AST.
| Method Summary | |
|---|---|
static ConditionNode |
createAndOp(ConditionNode left,
ConditionNode right)
Creates an a AND (and) operation. |
static ConditionNode |
createAST(java.lang.String condition)
Creates the AST from the given condition. |
static ConditionNode |
createBoolOp(boolean b)
Creates a bool op. |
static ConditionNode |
createDoubleNode(double d)
Creates a double node. |
static ConditionNode |
createEqOp(ConditionNode left,
ConditionNode right)
Creates an a EQ (=) operation. |
static ConditionNode |
createGteOp(ConditionNode left,
ConditionNode right)
Creates an a GTE (>=) operation. |
static ConditionNode |
createGtOp(ConditionNode left,
ConditionNode right)
Creates an a GT (>) operation. |
static ConditionNode |
createIntNode(int n)
Creates a int node. |
static ConditionNode |
createLteOp(ConditionNode left,
ConditionNode right)
Creates an a LTE (<=) operation. |
static ConditionNode |
createLtOp(ConditionNode left,
ConditionNode right)
Creates an a LT (<) operation. |
static ConditionNode |
createNeqOp(ConditionNode left,
ConditionNode right)
Creates an a NEQ (!=) operation. |
static ConditionNode |
createNotOp(ConditionNode left)
Creates an a NOT (not) operation. |
static ConditionNode |
createOrOp(ConditionNode left,
ConditionNode right)
Creates an a OR (or) operation. |
static ConditionNode |
createParenOp(ConditionNode left)
Parenthesizes a condition (cond) operation. |
static ConditionNode |
createPortNode(java.lang.String s)
Creates a port node. |
static ConditionNode |
createStringNode(java.lang.String s)
Creates a string node. |
static boolean |
evalAST(ConditionNode root)
Evaluates an AST. |
static boolean |
evalCondition(AbstractTask t)
Evaluates a condition from a given task. |
static java.lang.String |
getConditionString(ConditionNode root)
Gets the condition string from a given AST. |
static boolean |
isBoolean(java.lang.String s)
Checks if the string matches the boolean pattern. |
static boolean |
isDouble(java.lang.String s)
Checks if the string matches the double pattern. |
static boolean |
isInteger(java.lang.String s)
Checks if the string matches the integer pattern. |
static boolean |
isLeaf(ConditionNode n)
Checks if a given node is a leaf. |
static boolean |
isLoopPort(java.lang.String s)
Checks if the string matches the loopPort/{from/to/step} pattern. |
static boolean |
isOperator(ConditionNode n)
Checks if a given node is an operator. |
static boolean |
isPort(java.lang.String s)
Checks if the string matches the port pattern. |
static boolean |
isString(java.lang.String s)
Checks if the given string matches the string pattern. |
static ConditionToken |
parseToken(java.lang.String token)
Parses a string and returns the corresponding token. |
static void |
printInOrder(ConditionNode root)
Prints the AST in order. |
static java.lang.String |
tokenToString(ConditionToken token)
To string returns the string representation of an operand. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ConditionToken parseToken(java.lang.String token)
token - the string to parse
public static boolean isString(java.lang.String s)
s - the string to check
public static boolean isInteger(java.lang.String s)
s - the string to check
public static boolean isDouble(java.lang.String s)
s - the string to check
public static boolean isBoolean(java.lang.String s)
s - the string to check
public static boolean isPort(java.lang.String s)
s - the string to check
public static boolean isLoopPort(java.lang.String s)
s - the string to check
public static java.lang.String tokenToString(ConditionToken token)
token - the token to return
public static ConditionNode createAST(java.lang.String condition)
throws ConditionParseException
condition - the condition to parse
ConditionParseExceptionpublic static boolean evalAST(ConditionNode root)
root - the root node of the AST
public static boolean evalCondition(AbstractTask t)
throws java.lang.IllegalArgumentException
t - the task
java.lang.IllegalArgumentException
public static ConditionNode createAndOp(ConditionNode left,
ConditionNode right)
left - the left subtreeright - the right subtree
public static ConditionNode createOrOp(ConditionNode left,
ConditionNode right)
left - the left subtreeright - the right subtree
public static ConditionNode createNotOp(ConditionNode left)
left - the left subtree
public static ConditionNode createParenOp(ConditionNode left)
left - the left subtree
public static ConditionNode createEqOp(ConditionNode left,
ConditionNode right)
left - the left subtreeright - the right subtree
public static ConditionNode createNeqOp(ConditionNode left,
ConditionNode right)
left - the left subtreeright - the right subtree
public static ConditionNode createGtOp(ConditionNode left,
ConditionNode right)
left - the left subtreeright - the right subtree
public static ConditionNode createGteOp(ConditionNode left,
ConditionNode right)
left - the left subtreeright - the right subtree
public static ConditionNode createLtOp(ConditionNode left,
ConditionNode right)
left - the left subtreeright - the right subtree
public static ConditionNode createLteOp(ConditionNode left,
ConditionNode right)
left - the left subtreeright - the right subtree
public static ConditionNode createStringNode(java.lang.String s)
s - the string
public static ConditionNode createPortNode(java.lang.String s)
s - the portname
public static ConditionNode createIntNode(int n)
n - the integer
public static ConditionNode createDoubleNode(double d)
d - the double
public static ConditionNode createBoolOp(boolean b)
b - the boolean
public static java.lang.String getConditionString(ConditionNode root)
root - the root node of the AST.
public static void printInOrder(ConditionNode root)
root - the root node of the ASTpublic static boolean isOperator(ConditionNode n)
n - the node to check
public static boolean isLeaf(ConditionNode n)
n - the node to check
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||