[BACK]Return to setvariables.ccc CVS log [TXT][DIR] Up to [local] / OpenXM / src / k097 / lib

File: [local] / OpenXM / src / k097 / lib / Attic / setvariables.ccc (download)

Revision 1.1, Fri Oct 8 02:12:15 1999 UTC (24 years, 8 months ago) by maekawa
Branch: MAIN

Initial revision


/* lib/setvariables.ccc :  to generate sm1-package setvariables.sm1 */
/* sm1(" (incmac.sm1) run (slib.sm1) run ");
   sm1(" (factor-a.sm1) run  ");  run does not work!! */
sm1(" 0 @@@.indexMode ");  /* C-like notation of matrix. a[0], ... */

def getxvar(i) {
  sm1( "[(x) (var) ", i , " ..int ] system_variable /FunctionValue set ");
}

def getdvar(i) {
  sm1( "[(D) (var) ", i , " ..int ] system_variable /FunctionValue set ");
}

def getvarn() {
  sm1( "[(N)] system_variable (universalNumber) dc /FunctionValue set ");
}

def SetRingVariables() {
  /* Don't use local variables in this function,
     because we set global variables in this function.
     cf. SSWork/yacc/memo.txt,  1997,3/6 */
  Print("SetRingVariables() Setting the global variables : ");
  setRingVariables002(0,sm1( "[(CC)] system_variable (universalNumber) dc "));
  setRingVariables002(sm1( "[(C)] system_variable (universalNumber) dc "),
                      sm1( "[(LL)] system_variable (universalNumber) dc "));
  setRingVariables002(sm1( "[(L)] system_variable (universalNumber) dc "),
                      sm1( "[(MM)] system_variable (universalNumber) dc "));
  setRingVariables002(sm1( "[(M)] system_variable (universalNumber) dc "),
                      sm1( "[(NN)] system_variable (universalNumber) dc "));
  Ln();
}

def void setRingVariables002(tmp002_p,tmp002_q) {
  /* tmp002_ must not be used as variables names. */
  local tmp002_i,tmp002_v,tmp002_str;
  for (tmp002_i=tmp002_p;tmp002_i<tmp002_q;tmp002_i++) {
    tmp002_v = getxvar(tmp002_i);
    Print(tmp002_v); Print(" ");
    str = AddString(["/",tmp002_v," $",tmp002_v,"$ expand def "]);
    sm1("[(parse) ",str," ] extension ");
    tmp002_v = getdvar(tmp002_i);
    Print(tmp002_v); Print(" ");
    str = AddString(["/",tmp002_v," $",tmp002_v,"$ expand def "]);
    sm1("[(parse) ",str," ] extension ");
  }
}