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

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

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

revision 89 by johnpye, Wed Dec 7 15:44:43 2005 UTC revision 97 by jds, Fri Dec 9 03:49:19 2005 UTC
# Line 871  struct IndexType *MakeIndex(struct Insta Line 871  struct IndexType *MakeIndex(struct Insta
871        Asc_Panic(2, NULL, "Bad index to dense alias array");        Asc_Panic(2, NULL, "Bad index to dense alias array");
872        exit(2);/* Needed to keep gcc from whining */        exit(2);/* Needed to keep gcc from whining */
873      }      }
874      return NULL;      /* return NULL; */  /* unreachable */
875    }    }
876  }  }
877    
# Line 1387  symchar *UniquifyString(char *s, struct Line 1387  symchar *UniquifyString(char *s, struct
1387      while ( (oldlen+1) < maxlen) {      while ( (oldlen+1) < maxlen) {
1388        new[oldlen+1] = '\0';        new[oldlen+1] = '\0';
1389        for(c = 'a'; c <= 'z'; c++){        for(c = 'a'; c <= 'z'; c++){
1390          new[oldlen] = c;          new[oldlen] = (char)c;
1391          tmp = AddSymbol(new);          tmp = AddSymbol(new);
1392          if (StrMember(tmp,strset)==0) {          if (StrMember(tmp,strset)==0) {
1393            ascfree(new);            ascfree(new);
# Line 4970  struct Instance *MakeLogRelInstance(stru Line 4970  struct Instance *MakeLogRelInstance(stru
4970    if ((childname=SimpleNameIdPtr(name))!=NULL){ /* simple name */    if ((childname=SimpleNameIdPtr(name))!=NULL){ /* simple name */
4971      SetInstanceNameType(rec,StrName);      SetInstanceNameType(rec,StrName);
4972      SetInstanceNameStrPtr(rec,childname);      SetInstanceNameStrPtr(rec,childname);
4973      if((pos = ChildSearch(parent,&rec))){      if(0 != (pos = ChildSearch(parent,&rec))){
4974        /* following assertion should be true */        /* following assertion should be true */
4975        assert(InstanceChild(parent,pos)==NULL);        assert(InstanceChild(parent,pos)==NULL);
4976        child = CreateLogRelInstance(def);        child = CreateLogRelInstance(def);
# Line 4983  struct Instance *MakeLogRelInstance(stru Line 4983  struct Instance *MakeLogRelInstance(stru
4983      childname = NameIdPtr(name);      childname = NameIdPtr(name);
4984      SetInstanceNameType(rec,StrName);      SetInstanceNameType(rec,StrName);
4985      SetInstanceNameStrPtr(rec,childname);      SetInstanceNameStrPtr(rec,childname);
4986      if((pos = ChildSearch(parent,&rec))){      if(0 != (pos = ChildSearch(parent,&rec))){
4987        if (InstanceChild(parent,pos)==NULL){ /* need to make array */        if (InstanceChild(parent,pos)==NULL){ /* need to make array */
4988          child = MakeSparseArray(parent,name,stat,NULL,0,NULL,NULL,NULL);          child = MakeSparseArray(parent,name,stat,NULL,0,NULL,NULL,NULL);
4989        } else {          /* need to add array element */        } else {          /* need to add array element */
# Line 6940  int CheckWhenSetNode(struct Instance *re Line 6940  int CheckWhenSetNode(struct Instance *re
6940      *p2=2;      *p2=2;
6941      return 1;      return 1;
6942    case e_var:    case e_var:
6943      if (GetEvaluationForTable() != NULL &&      if ((GetEvaluationForTable() != NULL) &&
6944        (str = SimpleNameIdPtr(ExprName(expr)))&&          (NULL != (str = SimpleNameIdPtr(ExprName(expr)))) &&
6945        (fvp=FindForVar(GetEvaluationForTable(),str))){          (NULL != (fvp=FindForVar(GetEvaluationForTable(),str)))) {
6946        if (GetForKind(fvp)==f_integer){        if (GetForKind(fvp)==f_integer){
6947          *p2=0;          *p2=0;
6948          return 1;          return 1;
# Line 7447  int CheckSelectSetNode(struct Instance * Line 7447  int CheckSelectSetNode(struct Instance *
7447         *p2=2;         *p2=2;
7448         return 1;         return 1;
7449      case e_var:      case e_var:
7450        if (GetEvaluationForTable() &&        if ((NULL != GetEvaluationForTable()) &&
7451           (str = SimpleNameIdPtr(ExprName(expr)))&&            (NULL != (str = SimpleNameIdPtr(ExprName(expr)))) &&
7452           (fvp=FindForVar(GetEvaluationForTable(),str))){            (NULL != (fvp=FindForVar(GetEvaluationForTable(),str)))) {
7453          if (GetForKind(fvp)==f_integer){          if (GetForKind(fvp)==f_integer){
7454            *p2=0;            *p2=0;
7455            return 1;            return 1;
# Line 8198  int ExecuteUnSelectedCOND(struct Instanc Line 8198  int ExecuteUnSelectedCOND(struct Instanc
8198    struct Statement *stat;    struct Statement *stat;
8199    unsigned long c,len;    unsigned long c,len;
8200    struct gl_list_t *list;    struct gl_list_t *list;
8201    int return_value;    int return_value = 0;
8202    
8203    sl = CondStatList(statement);    sl = CondStatList(statement);
8204    list = GetList(sl);    list = GetList(sl);
# Line 8499  struct Instance *MakeWhenInstance(struct Line 8499  struct Instance *MakeWhenInstance(struct
8499    if ((when_name=SimpleNameIdPtr(name))!=NULL){    if ((when_name=SimpleNameIdPtr(name))!=NULL){
8500      SetInstanceNameType(rec,StrName);      SetInstanceNameType(rec,StrName);
8501      SetInstanceNameStrPtr(rec,when_name);      SetInstanceNameStrPtr(rec,when_name);
8502      if((pos = ChildSearch(parent,&rec))){      if(0 != (pos = ChildSearch(parent,&rec))){
8503        assert(InstanceChild(parent,pos)==NULL);        assert(InstanceChild(parent,pos)==NULL);
8504        desc = FindWhenType();        desc = FindWhenType();
8505        child = CreateWhenInstance(desc);        child = CreateWhenInstance(desc);
# Line 8511  struct Instance *MakeWhenInstance(struct Line 8511  struct Instance *MakeWhenInstance(struct
8511      when_name = NameIdPtr(name);      when_name = NameIdPtr(name);
8512      SetInstanceNameType(rec,StrName);      SetInstanceNameType(rec,StrName);
8513      SetInstanceNameStrPtr(rec,when_name);      SetInstanceNameStrPtr(rec,when_name);
8514      if((pos = ChildSearch(parent,&rec))){      if(0 != (pos = ChildSearch(parent,&rec))){
8515        if (InstanceChild(parent,pos)==NULL){ /* need to make array */        if (InstanceChild(parent,pos)==NULL){ /* need to make array */
8516          child = MakeSparseArray(parent,name,stat,NULL,0,NULL,NULL,NULL);          child = MakeSparseArray(parent,name,stat,NULL,0,NULL,NULL,NULL);
8517        } else {          /* need to add array element */        } else {          /* need to add array element */
# Line 8535  void ExecuteWhenStatements(struct Instan Line 8535  void ExecuteWhenStatements(struct Instan
8535  {  {
8536    struct Statement *statement;    struct Statement *statement;
8537    unsigned long c,len;    unsigned long c,len;
8538    int return_value;    int return_value = 0;
8539    struct gl_list_t *list;    struct gl_list_t *list;
8540    list = GetList(sl);    list = GetList(sl);
8541    len = gl_length(list);    len = gl_length(list);
# Line 8676  void ExecuteUnSelectedWhenStatements(str Line 8676  void ExecuteUnSelectedWhenStatements(str
8676  {  {
8677    struct Statement *statement;    struct Statement *statement;
8678    unsigned long c,len;    unsigned long c,len;
8679    int return_value;    int return_value = 0;
8680    struct gl_list_t *list;    struct gl_list_t *list;
8681    list = GetList(sl);    list = GetList(sl);
8682    len = gl_length(list);    len = gl_length(list);
# Line 9615  void Pass2ExecuteForStatements(struct In Line 9615  void Pass2ExecuteForStatements(struct In
9615  {  {
9616    struct Statement *statement;    struct Statement *statement;
9617    unsigned long c,len;    unsigned long c,len;
9618    int return_value;    int return_value = 0;
9619    struct gl_list_t *list;    struct gl_list_t *list;
9620    list = GetList(sl);    list = GetList(sl);
9621    len = gl_length(list);    len = gl_length(list);
# Line 9705  void Pass1ExecuteForStatements(struct In Line 9705  void Pass1ExecuteForStatements(struct In
9705  {  {
9706    struct Statement *statement;    struct Statement *statement;
9707    unsigned long c,len;    unsigned long c,len;
9708    int return_value;    int return_value = 0;
9709    struct gl_list_t *list;    struct gl_list_t *list;
9710    list = GetList(sl);    list = GetList(sl);
9711    len = gl_length(list);    len = gl_length(list);

Legend:
Removed from v.89  
changed lines
  Added in v.97

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