use of abs.frontend.ast.PureExp in project abstools by abstools.
the class MaudeCompilerHelper method emitCostAnnotation.
public static void emitCostAnnotation(PrintStream stream, List<Annotation> annotations, int defaultValue) {
PureExp cost = CompilerUtils.getAnnotationValueFromName(annotations, "ABS.DC.Cost");
if (cost != null || defaultValue > 0) {
stream.print("$cost(");
if (cost == null) {
stream.print("\"num\"[" + Integer.toString(defaultValue) + "]");
} else {
cost.generateMaude(stream);
}
stream.print(") ; ");
}
}
Aggregations