File specFile = new File(Options.jakstabHome + "/ssl/simplifications.ssl");
logger.info("Reading simplifications from " + specFile.getName() + ".");
SSLLexer lex = new SSLLexer(new FileInputStream(specFile));
SSLParser parser = new SSLParser(lex);
SSLPreprocessor prep = new SSLPreprocessor();
parser.start();
prep.start(parser.getAST());
Map<String,SSLFunction> instrPrototypes = prep.getInstructions();
//registers = prep.getRegisters();
//registers.removeAll(statusFlags);
logger.debug("-- Got " + instrPrototypes.size() + " simplification groups.");
Map<RTLExpression, RTLExpression> wholeMapping = new LinkedHashMap<RTLExpression, RTLExpression>();
for (Map.Entry<String, SSLFunction> entry : instrPrototypes.entrySet()) {
Map<RTLExpression, RTLExpression> mapping = prep.convertSimplificationTemplates(entry.getValue().getAST());
wholeMapping.putAll(mapping);
}
patterns = wholeMapping.keySet().toArray(new RTLExpression[0]);
results = wholeMapping.values().toArray(new RTLExpression[0]);