public class IfElseMacro extends Object implements MacroDeclarations, Macro
ifelse function.
The ifelse macro can be used as follows:
ifelse(condition, ifpart, elsepart)
Whith the following constraints:
ifelse(A < B, true, A = B)ifelse(A = B, 4.0^2, 1/5)ifelse(A > B, 'bigger', 'smaller')| Constructor and Description |
|---|
IfElseMacro() |
| Modifier and Type | Method and Description |
|---|---|
Node |
evaluate(Node... params)
Evaluates the ifelse macro
|
Macro |
getMacro(String name)
Tries to fetch the macro
|
boolean |
hasMacro(String name)
Whether the macro is declared
|
public boolean hasMacro(String name)
hasMacro in interface MacroDeclarationsname - name of the macropublic Macro getMacro(String name)
MacroDeclarations applies here too.getMacro in interface MacroDeclarationsname - name of the macropublic Node evaluate(Node... params) throws SemanticException
evaluate in interface Macroparams - the parametersSemanticExceptionCopyright © 2016 University of Waikato, Hamilton, NZ. All Rights Reserved.