Search in sources :

Example 1 with NotImplementedYetException

use of org.abs_models.common.NotImplementedYetException in project abstools by abstools.

the class ABSTestRunnerCompiler method main.

public static void main(final String... args) {
    try {
        Absc arguments = Absc.parseArgs(args);
        new ABSTestRunnerCompiler().compile(arguments);
    } catch (NotImplementedYetException e) {
        System.err.println(e.getMessage());
        System.exit(1);
    } catch (Exception e) {
        System.err.println("An error occurred during compilation:\n" + e.getMessage());
        // FIXME: switch doesn't work.
        if (Arrays.asList(args).contains("-debug")) {
            e.printStackTrace();
        }
        System.exit(1);
    }
}
Also used : NotImplementedYetException(org.abs_models.common.NotImplementedYetException) Absc(org.abs_models.Absc) NotImplementedYetException(org.abs_models.common.NotImplementedYetException)

Example 2 with NotImplementedYetException

use of org.abs_models.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 = builtInFunctionJavaName(d.getName());
    if (name == null) {
        throw new NotImplementedYetException(app, "The built in function '" + d.getName() + "' 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 : NotImplementedYetException(org.abs_models.common.NotImplementedYetException) FunctionDecl(org.abs_models.frontend.ast.FunctionDecl)

Aggregations

NotImplementedYetException (org.abs_models.common.NotImplementedYetException)2 Absc (org.abs_models.Absc)1 FunctionDecl (org.abs_models.frontend.ast.FunctionDecl)1