Changeset daa036 in git


Ignore:
Timestamp:
Jun 10, 2014, 4:37:04 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
9b0e1a1147ae276a71f7e5bce7beb59c9ef90534
Parents:
c12ec63afae5364ad41ce47666ac5ea44c9feccb
Message:
gentable: prototype for doc.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/gentable.cc

    rc12ec6 rdaa036  
    564564  fclose(outfile);
    565565}
     566int is_ref_cmd(cmdnames *c)
     567{
     568  if( c->tokval==0) return 0;
     569  if (c->alias > 0) return 0;
     570  if  ((c->toktype==CMD_1)
     571        || (c->toktype==CMD_2)
     572        || (c->toktype==CMD_3)
     573        || (c->toktype==CMD_M)
     574        || (c->toktype==CMD_12)
     575        || (c->toktype==CMD_13)
     576        || (c->toktype==CMD_23)
     577        || (c->toktype==CMD_123)) return 1;
     578  return 0;
     579}
    566580void ttGen2c()
    567581{
     
    577591  {
    578592    // assume that cmds[0].tokval== -1 and all others with tokval -1 at the end
    579     if(cmds[m].tokval>0)
     593    if(is_ref_cmd(&(cmds[m])))
    580594    {
    581595      fprintf(outfile,"* %s::\n",cmds[m].name);
     
    586600  {
    587601    // assume that cmds[0].tokval== -1 and all others with tokval -1 at the end
    588     if(cmds[m].tokval>0)
     602    if(is_ref_cmd(&(cmds[m])))
    589603    {
    590604      fprintf(outfile,"@node %s,",cmds[m].name);
    591605      // next:
    592       if (cmds[m+1].tokval>0)
    593         fprintf(outfile,"%s,",cmds[m+1].name);
     606      int mm=m-1;
     607      while((mm>0)&& (is_ref_cmd(&cmds[mm]))) mm--;
     608      if((mm>0)&& (is_ref_cmd(&cmds[mm])))
     609        fprintf(outfile,"%s,",cmds[mm].name);
    594610      else
    595611        fprintf(outfile,",");
    596612      // prev:
    597       if (cmds[m-1].tokval>0)
     613      mm=m+1;
     614      while((mm>0)&& (is_ref_cmd(&cmds[mm]))) mm++;
     615      if((mm>0)&& (is_ref_cmd(&cmds[mm])))
    598616        fprintf(outfile,"%s,",cmds[m-1].name);
    599617      else
     
    871889/*-------------------------------------------------------------------*/
    872890
    873 int main()
    874 {
    875   //ttGen4();
    876   ttGen1();
    877   ttGen2b();
    878   //ttGen2c();
    879   rename(iparith_inc,"iparith.inc");
     891int main(int argc, char** argv)
     892{
     893  if (argc>1)
     894  {
     895    ttGen4();
     896    ttGen2c();
     897  }
     898  else
     899  {
     900    ttGen1();
     901    ttGen2b();
     902    rename(iparith_inc,"iparith.inc");
     903  }
    880904  return 0;
    881905}
Note: See TracChangeset for help on using the changeset viewer.