| version 1.45, 2004/03/25 01:31:03 |
version 1.47, 2004/07/07 07:40:19 |
|
|
| * 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/strobj.c,v 1.44 2004/03/19 01:18:54 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/strobj.c,v 1.46 2004/03/25 01:56:00 noro Exp $ |
| */ |
*/ |
| #include "ca.h" |
#include "ca.h" |
| #include "parse.h" |
#include "parse.h" |
| Line 75 void Pstring_to_tb(); |
|
| Line 75 void Pstring_to_tb(); |
|
| void Pquotetotex_tb(); |
void Pquotetotex_tb(); |
| void Pquotetotex(); |
void Pquotetotex(); |
| void Pquotetotex_env(); |
void Pquotetotex_env(); |
| |
void Pflatten_quote(); |
| void fnodetotex_tb(FNODE f,TB tb); |
void fnodetotex_tb(FNODE f,TB tb); |
| char *symbol_name(char *name); |
char *symbol_name(char *name); |
| char *conv_rule(char *name); |
char *conv_rule(char *name); |
| Line 101 struct ftab str_tab[] = { |
|
| Line 102 struct ftab str_tab[] = { |
|
| {"quotetotex_tb",Pquotetotex_tb,2}, |
{"quotetotex_tb",Pquotetotex_tb,2}, |
| {"quotetotex",Pquotetotex,1}, |
{"quotetotex",Pquotetotex,1}, |
| {"quotetotex_env",Pquotetotex_env,-99999999}, |
{"quotetotex_env",Pquotetotex_env,-99999999}, |
| |
{"flatten_quote",Pflatten_quote,2}, |
| {0,0,0}, |
{0,0,0}, |
| }; |
}; |
| |
|
| Line 118 int register_symbol_table(Obj arg); |
|
| Line 120 int register_symbol_table(Obj arg); |
|
| int register_conv_rule(Obj arg); |
int register_conv_rule(Obj arg); |
| int register_conv_func(Obj arg); |
int register_conv_func(Obj arg); |
| int register_dp_vars(Obj arg); |
int register_dp_vars(Obj arg); |
| |
int register_dp_vars_origin(Obj arg); |
| |
int register_dp_dvars_origin(Obj arg); |
| |
int register_dp_dvars_prefix(Obj arg); |
| int register_dp_vars_prefix(Obj arg); |
int register_dp_vars_prefix(Obj arg); |
| int register_dp_vars_hweyl(Obj arg); |
int register_dp_vars_hweyl(Obj arg); |
| int register_show_lt(Obj arg); |
int register_show_lt(Obj arg); |
| Line 126 static struct TeXSymbol *user_texsymbol; |
|
| Line 131 static struct TeXSymbol *user_texsymbol; |
|
| static char **dp_vars; |
static char **dp_vars; |
| static int dp_vars_len; |
static int dp_vars_len; |
| static char *dp_vars_prefix; |
static char *dp_vars_prefix; |
| |
static char *dp_dvars_prefix; |
| |
static int dp_vars_origin; |
| |
static int dp_dvars_origin; |
| static int show_lt; |
static int show_lt; |
| static FUNC convfunc; |
static FUNC convfunc; |
| static int is_lt; |
static int is_lt; |
|
|
| {"conv_func",0,register_conv_func}, |
{"conv_func",0,register_conv_func}, |
| {"dp_vars",0,register_dp_vars}, |
{"dp_vars",0,register_dp_vars}, |
| {"dp_vars_prefix",0,register_dp_vars_prefix}, |
{"dp_vars_prefix",0,register_dp_vars_prefix}, |
| |
{"dp_dvars_prefix",0,register_dp_dvars_prefix}, |
| |
{"dp_vars_origin",0,register_dp_vars_origin}, |
| |
{"dp_dvars_origin",0,register_dp_dvars_origin}, |
| {"dp_vars_hweyl",0,register_dp_vars_hweyl}, |
{"dp_vars_hweyl",0,register_dp_vars_hweyl}, |
| {"show_lt",0,register_show_lt}, |
{"show_lt",0,register_show_lt}, |
| {0,0,0}, |
{0,0,0}, |
| Line 309 int register_symbol_table(Obj arg) |
|
| Line 320 int register_symbol_table(Obj arg) |
|
| return 1; |
return 1; |
| } |
} |
| |
|
| |
int register_dp_vars_origin(Obj arg) |
| |
{ |
| |
if ( INT(arg) ) { |
| |
dp_vars_origin = QTOS((Q)arg); |
| |
return 1; |
| |
} else return 0; |
| |
} |
| |
|
| |
int register_dp_dvars_origin(Obj arg) |
| |
{ |
| |
if ( INT(arg) ) { |
| |
dp_dvars_origin = QTOS((Q)arg); |
| |
return 1; |
| |
} else return 0; |
| |
} |
| |
|
| int register_dp_vars_hweyl(Obj arg) |
int register_dp_vars_hweyl(Obj arg) |
| { |
{ |
| if ( INT(arg) ) { |
if ( INT(arg) ) { |
| Line 393 int register_dp_vars_prefix(Obj arg) |
|
| Line 420 int register_dp_vars_prefix(Obj arg) |
|
| } else return 0; |
} else return 0; |
| } |
} |
| |
|
| |
int register_dp_dvars_prefix(Obj arg) |
| |
{ |
| |
if ( !arg ) { |
| |
dp_dvars_prefix = 0; |
| |
return 1; |
| |
} else if ( OID(arg) == O_STR ) { |
| |
dp_dvars_prefix = BDY((STRING)arg); |
| |
return 1; |
| |
} else if ( OID(arg) == O_P ) { |
| |
dp_dvars_prefix = NAME(VR((P)arg)); |
| |
return 1; |
| |
} else return 0; |
| |
} |
| |
|
| void Pquotetotex_env(NODE arg,Obj *rp) |
void Pquotetotex_env(NODE arg,Obj *rp) |
| { |
{ |
| int ac,i; |
int ac,i; |
| Line 804 void fnodetotex_tb(FNODE f,TB tb) |
|
| Line 845 void fnodetotex_tb(FNODE f,TB tb) |
|
| char vname[BUFSIZ],prefix[BUFSIZ]; |
char vname[BUFSIZ],prefix[BUFSIZ]; |
| char *opname,*vname_conv,*prefix_conv; |
char *opname,*vname_conv,*prefix_conv; |
| Obj obj; |
Obj obj; |
| int i,len,allzero,elen,elen2; |
int i,len,allzero,elen,elen2,si; |
| C cplx; |
C cplx; |
| char *r; |
char *r; |
| FNODE fi,f2; |
FNODE fi,f2; |
| Line 1047 void fnodetotex_tb(FNODE f,TB tb) |
|
| Line 1088 void fnodetotex_tb(FNODE f,TB tb) |
|
| strcpy(prefix,dp_vars_prefix?dp_vars_prefix:"x"); |
strcpy(prefix,dp_vars_prefix?dp_vars_prefix:"x"); |
| prefix_conv = conv_rule(prefix); |
prefix_conv = conv_rule(prefix); |
| vname_conv = (char *)ALLOCA(strlen(prefix_conv)+50); |
vname_conv = (char *)ALLOCA(strlen(prefix_conv)+50); |
| sprintf(vname_conv,i<10?"%s_%d":"%s_{%d}", |
si = i+dp_vars_origin; |
| prefix_conv,i); |
sprintf(vname_conv,(si>=0&&si<10)?"%s_%d":"%s_{%d}", |
| |
prefix_conv,si); |
| } else if ( i < elen ) { |
} else if ( i < elen ) { |
| strcpy(prefix,"\\partial"); |
strcpy(prefix, |
| |
dp_dvars_prefix?dp_dvars_prefix:"\\partial"); |
| prefix_conv = conv_rule(prefix); |
prefix_conv = conv_rule(prefix); |
| vname_conv = (char *)ALLOCA(strlen(prefix_conv)+50); |
vname_conv = (char *)ALLOCA(strlen(prefix_conv)+50); |
| sprintf(vname_conv,i<10?"%s_%d":"%s_{%d}", |
si = i+dp_dvars_origin-elen2; |
| prefix_conv,i-elen2); |
sprintf(vname_conv,(si>=0&&si<10)?"%s_%d":"%s_{%d}", |
| |
prefix_conv,si); |
| } else { |
} else { |
| strcpy(prefix,"h"); |
strcpy(prefix,"h"); |
| vname_conv = conv_rule(prefix); |
vname_conv = conv_rule(prefix); |
| Line 1063 void fnodetotex_tb(FNODE f,TB tb) |
|
| Line 1107 void fnodetotex_tb(FNODE f,TB tb) |
|
| strcpy(prefix,dp_vars_prefix?dp_vars_prefix:"x"); |
strcpy(prefix,dp_vars_prefix?dp_vars_prefix:"x"); |
| prefix_conv = conv_rule(prefix); |
prefix_conv = conv_rule(prefix); |
| vname_conv = (char *)ALLOCA(strlen(prefix_conv)+50); |
vname_conv = (char *)ALLOCA(strlen(prefix_conv)+50); |
| sprintf(vname_conv,i<10?"%s_%d":"%s_{%d}", |
si = i+dp_vars_origin; |
| prefix_conv,i); |
sprintf(vname_conv,(si>=0&&si<10)?"%s_%d":"%s_{%d}", |
| |
prefix_conv,si); |
| } |
} |
| } |
} |
| if ( fi->id == I_FORMULA && UNIQ(FA0(fi)) ) { |
if ( fi->id == I_FORMULA && UNIQ(FA0(fi)) ) { |
| Line 1234 int top_is_minus(FNODE f) |
|
| Line 1279 int top_is_minus(FNODE f) |
|
| default: |
default: |
| return 0; |
return 0; |
| } |
} |
| |
} |
| |
|
| |
FNODE flatten_fnode(FNODE,char *); |
| |
|
| |
void Pflatten_quote(NODE arg,QUOTE *rp) |
| |
{ |
| |
FNODE f; |
| |
QUOTE q; |
| |
|
| |
f = flatten_fnode(BDY((QUOTE)ARG0(arg)),BDY((STRING)ARG1(arg))); |
| |
MKQUOTE(q,f); |
| |
*rp = q; |
| } |
} |