class RuleMetricToJava {

    public RuleCode convert(String name, String dsl) {
        checkNotNull(name);
        checkNotNull(dsl);
        RuleMetricVisitorImpl ruleMetricVisitor = new RuleMetricVisitorImpl(functionRegistry);
        ruleMetricVisitor.visit(parser(dsl).parse());
        try {
            return templating(name, dsl, ruleMetricVisitor);
        } catch (Exception e) {
            throw new TemplatingException(e);
        }
    }

}