/[ascend]/trunk/base/generic/compiler/statement.c
ViewVC logotype

Diff of /trunk/base/generic/compiler/statement.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 305 by johnpye, Wed Feb 22 03:05:37 2006 UTC revision 306 by johnpye, Wed Feb 22 03:30:18 2006 UTC
# Line 735  void DestroyStatement(struct Statement * Line 735  void DestroyStatement(struct Statement *
735      if (s->ref_count ==0) {      if (s->ref_count ==0) {
736        switch(s->t) {        switch(s->t) {
737        case ALIASES:        case ALIASES:
738      DestroyVariableList(s->v.ali.vl);          DestroyVariableList(s->v.ali.vl);
739      DestroyName(s->v.ali.u.nptr);          DestroyName(s->v.ali.u.nptr);
740          s->v.ali.vl = NULL;          s->v.ali.vl = NULL;
741          s->v.ali.u.nptr = NULL;          s->v.ali.u.nptr = NULL;
742          break;          break;
743        case ARR:        case ARR:
744      DestroyVariableList(s->v.ali.vl);          DestroyVariableList(s->v.ali.vl);
745      DestroyVariableList(s->v.ali.u.avlname);          DestroyVariableList(s->v.ali.u.avlname);
746      DestroyVariableList(s->v.ali.c.setname);          DestroyVariableList(s->v.ali.c.setname);
747          s->v.ali.vl = NULL;          s->v.ali.vl = NULL;
748          s->v.ali.u.avlname = NULL;          s->v.ali.u.avlname = NULL;
749          s->v.ali.c.setname = NULL;          s->v.ali.c.setname = NULL;
750          s->v.ali.c.intset = -2;          s->v.ali.c.intset = -2;
751      if (s->v.ali.c.setvals != NULL) {          if (s->v.ali.c.setvals != NULL) {
752            DestroySetList(s->v.ali.c.setvals);            DestroySetList(s->v.ali.c.setvals);
753            s->v.ali.c.setvals = NULL;            s->v.ali.c.setvals = NULL;
754      }          }
755          break;          break;
756        case ISA:        case ISA:
757        case IRT:        case IRT:
758        case WILLBE:        case WILLBE:
759      DestroyVariableList(s->v.i.vl);          DestroyVariableList(s->v.i.vl);
760      s->v.i.vl = NULL;          s->v.i.vl = NULL;
761          if (s->v.i.checkvalue != NULL) {          if (s->v.i.checkvalue != NULL) {
762        DestroyExprList(s->v.i.checkvalue);            DestroyExprList(s->v.i.checkvalue);
763            s->v.i.checkvalue = NULL;            s->v.i.checkvalue = NULL;
764          }          }
765          if (s->v.i.typeargs != NULL) {          if (s->v.i.typeargs != NULL) {
766            DestroySetList(s->v.i.typeargs);            DestroySetList(s->v.i.typeargs);
767            s->v.i.typeargs = NULL;            s->v.i.typeargs = NULL;
768          }          }
769      break;          break;
770        case ATS:        case ATS:
771        case AA:        case AA:
772        case WBTS:        case WBTS:
773        case WNBTS:        case WNBTS:
774      DestroyVariableList(s->v.a.vl);          DestroyVariableList(s->v.a.vl);
775      s->v.a.vl = NULL;          s->v.a.vl = NULL;
776      break;          break;
777        case FOR:        case FOR:
778      DestroyExprList(s->v.f.e);          DestroyExprList(s->v.f.e);
779      s->v.f.e = NULL;          s->v.f.e = NULL;
780      DestroyStatementList(s->v.f.stmts);          DestroyStatementList(s->v.f.stmts);
781      s->v.f.stmts = NULL;          s->v.f.stmts = NULL;
782      break;          break;
783        case REL:        case REL:
784      DestroyName(s->v.rel.nptr);          DestroyName(s->v.rel.nptr);
785      s->v.rel.nptr = NULL;          s->v.rel.nptr = NULL;
786      DestroyExprList(s->v.rel.relation);          DestroyExprList(s->v.rel.relation);
787      s->v.rel.relation = NULL;          s->v.rel.relation = NULL;
788      break;          break;
789        case LOGREL:        case LOGREL:
790      DestroyName(s->v.lrel.nptr);          DestroyName(s->v.lrel.nptr);
791      s->v.lrel.nptr = NULL;          s->v.lrel.nptr = NULL;
792      DestroyExprList(s->v.lrel.logrel);          DestroyExprList(s->v.lrel.logrel);
793      s->v.lrel.logrel = NULL;          s->v.lrel.logrel = NULL;
794      break;          break;
795        case CALL:        case CALL:
796          s->v.call.id = NULL;          s->v.call.id = NULL;
797          DestroySetList(s->v.call.args);          DestroySetList(s->v.call.args);
798          s->v.call.args = NULL;          s->v.call.args = NULL;
799      break;          break;
800        case EXT:        case EXT:
801          DestroyName(s->v.ext.nptr);          DestroyName(s->v.ext.nptr);
802          s->v.ext.nptr = NULL;          s->v.ext.nptr = NULL;
# Line 810  void DestroyStatement(struct Statement * Line 810  void DestroyStatement(struct Statement *
810        case REF:        case REF:
811          DestroyVariableList(s->v.ref.vl);          DestroyVariableList(s->v.ref.vl);
812          s->v.ref.vl = NULL;          s->v.ref.vl = NULL;
813      break;          break;
814        case ASGN:        case ASGN:
815        case CASGN:        case CASGN:
816      DestroyName(s->v.asgn.nptr);          DestroyName(s->v.asgn.nptr);
817      s->v.asgn.nptr = NULL;          s->v.asgn.nptr = NULL;
818      DestroyExprList(s->v.asgn.rhs);          DestroyExprList(s->v.asgn.rhs);
819      s->v.asgn.rhs = NULL;          s->v.asgn.rhs = NULL;
820      break;          break;
821        case RUN:        case RUN:
822      DestroyName(s->v.r.proc_name);          DestroyName(s->v.r.proc_name);
823      s->v.r.proc_name = NULL;          s->v.r.proc_name = NULL;
824      DestroyName(s->v.r.type_name);          DestroyName(s->v.r.type_name);
825      s->v.r.type_name = NULL;          s->v.r.type_name = NULL;
826      break;          break;
827    
828          case FIX:
829          case FREE:
830            DestroyVariableList(s->v.fx.vars);
831            break;
832    
833        case ASSERT:        case ASSERT:
834          DestroyExprList(s->v.asserts.test);          DestroyExprList(s->v.asserts.test);
# Line 831  void DestroyStatement(struct Statement * Line 836  void DestroyStatement(struct Statement *
836          break;          break;
837    
838        case IF:        case IF:
839      DestroyStatementList(s->v.ifs.thenblock);          DestroyStatementList(s->v.ifs.thenblock);
840      s->v.ifs.thenblock = NULL;          s->v.ifs.thenblock = NULL;
841      if (s->v.ifs.elseblock!=NULL){          if (s->v.ifs.elseblock!=NULL){
842        DestroyStatementList(s->v.ifs.elseblock);            DestroyStatementList(s->v.ifs.elseblock);
843        s->v.ifs.elseblock = NULL;            s->v.ifs.elseblock = NULL;
844      }          }
845      DestroyExprList(s->v.ifs.test);          DestroyExprList(s->v.ifs.test);
846      s->v.ifs.test = NULL;          s->v.ifs.test = NULL;
847      break;          break;
848        case WHEN:        case WHEN:
849      DestroyName(s->v.w.nptr);          DestroyName(s->v.w.nptr);
850      s->v.w.nptr = NULL;          s->v.w.nptr = NULL;
851      DestroyWhenList(s->v.w.cases);          DestroyWhenList(s->v.w.cases);
852      s->v.w.cases = NULL;          s->v.w.cases = NULL;
853      DestroyVariableList(s->v.w.vl);          DestroyVariableList(s->v.w.vl);
854      s->v.w.vl = NULL;          s->v.w.vl = NULL;
855      break;          break;
856        case FNAME:        case FNAME:
857      DestroyName(s->v.n.wname);          DestroyName(s->v.n.wname);
858      s->v.n.wname = NULL;          s->v.n.wname = NULL;
859      break;          break;
860        case SELECT:        case SELECT:
861      DestroySelectList(s->v.se.cases);          DestroySelectList(s->v.se.cases);
862      s->v.se.cases = NULL;          s->v.se.cases = NULL;
863      DestroyVariableList(s->v.se.vl);          DestroyVariableList(s->v.se.vl);
864      s->v.se.vl = NULL;          s->v.se.vl = NULL;
865      break;          break;
866        case SWITCH:        case SWITCH:
867      DestroySwitchList(s->v.sw.cases);          DestroySwitchList(s->v.sw.cases);
868      s->v.sw.cases = NULL;          s->v.sw.cases = NULL;
869      DestroyVariableList(s->v.sw.vl);          DestroyVariableList(s->v.sw.vl);
870      s->v.sw.vl = NULL;          s->v.sw.vl = NULL;
871      break;          break;
872        case COND:        case COND:
873      DestroyStatementList(s->v.cond.stmts);          DestroyStatementList(s->v.cond.stmts);
874      s->v.cond.stmts = NULL;          s->v.cond.stmts = NULL;
875      break;          break;
876        case FLOW:        case FLOW:
877          DestroyBraceChar(s->v.flow.message); /* tolerates NULL */          DestroyBraceChar(s->v.flow.message); /* tolerates NULL */
878          break;          break;
879        case WHILE:        case WHILE:
880      if (s->v.loop.block!=NULL){          if (s->v.loop.block!=NULL){
881        DestroyStatementList(s->v.loop.block);            DestroyStatementList(s->v.loop.block);
882        s->v.loop.block = NULL;            s->v.loop.block = NULL;
883      }          }
884      DestroyExprList(s->v.loop.test);          DestroyExprList(s->v.loop.test);
885      s->v.loop.test = NULL;          s->v.loop.test = NULL;
886      break;          break;
887        }        }
888        s->mod = NULL;        s->mod = NULL;
889        s->linenum = 0;        s->linenum = 0;
# Line 1049  unsigned int GetStatContextF(CONST struc Line 1054  unsigned int GetStatContextF(CONST struc
1054    case EXT:    case EXT:
1055    case REF:    case REF:
1056    case RUN:    case RUN:
1057      case FIX:
1058      case FREE:
1059    case ASSERT:    case ASSERT:
1060    case IF:    case IF:
1061    case WHEN:    case WHEN:
# Line 1087  void SetStatContext(struct Statement *s, Line 1094  void SetStatContext(struct Statement *s,
1094    case EXT:    case EXT:
1095    case REF:    case REF:
1096    case RUN:    case RUN:
1097      case FIX:
1098      case FREE:
1099    case ASSERT:    case ASSERT:
1100    case IF:    case IF:
1101    case WHEN:    case WHEN:
# Line 1127  void MarkStatContext(struct Statement *s Line 1136  void MarkStatContext(struct Statement *s
1136    case EXT:    case EXT:
1137    case REF:    case REF:
1138    case RUN:    case RUN:
1139      case FIX:
1140      case FREE:
1141    case ASSERT:    case ASSERT:
1142    case IF:    case IF:
1143    case WHEN:    case WHEN:

Legend:
Removed from v.305  
changed lines
  Added in v.306

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22