ruleMap.put(new ElementSelector("*/computation/literal"), new LiteralAction());
ruleMap.put(new ElementSelector("*/computation/add"), new AddAction());
ruleMap.put(new ElementSelector("*/computation/multiply"), new MultiplyAction());
Context context = new ContextBase();
SimpleConfigurator simpleConfigurator = new SimpleConfigurator(ruleMap);
// link the configurator with its context
simpleConfigurator.setContext(context);
try {
simpleConfigurator.doConfigure(args[0]);
} catch (JoranException e) {
// Print any errors that might have occured.
StatusPrinter.print(context);
}
}