Search in sources :

Example 26 with PureExp

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(") ; ");
    }
}
Also used : PureExp(abs.frontend.ast.PureExp)

Aggregations

PureExp (abs.frontend.ast.PureExp)26 FunctionDecl (abs.frontend.ast.FunctionDecl)8 FrontendTest (abs.frontend.FrontendTest)7 Model (abs.frontend.ast.Model)7 Test (org.junit.Test)7 VarUse (abs.frontend.ast.VarUse)6 ExpFunctionDef (abs.frontend.ast.ExpFunctionDef)5 ABSData (apet.testCases.ABSData)5 Annotation (abs.frontend.ast.Annotation)4 FnApp (abs.frontend.ast.FnApp)4 IntLiteral (abs.frontend.ast.IntLiteral)4 ABSRef (apet.testCases.ABSRef)3 PreviousCall (apet.testCases.PreviousCall)3 ABSBool (abs.backend.java.lib.types.ABSBool)2 DeclNamePredicate (abs.backend.tests.AbsASTBuilderUtil.DeclNamePredicate)2 AbsASTBuilderUtil.getCall (abs.backend.tests.AbsASTBuilderUtil.getCall)2 Call (abs.frontend.ast.Call)2 ClassDecl (abs.frontend.ast.ClassDecl)2 DataTypeUse (abs.frontend.ast.DataTypeUse)2 EqExp (abs.frontend.ast.EqExp)2