public InstanceExpression(String expression, Instances dataset) throws Exception { this.m_expression = expression; m_instancesHelper = new InstancesHelper(dataset); Node node = Parser.parse( // expression expression, // variables m_instancesHelper, // marcos new MacroDeclarationsCompositor(m_instancesHelper, new MathFunctions(), new IfElseMacro(), new JavaMacro())); if (!(node instanceof DoubleExpression)) throw new Exception("Expression must be of double type!"); m_compiledExpression = (DoubleExpression) node; }
List<String> tokens = tokenize(signature); types.add(getType(tokens.get(0))); if (!isJavaIdentifier(tokens.get(1))) throw new InvalidSignature("Invalid function name '" + tokens.get(1) + "'"); String name = tokens.get(1); types.add(getType(tokens.get(i)));
@Override public Macro getMacro(String name) { if (hasMacro(name)) return this; throw new RuntimeException("Undefined macro '" + name + "'!"); }
String name = parseSignature(signature, parameterTypes); Class<?> returnType = parameterTypes.remove(0);
String name = parseSignature(signature, parameterTypes); Class<?> returnType = parameterTypes.remove(0);
public InstanceExpression(String expression, Instances dataset) throws Exception { this.m_expression = expression; m_instancesHelper = new InstancesHelper(dataset); Node node = Parser.parse( // expression expression, // variables m_instancesHelper, // marcos new MacroDeclarationsCompositor(m_instancesHelper, new MathFunctions(), new IfElseMacro(), new JavaMacro())); if (!(node instanceof DoubleExpression)) throw new Exception("Expression must be of double type!"); m_compiledExpression = (DoubleExpression) node; }
List<String> tokens = tokenize(signature); types.add(getType(tokens.get(0))); if (!isJavaIdentifier(tokens.get(1))) throw new InvalidSignature("Invalid function name '" + tokens.get(1) + "'"); String name = tokens.get(1); types.add(getType(tokens.get(i)));
@Override public Macro getMacro(String name) { if (hasMacro(name)) return this; throw new RuntimeException("Undefined macro '" + name + "'!"); }
new MathFunctions(), new IfElseMacro(), new JavaMacro()
new MathFunctions(), new IfElseMacro(), new JavaMacro()
new MathFunctions(), new IfElseMacro(), new JavaMacro()
new MathFunctions(), new IfElseMacro(), new JavaMacro()
new MathFunctions(), new IfElseMacro(), new JavaMacro()
new MathFunctions(), new IfElseMacro(), new JavaMacro()
new MathFunctions(), new IfElseMacro(), new JavaMacro()
new MathFunctions(), new IfElseMacro(), new JavaMacro()
new MathFunctions(), new IfElseMacro(), new JavaMacro()
new MathFunctions(), new IfElseMacro(), new JavaMacro()
new MathFunctions(), new IfElseMacro(), new JavaMacro()