1# BEGIN LICENSE BLOCK 2# Version: CMPL 1.1 3# 4# The contents of this file are subject to the Cisco-style Mozilla Public 5# License Version 1.1 (the "License"); you may not use this file except 6# in compliance with the License. You may obtain a copy of the License 7# at www.eclipse-clp.org/license. 8# 9# Software distributed under the License is distributed on an "AS IS" 10# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 11# the License for the specific language governing rights and limitations 12# under the License. 13# 14# The Original Code is The ECLiPSe Constraint Logic Programming System. 15# The Initial Developer of the Original Code is Cisco Systems, Inc. 16# Portions created by the Initial Developer are 17# Copyright (C) 2006 Cisco Systems, Inc. All Rights Reserved. 18# 19# Contributor(s): 20# 21# END LICENSE BLOCK 22 23From - Fri Sep 24 12:25:54 1999 24Message-ID: <md5:41AF3D0818F645329FB0972FE1D0718C> 25Date: Tue, 21 Apr 92 10:38:05 +0200 26From: Joachim Schimpf <joachim@scorpio> 27To: dahmen 28Subject: exit_block and C externals 29Cc: micha, joachim 30Content-Length: 808 31Status: RO 32X-Lines: 31 33 34- There is now a recursive emulator query_emulc_noexit() that will 35 return code PTHROW instead of exiting with a longjmp, when it is 36 left with an exit_block/1. "Ball" is left in register A1 of the 37 abstract machine. 38 39- builtins can also return the PTHROW code in order to make an exit_block. 40 This can be used either to propagate the exit_block of a recursive 41 emulator, or to raise an exit_block themselves. 42 In te latter case, the macro Bip_Throw(val, tag) should be used, 43 giving "Ball" as argument (it is passed in A1). 44 45 46Possible use: 47 48p_builtin() 49{ 50 ... 51 switch (query_emulc_noexit(vgoal, tgoal, vmod, tmod)) 52 { 53 case PSUCCEED: 54 ... 55 break; 56 case PFAIL: 57 ... 58 break; 59 case PTHROW: 60 ... <cleanup> ... 61 return PTHROW; /* propagate the exit_block, Ball still in A1 */ 62 } 63 ... 64} 65 66