public void visit_interrupt(InterruptStmt interrupt_stmt)
    {
        PlutoObject exception_obj = (PlutoObject)evaluate(interrupt_stmt.expression);
        PlutoClass  exception     = (PlutoClass)namespaces["exception"].get(new Token(Token.Type.Identifier, "Exception"));
        // First check if it extends 'Exception'
        PlutoClass super = exception_obj.the_class.superclass;

        while (super != exception && super != null)
        {
            super = super.superclass;
        }
        if (super != exception)
        {
            throw new RuntimeException("Class must be an Exception to be able to interrupt");
        }
        throw new InterruptException(exception_obj, (string)exception_obj.get(new Token(Token.Type.Identifier, "message")));
    }
    public void visit_interrupt(InterruptStmt interrupt_stmt)
    {
        WavyObject exception_obj = (WavyObject)evaluate(interrupt_stmt.expression);

        ExceptionManager.interrupt_wavy_exception(exception_obj);
    }
Exemple #3
0
 public void visit_interrupt(InterruptStmt interrupt_stmt)
 {
     resolve(interrupt_stmt.expression);
 }