Search in sources :

Example 1 with NotImplementedYetException

use of abs.common.NotImplementedYetException in project abstools by abstools.

the class JavaGeneratorHelper method generateBuiltInFnApp.

public static void generateBuiltInFnApp(PrintStream stream, FnApp app) {
    FunctionDecl d = (FunctionDecl) app.getDecl();
    String name = d.getName();
    if (!builtInFunctionExists(name)) {
        throw new NotImplementedYetException(app, "The built in function '" + name + "' is not implemented in the Java backend.");
    }
    // if builtin function returns a non-builtin type, cast the returned value to that type
    boolean returnsGeneratedDataType = !JavaBackend.isBuiltinDataType(app.getType());
    if (returnsGeneratedDataType)
        stream.print("((" + JavaBackend.getQualifiedString(app.getType()) + ")");
    stream.print(ABSBuiltInFunctions.class.getName() + "." + name);
    String firstArgs = null;
    if (Constants.isFunctionalBreakPointFunctionName(d.getModuleDecl().getName() + "." + name))
        firstArgs = generateFunctionalBreakPointArgs(app);
    generateArgs(stream, firstArgs, app.getParams(), d.getTypes());
    if (returnsGeneratedDataType)
        stream.print(")");
}
Also used : ABSBuiltInFunctions(abs.backend.java.lib.runtime.ABSBuiltInFunctions) NotImplementedYetException(abs.common.NotImplementedYetException) FunctionDecl(abs.frontend.ast.FunctionDecl)

Aggregations

ABSBuiltInFunctions (abs.backend.java.lib.runtime.ABSBuiltInFunctions)1 NotImplementedYetException (abs.common.NotImplementedYetException)1 FunctionDecl (abs.frontend.ast.FunctionDecl)1