Examples of ThrowStatement


Examples of org.openquark.cal.internal.javamodel.JavaStatement.ThrowStatement

            }

        } else
        if (statement instanceof ThrowStatement) {
            ThrowStatement throwStatement = (ThrowStatement)statement;
            emitLine(sb, indent, "throw " + getSource(throwStatement.getThrownExpression(), indent, 6, context) + ";");
        } else
        if (statement instanceof UnconditionalLoop) {
            UnconditionalLoop whileStatement = (UnconditionalLoop)statement;
            emitLine (sb, indent, whileStatement.getLabel() + ": while (true) {");
            sb.append(getSource(whileStatement.getBody(), context, indent + 1));
View Full Code Here

Examples of org.openquark.cal.internal.javamodel.JavaStatement.ThrowStatement

        constructorArgs[1] = new LocalVariable("caught_exception", exceptionType);
        constructorArgTypes[1] = JavaTypeName.THROWABLE;
        ClassInstanceCreationExpression nc =
            new ClassInstanceCreationExpression (JavaTypeNames.RTFOREIGN_FUNCTION_EXCEPTION, constructorArgs, constructorArgTypes);

        ThrowStatement throwSt = new ThrowStatement (nc);
        JavaExceptionHandler eh = new JavaExceptionHandler(exceptionClass, "caught_exception", throwSt);
        exceptionInfo.add(eh);
    }
View Full Code Here

Examples of org.openquark.cal.internal.javamodel.JavaStatement.ThrowStatement

         * @return a java statement that checks if quit is requested and takes appropriate action.
         */
        private static JavaStatement checkForQuit() {
            // Call RTExecutionContext.isQuitRequest() and if true throw RTValue.InterruptException
            MethodInvocation isQuitRequested = new MethodInvocation.Instance(SCJavaDefn.EXECUTION_CONTEXT_VAR, "isQuitRequested", JavaTypeName.BOOLEAN, MethodInvocation.InvocationType.VIRTUAL);
            ThrowStatement throwStatement = new ThrowStatement(new JavaExpression.JavaField.Static(JavaTypeNames.RTVALUE, "INTERRUPT_EXCEPTION", JavaTypeName.CAL_EXECUTOR_EXCEPTION));
            IfThenElseStatement conditional = new IfThenElseStatement(isQuitRequested, throwStatement);
            return conditional;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.