public class JavaMacro extends java.lang.Object implements MacroDeclarations, Macro
type name '(' [ type [ ',' type ]* ] ')'
where type is one of 'boolean', 'double' or 'String' and name must be a valid
java identifier.
Examples:
java('java.lang.Math', 'double sqrt(double)', 4.0)
java('java.lang.String', 'String valueOf(double)', 2^30)
Constructor and Description |
---|
JavaMacro() |
Modifier and Type | Method and Description |
---|---|
Node |
evaluate(Node... nodes)
Evaluates the java macro on the given arguments
|
Macro |
getMacro(java.lang.String name)
Tries to fetch the macro
|
boolean |
hasMacro(java.lang.String name)
Whether the macro declarations contains the macro
|
public Node evaluate(Node... nodes) throws SemanticException
evaluate
in interface Macro
nodes
- the arguments to the java macroSemanticException
public boolean hasMacro(java.lang.String name)
hasMacro
in interface MacroDeclarations
name
- name of the macropublic Macro getMacro(java.lang.String name)
MacroDeclarations
MacroDeclarations.hasMacro(String)
getMacro
in interface MacroDeclarations