private void returnStatement_rest() throws Exception
    {
        Instruction r = null;
        // if there is an expression
        if(scan.sym == Token.ident
           || scan.sym == Token.num
           || scan.sym == Token.openparen
           || scan.sym == Token.call) {
            if(inMain) {
                throw new Exception("Attempt to return value from __MAIN__");
            }
            r = new Ret(expression());
        } else {
            // else there is no expression to be returned
            r = inMain ? new End() : new Ret();
        }
        currentBB.addInstruction(r);
    }