guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: snarfer guard macro name decision: SCM_MAGIC_SNARFER


From: Thien-Thi Nguyen
Subject: Re: snarfer guard macro name decision: SCM_MAGIC_SNARFER
Date: Wed, 13 Mar 2002 16:12:58 -0800

   From: Thien-Thi Nguyen <address@hidden>
   Date: Wed, 13 Mar 2002 14:58:06 -0800

   WARNING: the old_school_snarf is incomplete.

ok, --compat=1.4 requirements is now clearer to me: when this is used,
the environment is all new (new snarf.h, new scm_c_define_gsubr, etc).
so really the compatibility is on the input (recognizing SCM_VCELL as
SCM_VARIABLE, for example), instead of on the output as implied by the
TODO comment in the guile-snarf.in post.

below is first usable stab for anyone who wants to try guile-snarf on
old code.  i'm taking a guess w/ SCM_CONST_LONG (feedback requested).
cut and paste as appropriate...

thi

______________________________________
## snarf funcs: $1 must be the input file and must be mutable (yuk!)

modern_snarf ()
{
${cpp} -DSCM_MAGIC_SNARF_INITS "$@" > ${temp} && cpp_status=true
grep "^ *\^ *\^" ${temp} | sed -e "s/^ *\^ *\^//"
}

old_school_snarf ()
{
sed -e 's/SCM_CONST_LONG/SCM_GLOBAL_VCELL_INIT/g' \
    -e 's/SCM_GLOBAL_VCELL_INIT/SCM_GLOBAL_VARIABLE_INIT/g' \
    -e 's/SCM_GLOBAL_VCELL/SCM_GLOBAL_VARIABLE/g' \
    -e 's/SCM_VCELL_INIT/SCM_VARIABLE_INIT/g' \
    -e 's/SCM_VCELL/SCM_VARIABLE/g' \
    $1 > ${temp}
cp ${temp} $1
modern_snarf "$@"
}

##### ---------8<-------------------
##### make sure snarf funcs' $1 is the input file:

-  $snarf "$@" $clean_infile ;
+  $snarf $clean_infile "$@" ;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]