| version 1.2, 2000/08/21 08:31:21 |
version 1.5, 2001/10/09 01:36:07 |
|
|
| * shall be made on your publication or presentation in any form of the |
* shall be made on your publication or presentation in any form of the |
| * results obtained by use of the SOFTWARE. |
* results obtained by use of the SOFTWARE. |
| * (4) In the event that you modify the SOFTWARE, you shall notify FLL by |
* (4) In the event that you modify the SOFTWARE, you shall notify FLL by |
| * e-mail at risa-admin@flab.fujitsu.co.jp of the detailed specification |
* e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification |
| * for such modification or the source code of the modified part of the |
* for such modification or the source code of the modified part of the |
| * SOFTWARE. |
* SOFTWARE. |
| * |
* |
|
|
| * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
| * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
| * |
* |
| * $OpenXM: OpenXM_contrib2/asir2000/builtin/subst.c,v 1.1.1.1 1999/12/03 07:39:07 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/subst.c,v 1.4 2001/09/05 04:43:58 noro Exp $ |
| */ |
*/ |
| #include "ca.h" |
#include "ca.h" |
| #include "parse.h" |
#include "parse.h" |
| |
|
| void Psubst(), Ppsubst(), Psubstf(); |
void Psubst(), Ppsubst(), Psubstf(), Psubst_quote(); |
| |
|
| struct ftab subst_tab[] = { |
struct ftab subst_tab[] = { |
| {"subst",Psubst,-99999999}, |
{"subst",Psubst,-99999999}, |
| |
{"subst_quote",Psubst_quote,-99999999}, |
| {"psubst",Ppsubst,-99999999}, |
{"psubst",Ppsubst,-99999999}, |
| {"substf",Psubstf,-99999999}, |
{"substf",Psubstf,-99999999}, |
| {0,0,0}, |
{0,0,0}, |
|
|
| substr(CO,0,a,v,b,&t); a = t; |
substr(CO,0,a,v,b,&t); a = t; |
| } |
} |
| *rp = a; |
*rp = a; |
| |
} |
| |
|
| |
FNODE subst_in_fnode(); |
| |
|
| |
void Psubst_quote(arg,rp) |
| |
NODE arg; |
| |
QUOTE *rp; |
| |
{ |
| |
QUOTE h; |
| |
FNODE fn; |
| |
Obj g; |
| |
LIST l; |
| |
V v; |
| |
|
| |
if ( !arg ) { |
| |
*rp = 0; return; |
| |
} |
| |
asir_assert(ARG0(arg),O_QUOTE,"subst_quote"); |
| |
fn = BDY((QUOTE)ARG0(arg)); arg = NEXT(arg); |
| |
if ( arg && (l = (LIST)ARG0(arg)) && OID(l) == O_LIST ) |
| |
arg = BDY(l); |
| |
while ( arg ) { |
| |
asir_assert(BDY(arg),O_P,"subst_quote"); |
| |
v = VR((P)BDY(arg)); arg = NEXT(arg); |
| |
if ( !arg ) |
| |
error("subst_quote : invalid argument"); |
| |
g = (Obj)ARG0(arg); arg = NEXT(arg); |
| |
if ( !g || OID(g) != O_QUOTE ) |
| |
objtoquote(g,&h); |
| |
else |
| |
h = (QUOTE)g; |
| |
fn = subst_in_fnode(fn,v,BDY(h)); |
| |
} |
| |
MKQUOTE(*rp,fn); |
| } |
} |
| |
|
| void Ppsubst(arg,rp) |
void Ppsubst(arg,rp) |