Changeset e44d63b8 in OpenModelica
- Timestamp:
- 2016-04-06T16:22:29+02:00 (8 years ago)
- Branches:
- Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- 96898a5d
- Parents:
- df3f1c94
- git-author:
- Martin Sjölund <martin.sjolund@…> (04/06/16 16:22:29)
- git-committer:
- hudson <openmodelica@…> (04/06/16 16:22:29)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Compiler/FrontEnd/InstExtends.mo
r98214dc re44d63b8 46 46 public import DAE; 47 47 public import FCore; 48 public import HashTableStringToPath;49 48 public import InnerOuter; 50 49 public import SCode; … … 52 51 53 52 // protected imports 54 protected import BaseHashTable;53 protected import AvlSetString; 55 54 protected import ComponentReference; 56 55 protected import Debug; … … 115 114 list<SCode.AlgorithmSection> alg1, ialg1, alg2, ialg2; 116 115 DAE.Mod mod; 117 HashTableStringToPath.HashTable ht; 118 list<HashTableStringToPath.HashTable> lht; 116 AvlSetString.Tree tree; 119 117 array<FCore.Cache> cacheArr; 120 118 Boolean htHasEntries; … … 163 161 els1 := updateElementListVisibility(els1, el.visibility); 164 162 165 // Build a hashtablewith the constant elements from the extends scope.166 ht := HashTableStringToPath.emptyHashTableSized(BaseHashTable.lowBucketSize);167 ht:= getLocalIdentList(InstUtil.constantAndParameterEls(inElementsFromExtendsScope),168 ht, getLocalIdentElement);169 ht := getLocalIdentList(InstUtil.constantAndParameterEls(els1), ht, getLocalIdentElement);163 // Build a set with the constant elements from the extends scope. 164 tree := AvlSetString.new(); 165 tree := getLocalIdentList(InstUtil.constantAndParameterEls(inElementsFromExtendsScope), 166 tree, getLocalIdentElement); 167 tree := getLocalIdentList(InstUtil.constantAndParameterEls(els1), tree, getLocalIdentElement); 170 168 171 169 // Fully qualify modifiers in extends in the extends environment. 172 170 cacheArr := arrayCreate(1, outCache); 173 emod := fixModifications(cacheArr, inEnv, emod, {ht});171 emod := fixModifications(cacheArr, inEnv, emod, tree); 174 172 175 173 cenv := FGraph.openScope(cenv, encf, cn, FGraph.classInfToScopeType(inState)); … … 193 191 rest_els, clsext_els, els1, inState, inClassName, inImpl, inPartialInst); 194 192 195 ht := HashTableStringToPath.emptyHashTableSized(BaseHashTable.lowBucketSize); 196 ht := getLocalIdentList(els2, ht, getLocalIdentElementTpl); 197 ht := getLocalIdentList(cdef_els, ht, getLocalIdentElement); 198 ht := getLocalIdentList(import_els, ht, getLocalIdentElement); 199 htHasEntries := BaseHashTable.hashTableCurrentSize(ht)<>0; 200 lht := {ht}; 193 tree := AvlSetString.new(); 194 tree := getLocalIdentList(els2, tree, getLocalIdentElementTpl); 195 tree := getLocalIdentList(cdef_els, tree, getLocalIdentElement); 196 tree := getLocalIdentList(import_els, tree, getLocalIdentElement); 197 htHasEntries := not AvlSetString.isEmpty(tree); 201 198 202 199 arrayUpdate(cacheArr, 1, outCache); 203 200 if htHasEntries then 204 els2 := fixList(cacheArr, cenv, els2, lht, fixLocalIdent);201 els2 := fixList(cacheArr, cenv, els2, tree, fixLocalIdent); 205 202 end if; 206 203 // Update components with new merged modifiers. … … 215 212 if not inPartialInst then 216 213 if htHasEntries then 217 eq1 := fixList(cacheArr, cenv, eq1, lht, fixEquation);218 ieq1 := fixList(cacheArr, cenv, ieq1, lht, fixEquation);219 alg1 := fixList(cacheArr, cenv, alg1, lht, fixAlgorithm);220 ialg1 := fixList(cacheArr, cenv, ialg1, lht, fixAlgorithm);214 eq1 := fixList(cacheArr, cenv, eq1, tree, fixEquation); 215 ieq1 := fixList(cacheArr, cenv, ieq1, tree, fixEquation); 216 alg1 := fixList(cacheArr, cenv, alg1, tree, fixAlgorithm); 217 ialg1 := fixList(cacheArr, cenv, ialg1, tree, fixAlgorithm); 221 218 end if; 222 219 outNormalEqs := List.unionAppendListOnTrue(listReverse(eq1), outNormalEqs, valueEq); … … 811 808 " 812 809 input list<Type_A> ielts; 813 input HashTableStringToPath.HashTable inHt;810 input output AvlSetString.Tree tree; 814 811 input getIdentFn getIdent; 815 output HashTableStringToPath.HashTable outHt = inHt;816 812 817 813 replaceable type Type_A subtypeof Any; 818 814 partial function getIdentFn 819 815 input Type_A inA; 820 input HashTableStringToPath.HashTable inHt; 821 output HashTableStringToPath.HashTable outHt; 816 input output AvlSetString.Tree tree; 822 817 end getIdentFn; 823 818 algorithm 824 819 for elt in ielts loop 825 outHt := getIdent(elt, outHt);820 tree := getIdent(elt, tree); 826 821 end for; 827 822 end getLocalIdentList; … … 832 827 " 833 828 input tuple<SCode.Element,DAE.Mod,Boolean> eltTpl; 834 input HashTableStringToPath.HashTable ht; 835 output HashTableStringToPath.HashTable outHt; 829 input output AvlSetString.Tree tree; 836 830 protected 837 831 SCode.Element elt; 838 832 algorithm 839 833 (elt, _, _) := eltTpl; 840 outHt := getLocalIdentElement(elt, ht);834 tree := getLocalIdentElement(elt, tree); 841 835 end getLocalIdentElementTpl; 842 836 … … 845 839 as well as aliases from imports to paths." 846 840 input SCode.Element elt; 847 input HashTableStringToPath.HashTable inHt; 848 output HashTableStringToPath.HashTable outHt; 849 algorithm 850 (outHt) := matchcontinue elt 841 input output AvlSetString.Tree tree; 842 algorithm 843 tree := match elt 851 844 local 852 845 String id; 853 Absyn.Path p;854 846 855 847 case SCode.COMPONENT(name = id) 856 then BaseHashTable.add((id,Absyn.IDENT(id)), inHt);848 then AvlSetString.add(tree, id); 857 849 858 850 case SCode.CLASS(name = id) 859 then BaseHashTable.add((id,Absyn.IDENT(id)), inHt); 860 861 case SCode.IMPORT(imp = Absyn.NAMED_IMPORT(name = id, path = p)) 862 then BaseHashTable.addUnique((id, p), inHt); 863 864 case SCode.IMPORT(imp = Absyn.QUAL_IMPORT(path = p)) 865 then BaseHashTable.addUnique((Absyn.pathLastIdent(p), p), inHt); 866 867 // adrpo: 2010-10-07 handle unqualified imports!!! TODO! FIXME! should we just ignore them?? 868 // this fixes bug: #1234 https://openmodelica.org:8443/cb/issue/1234 869 case SCode.IMPORT(imp = Absyn.UNQUAL_IMPORT(path = p)) 870 then BaseHashTable.addUnique((Absyn.pathLastIdent(p), p), inHt); 871 872 else inHt; 873 end matchcontinue; 851 then AvlSetString.add(tree, id); 852 853 else tree; 854 end match; 874 855 end getLocalIdentElement; 875 856 … … 881 862 input FCore.Graph inEnv; 882 863 input output tuple<SCode.Element,DAE.Mod,Boolean> elt; 883 input list<HashTableStringToPath.HashTable> inHt;864 input AvlSetString.Tree tree; 884 865 protected 885 866 SCode.Element elt1,elt2; … … 888 869 algorithm 889 870 (elt1, mod, b) := elt; 890 elt2 := fixElement(inCache, inEnv, elt1, inHt);871 elt2 := fixElement(inCache, inEnv, elt1, tree); 891 872 if (not referenceEq(elt1, elt2)) or not b then 892 873 elt := (elt2, mod, true); … … 902 883 input FCore.Graph inEnv; 903 884 input SCode.Element inElt; 904 input list<HashTableStringToPath.HashTable> inHt;885 input AvlSetString.Tree tree; 905 886 output SCode.Element outElts; 906 887 algorithm 907 outElts := matchcontinue (inEnv,inElt ,inHt)888 outElts := matchcontinue (inEnv,inElt) 908 889 local 909 890 String name; … … 928 909 FCore.Cache cache; 929 910 FCore.Graph env; 930 list<HashTableStringToPath.HashTable> ht;931 911 SCode.Element elt; 932 912 933 913 case (env,SCode.COMPONENT(name, prefixes as SCode.PREFIXES(replaceablePrefix = SCode.REPLACEABLE(_)), 934 SCode.ATTR(ad, ct, prl, var, dir, isf), typeSpec, modifications, comment, condition, info) ,ht)914 SCode.ATTR(ad, ct, prl, var, dir, isf), typeSpec, modifications, comment, condition, info)) 935 915 equation 936 916 //fprintln(Flags.DEBUG,"fix comp " + SCodeDump.unparseElementStr(elt,SCodeDump.defaultOptions)); … … 938 918 (_, _, SCode.COMPONENT(name, prefixes, SCode.ATTR(ad, ct, prl, var, dir), typeSpec, modifications, comment, condition, info), 939 919 _, _, _) = Lookup.lookupIdentLocal(arrayGet(inCache, 1), env, name); 940 modifications = fixModifications(inCache,env,modifications, ht);941 typeSpec = fixTypeSpec(inCache,env,typeSpec, ht);942 ad = fixArrayDim(inCache, env, ad, ht);920 modifications = fixModifications(inCache,env,modifications,tree); 921 typeSpec = fixTypeSpec(inCache,env,typeSpec,tree); 922 ad = fixArrayDim(inCache, env, ad, tree); 943 923 then 944 924 (SCode.COMPONENT(name, prefixes, SCode.ATTR(ad, ct, prl, var, dir, isf), typeSpec, modifications, comment, condition, info)); 945 925 946 926 // we failed above 947 case (env,SCode.COMPONENT(name, prefixes, SCode.ATTR(ad, ct, prl, var, dir, isf), typeSpec, modifications, comment, condition, info) ,ht)927 case (env,SCode.COMPONENT(name, prefixes, SCode.ATTR(ad, ct, prl, var, dir, isf), typeSpec, modifications, comment, condition, info)) 948 928 equation 949 929 //fprintln(Flags.DEBUG,"fix comp " + SCodeDump.unparseElementStr(elt,SCodeDump.defaultOptions)); 950 modifications = fixModifications(inCache,env,modifications, ht);951 typeSpec = fixTypeSpec(inCache,env,typeSpec, ht);952 ad = fixArrayDim(inCache, env, ad, ht);930 modifications = fixModifications(inCache,env,modifications,tree); 931 typeSpec = fixTypeSpec(inCache,env,typeSpec,tree); 932 ad = fixArrayDim(inCache, env, ad, tree); 953 933 then 954 934 (SCode.COMPONENT(name, prefixes, SCode.ATTR(ad, ct, prl, var, dir, isf), typeSpec, modifications, comment, condition, info)); 955 935 956 936 case (env,SCode.CLASS(name, prefixes as SCode.PREFIXES(replaceablePrefix = SCode.REPLACEABLE(_)), 957 SCode.ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info) ,ht)937 SCode.ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info)) 958 938 equation 959 939 //fprintln(Flags.DEBUG,"fixClassdef " + name); … … 962 942 cmt = comment, info = info,classDef=classDef),_) = Lookup.lookupClassLocal(env, name); 963 943 env = FGraph.openScope(env, SCode.ENCAPSULATED(), name, FGraph.restrictionToScopeType(restriction)); 964 classDef = fixClassdef(inCache, env,classDef, ht);944 classDef = fixClassdef(inCache, env,classDef,tree); 965 945 then 966 946 (SCode.CLASS(name, prefixes, SCode.ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info)); 967 947 968 948 // failed above 969 case (env,SCode.CLASS(name, prefixes, SCode.ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info) ,ht)949 case (env,SCode.CLASS(name, prefixes, SCode.ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info)) 970 950 equation 971 951 //fprintln(Flags.DEBUG,"fixClassdef " + name); 972 952 env = FGraph.openScope(env, SCode.ENCAPSULATED(), name, FGraph.restrictionToScopeType(restriction)); 973 classDef = fixClassdef(inCache, env,classDef, ht);953 classDef = fixClassdef(inCache, env,classDef,tree); 974 954 then 975 955 (SCode.CLASS(name, prefixes, SCode.ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info)); 976 956 977 957 case (env,SCode.CLASS(name, prefixes as SCode.PREFIXES(replaceablePrefix = SCode.REPLACEABLE(_)), 978 SCode.NOT_ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info) ,ht)958 SCode.NOT_ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info)) 979 959 equation 980 960 //fprintln(Flags.DEBUG,"fixClassdef " + name + str); … … 984 964 985 965 env = FGraph.openScope(env, SCode.NOT_ENCAPSULATED(), name, FGraph.restrictionToScopeType(restriction)); 986 classDef = fixClassdef(inCache,env,classDef, ht);966 classDef = fixClassdef(inCache,env,classDef,tree); 987 967 then 988 968 (SCode.CLASS(name, prefixes, SCode.NOT_ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info)); 989 969 990 970 // failed above 991 case (env,SCode.CLASS(name, prefixes, SCode.NOT_ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info) ,ht)971 case (env,SCode.CLASS(name, prefixes, SCode.NOT_ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info)) 992 972 equation 993 973 //fprintln(Flags.DEBUG,"fixClassdef " + name + str); 994 974 env = FGraph.openScope(env, SCode.NOT_ENCAPSULATED(), name, FGraph.restrictionToScopeType(restriction)); 995 classDef = fixClassdef(inCache,env,classDef, ht);975 classDef = fixClassdef(inCache,env,classDef,tree); 996 976 then 997 977 (SCode.CLASS(name, prefixes, SCode.NOT_ENCAPSULATED(), partialPrefix, restriction, classDef, comment, info)); 998 978 999 case (env,SCode.EXTENDS(extendsPath,vis,modifications,optAnnotation,info) ,ht)979 case (env,SCode.EXTENDS(extendsPath,vis,modifications,optAnnotation,info)) 1000 980 equation 1001 981 //fprintln(Flags.DEBUG,"fix extends " + SCodeDump.unparseElementStr(elt,SCodeDump.defaultOptions)); 1002 extendsPath = fixPath(inCache,env,extendsPath, ht);1003 modifications = fixModifications(inCache,env,modifications, ht);982 extendsPath = fixPath(inCache,env,extendsPath,tree); 983 modifications = fixModifications(inCache,env,modifications,tree); 1004 984 then 1005 985 (SCode.EXTENDS(extendsPath,vis,modifications,optAnnotation,info)); 1006 986 1007 case (_,SCode.IMPORT() ,_) then inElt;1008 1009 case (_,elt ,_)987 case (_,SCode.IMPORT()) then inElt; 988 989 case (_,elt) 1010 990 equation 1011 991 true = Flags.isSet(Flags.FAILTRACE); … … 1023 1003 input FCore.Graph inEnv; 1024 1004 input SCode.ClassDef inCd; 1025 input list<HashTableStringToPath.HashTable> inHt;1005 input AvlSetString.Tree inTree; 1026 1006 output SCode.ClassDef outCd; 1027 algorithm 1028 outCd := matchcontinue (inEnv,inCd,inHt) 1007 protected 1008 AvlSetString.Tree tree=inTree; 1009 algorithm 1010 outCd := matchcontinue (inEnv,inCd) 1029 1011 local 1030 list<SCode.Element> elts ;1031 list<SCode.Equation> ne, ie;1032 list<SCode.AlgorithmSection> na, ia;1033 list<SCode.ConstraintSection> nc ;1012 list<SCode.Element> elts,elts_1; 1013 list<SCode.Equation> ne,ne_1,ie,ie_1; 1014 list<SCode.AlgorithmSection> na,na_1,ia,ia_1; 1015 list<SCode.ConstraintSection> nc,nc_1; 1034 1016 list<Absyn.NamedArg> clats; 1035 1017 Option<SCode.ExternalDecl> ed; 1036 1018 list<SCode.Annotation> ann; 1037 1019 Option<SCode.Comment> c; 1038 Absyn.TypeSpec ts ;1020 Absyn.TypeSpec ts,ts_1; 1039 1021 SCode.Attributes attr; 1040 1022 String name; 1041 SCode.Mod mod ;1023 SCode.Mod mod,mod_1; 1042 1024 FCore.Graph env; 1043 list<HashTableStringToPath.HashTable> ht; 1044 HashTableStringToPath.HashTable cls_ht; 1045 SCode.ClassDef cd; 1046 1047 case (env,SCode.PARTS(elts,ne,ie,na,ia,nc,clats,ed),ht) 1025 SCode.ClassDef cd,cd_1; 1026 1027 case (env,SCode.PARTS(elts,ne,ie,na,ia,nc,clats,ed)) 1048 1028 algorithm 1049 if not listEmpty(elts) then 1050 cls_ht := HashTableStringToPath.emptyHashTableSized(Util.nextPrime(listLength(elts))); 1051 cls_ht := getLocalIdentList(elts, cls_ht, getLocalIdentElement); 1052 ht := cls_ht :: ht; 1053 end if; 1054 1055 elts := fixList(cache,env,elts,ht,fixElement); 1056 ne := fixList(cache,env,ne,ht,fixEquation); 1057 ie := fixList(cache,env,ie,ht,fixEquation); 1058 na := fixList(cache,env,na,ht,fixAlgorithm); 1059 ia := fixList(cache,env,ia,ht,fixAlgorithm); 1060 nc := fixList(cache,env,nc,ht,fixConstraint); 1061 then SCode.PARTS(elts,ne,ie,na,ia,nc,clats,ed); 1062 1063 case (env,SCode.CLASS_EXTENDS(name,mod,SCode.PARTS(elts,ne,ie,na,ia,nc,clats,ed)),ht) 1064 equation 1065 mod = fixModifications(cache,env,mod,ht); 1066 elts = fixList(cache,env,elts,ht,fixElement); 1067 ne = fixList(cache,env,ne,ht,fixEquation); 1068 ie = fixList(cache,env,ie,ht,fixEquation); 1069 na = fixList(cache,env,na,ht,fixAlgorithm); 1070 ia = fixList(cache,env,ia,ht,fixAlgorithm); 1071 nc = fixList(cache,env,nc,ht,fixConstraint); 1072 then (SCode.CLASS_EXTENDS(name,mod,SCode.PARTS(elts,ne,ie,na,ia,nc,clats,ed))); 1073 1074 case (env,SCode.DERIVED(ts,mod,attr),ht) 1075 equation 1076 ts = fixTypeSpec(cache,env,ts,ht); 1077 mod = fixModifications(cache,env,mod,ht); 1078 then SCode.DERIVED(ts,mod,attr); 1079 1080 case (_,cd as SCode.ENUMERATION(),_) then cd; 1081 case (_,cd as SCode.OVERLOAD(),_) then cd; 1082 case (_,cd as SCode.PDER(),_) then cd; 1083 1084 case (_,cd,_) 1029 tree := getLocalIdentList(elts, tree, getLocalIdentElement); 1030 elts_1 := fixList(cache,env,elts,tree,fixElement); 1031 ne_1 := fixList(cache,env,ne,tree,fixEquation); 1032 ie_1 := fixList(cache,env,ie,tree,fixEquation); 1033 na_1 := fixList(cache,env,na,tree,fixAlgorithm); 1034 ia_1 := fixList(cache,env,ia,tree,fixAlgorithm); 1035 nc_1 := fixList(cache,env,nc,tree,fixConstraint); 1036 then if referenceEq(elts,elts_1) and referenceEq(ne,ne_1) and referenceEq(ie,ie_1) and referenceEq(na,na_1) and referenceEq(ia,ia_1) and referenceEq(nc,nc_1) 1037 then inCd else SCode.PARTS(elts_1,ne_1,ie_1,na_1,ia_1,nc_1,clats,ed); 1038 1039 case (env,SCode.CLASS_EXTENDS(name,mod,cd as SCode.PARTS(elts,ne,ie,na,ia,nc,clats,ed))) 1040 equation 1041 mod_1 = fixModifications(cache,env,mod,inTree); 1042 elts_1 = fixList(cache,env,elts,tree,fixElement); 1043 ne_1 = fixList(cache,env,ne,tree,fixEquation); 1044 ie_1 = fixList(cache,env,ie,tree,fixEquation); 1045 na_1 = fixList(cache,env,na,tree,fixAlgorithm); 1046 ia_1 = fixList(cache,env,ia,tree,fixAlgorithm); 1047 nc_1 = fixList(cache,env,nc,tree,fixConstraint); 1048 cd_1 = if referenceEq(elts,elts_1) and referenceEq(ne,ne_1) and referenceEq(ie,ie_1) and referenceEq(na,na_1) and referenceEq(ia,ia_1) and referenceEq(nc,nc_1) 1049 then cd else SCode.PARTS(elts_1,ne_1,ie_1,na_1,ia_1,nc_1,clats,ed); 1050 then if referenceEq(cd,cd_1) and referenceEq(mod,mod_1) 1051 then inCd else SCode.CLASS_EXTENDS(name,mod_1,cd_1); 1052 1053 case (env,SCode.DERIVED(ts,mod,attr)) 1054 equation 1055 ts_1 = fixTypeSpec(cache,env,ts,tree); 1056 mod_1 = fixModifications(cache,env,mod,tree); 1057 then if referenceEq(ts,ts_1) and referenceEq(mod,mod_1) then inCd else SCode.DERIVED(ts_1,mod_1,attr); 1058 1059 case (_,cd as SCode.ENUMERATION()) then cd; 1060 case (_,cd as SCode.OVERLOAD()) then cd; 1061 case (_,cd as SCode.PDER()) then cd; 1062 1063 case (_,cd) 1085 1064 equation 1086 1065 true = Flags.isSet(Flags.FAILTRACE); … … 1100 1079 input FCore.Graph inEnv; 1101 1080 input SCode.Equation inEq; 1102 input list<HashTableStringToPath.HashTable> inHt;1081 input AvlSetString.Tree tree; 1103 1082 output SCode.Equation outEq; 1104 1083 algorithm … … 1109 1088 case SCode.EQUATION(eeq) 1110 1089 algorithm 1111 eeq := fixEEquation(inCache, inEnv, eeq, inHt);1090 eeq := fixEEquation(inCache, inEnv, eeq, tree); 1112 1091 then SCode.EQUATION(eeq); 1113 1092 … … 1128 1107 input FCore.Graph inEnv; 1129 1108 input SCode.EEquation inEeq; 1130 input list<HashTableStringToPath.HashTable> inHt;1109 input AvlSetString.Tree tree; 1131 1110 output SCode.EEquation outEeq; 1132 1111 algorithm … … 1146 1125 case SCode.EQ_IF(expl,eqll,eql,comment,info) 1147 1126 equation 1148 expl = fixList(cache,inEnv,expl, inHt,fixExp);1149 eqll = fixListList(cache,inEnv,eqll, inHt,fixEEquation);1150 eql = fixList(cache,inEnv,eql, inHt,fixEEquation);1127 expl = fixList(cache,inEnv,expl,tree,fixExp); 1128 eqll = fixListList(cache,inEnv,eqll,tree,fixEEquation); 1129 eql = fixList(cache,inEnv,eql,tree,fixEEquation); 1151 1130 then (SCode.EQ_IF(expl,eqll,eql,comment,info)); 1152 1131 case SCode.EQ_EQUALS(exp1,exp2,comment,info) 1153 1132 equation 1154 exp1 = fixExp(cache,inEnv,exp1, inHt);1155 exp2 = fixExp(cache,inEnv,exp2, inHt);1133 exp1 = fixExp(cache,inEnv,exp1,tree); 1134 exp2 = fixExp(cache,inEnv,exp2,tree); 1156 1135 then (SCode.EQ_EQUALS(exp1,exp2,comment,info)); 1157 1136 case SCode.EQ_PDE(exp1,exp2,cref,comment,info) 1158 1137 equation 1159 exp1 = fixExp(cache,inEnv,exp1, inHt);1160 exp2 = fixExp(cache,inEnv,exp2, inHt);1161 cref = fixCref(cache,inEnv,cref, inHt);1138 exp1 = fixExp(cache,inEnv,exp1,tree); 1139 exp2 = fixExp(cache,inEnv,exp2,tree); 1140 cref = fixCref(cache,inEnv,cref,tree); 1162 1141 then (SCode.EQ_PDE(exp1,exp2,cref,comment,info)); 1163 1142 case SCode.EQ_CONNECT(cref1,cref2,comment,info) 1164 1143 equation 1165 cref1 = fixCref(cache,inEnv,cref1, inHt);1166 cref2 = fixCref(cache,inEnv,cref2, inHt);1144 cref1 = fixCref(cache,inEnv,cref1,tree); 1145 cref2 = fixCref(cache,inEnv,cref2,tree); 1167 1146 then (SCode.EQ_CONNECT(cref1,cref2,comment,info)); 1168 1147 case SCode.EQ_FOR(id,optExp,eql,comment,info) 1169 1148 equation 1170 optExp = fixOption(cache,inEnv,optExp, inHt,fixExp);1171 eql = fixList(cache,inEnv,eql, inHt,fixEEquation);1149 optExp = fixOption(cache,inEnv,optExp,tree,fixExp); 1150 eql = fixList(cache,inEnv,eql,tree,fixEEquation); 1172 1151 then (SCode.EQ_FOR(id,optExp,eql,comment,info)); 1173 1152 case SCode.EQ_WHEN(exp,eql,whenlst,comment,info) 1174 1153 equation 1175 exp = fixExp(cache,inEnv,exp, inHt);1176 eql = fixList(cache,inEnv,eql, inHt,fixEEquation);1177 whenlst = fixListTuple2(cache,inEnv,whenlst, inHt,fixExp,fixListEEquation);1154 exp = fixExp(cache,inEnv,exp,tree); 1155 eql = fixList(cache,inEnv,eql,tree,fixEEquation); 1156 whenlst = fixListTuple2(cache,inEnv,whenlst,tree,fixExp,fixListEEquation); 1178 1157 then (SCode.EQ_WHEN(exp,eql,whenlst,comment,info)); 1179 1158 case SCode.EQ_ASSERT(exp1,exp2,exp3,comment,info) 1180 1159 equation 1181 exp1 = fixExp(cache,inEnv,exp1, inHt);1182 exp2 = fixExp(cache,inEnv,exp2, inHt);1183 exp3 = fixExp(cache,inEnv,exp3, inHt);1160 exp1 = fixExp(cache,inEnv,exp1,tree); 1161 exp2 = fixExp(cache,inEnv,exp2,tree); 1162 exp3 = fixExp(cache,inEnv,exp3,tree); 1184 1163 then (SCode.EQ_ASSERT(exp1,exp2,exp3,comment,info)); 1185 1164 case SCode.EQ_TERMINATE(exp,comment,info) 1186 1165 equation 1187 exp = fixExp(cache,inEnv,exp, inHt);1166 exp = fixExp(cache,inEnv,exp,tree); 1188 1167 then (SCode.EQ_TERMINATE(exp,comment,info)); 1189 1168 case SCode.EQ_REINIT(cref,exp,comment,info) 1190 1169 equation 1191 cref = fixCref(cache,inEnv,cref, inHt);1192 exp = fixExp(cache,inEnv,exp, inHt);1170 cref = fixCref(cache,inEnv,cref,tree); 1171 exp = fixExp(cache,inEnv,exp,tree); 1193 1172 then (SCode.EQ_REINIT(cref,exp,comment,info)); 1194 1173 case SCode.EQ_NORETCALL(exp,comment,info) 1195 1174 equation 1196 exp = fixExp(cache,inEnv,exp, inHt);1175 exp = fixExp(cache,inEnv,exp,tree); 1197 1176 then (SCode.EQ_NORETCALL(exp,comment,info)); 1198 1177 end match; … … 1207 1186 input FCore.Graph env; 1208 1187 input list<SCode.EEquation> eeq; 1209 input list<HashTableStringToPath.HashTable> ht;1188 input AvlSetString.Tree tree; 1210 1189 output list<SCode.EEquation> outEeq; 1211 1190 algorithm 1212 outEeq := fixList(cache,env,eeq, ht,fixEEquation);1191 outEeq := fixList(cache,env,eeq,tree,fixEEquation); 1213 1192 end fixListEEquation; 1214 1193 … … 1221 1200 input FCore.Graph inEnv; 1222 1201 input SCode.AlgorithmSection inAlg; 1223 input list<HashTableStringToPath.HashTable> inHt;1202 input AvlSetString.Tree tree; 1224 1203 output SCode.AlgorithmSection outAlg; 1225 1204 protected … … 1227 1206 algorithm 1228 1207 SCode.ALGORITHM(stmts) := inAlg; 1229 stmts := fixList(inCache, inEnv, stmts, inHt, fixStatement);1208 stmts := fixList(inCache, inEnv, stmts, tree, fixStatement); 1230 1209 outAlg := SCode.ALGORITHM(stmts); 1231 1210 end fixAlgorithm; … … 1239 1218 input FCore.Graph inEnv; 1240 1219 input SCode.ConstraintSection inConstrs; 1241 input list<HashTableStringToPath.HashTable> inHt;1220 input AvlSetString.Tree tree; 1242 1221 output SCode.ConstraintSection outConstrs; 1243 1222 protected … … 1245 1224 algorithm 1246 1225 SCode.CONSTRAINTS(exps) := inConstrs; 1247 exps := fixList(inCache, inEnv, exps, inHt, fixExp);1226 exps := fixList(inCache, inEnv, exps, tree, fixExp); 1248 1227 outConstrs := SCode.CONSTRAINTS(exps); 1249 1228 end fixConstraint; … … 1257 1236 input FCore.Graph env; 1258 1237 input list<SCode.Statement> alg; 1259 input list<HashTableStringToPath.HashTable> ht;1238 input AvlSetString.Tree tree; 1260 1239 output list<SCode.Statement> outAlg; 1261 1240 algorithm 1262 outAlg := fixList(cache,env,alg, ht,fixStatement);1241 outAlg := fixList(cache,env,alg,tree,fixStatement); 1263 1242 end fixListAlgorithmItem; 1264 1243 … … 1271 1250 input FCore.Graph inEnv; 1272 1251 input SCode.Statement inStmt; 1273 input list<HashTableStringToPath.HashTable> inHt;1252 input AvlSetString.Tree tree; 1274 1253 output SCode.Statement outStmt; 1275 1254 algorithm … … 1288 1267 case SCode.ALG_ASSIGN(exp1,exp2,comment,info) 1289 1268 equation 1290 exp1 = fixExp(cache,inEnv,exp1, inHt);1291 exp2 = fixExp(cache,inEnv,exp2, inHt);1269 exp1 = fixExp(cache,inEnv,exp1,tree); 1270 exp2 = fixExp(cache,inEnv,exp2,tree); 1292 1271 then SCode.ALG_ASSIGN(exp1,exp2,comment,info); 1293 1272 1294 1273 case SCode.ALG_IF(exp,truebranch,elseifbranch,elsebranch,comment,info) 1295 1274 equation 1296 exp = fixExp(cache,inEnv,exp, inHt);1297 truebranch = fixList(cache,inEnv,truebranch, inHt,fixStatement);1298 elseifbranch = fixListTuple2(cache,inEnv,elseifbranch, inHt,fixExp,fixListAlgorithmItem);1299 elsebranch = fixList(cache,inEnv,elsebranch, inHt,fixStatement);1275 exp = fixExp(cache,inEnv,exp,tree); 1276 truebranch = fixList(cache,inEnv,truebranch,tree,fixStatement); 1277 elseifbranch = fixListTuple2(cache,inEnv,elseifbranch,tree,fixExp,fixListAlgorithmItem); 1278 elsebranch = fixList(cache,inEnv,elsebranch,tree,fixStatement); 1300 1279 then SCode.ALG_IF(exp,truebranch,elseifbranch,elsebranch,comment,info); 1301 1280 1302 1281 case SCode.ALG_FOR(iter,optExp,forbody,comment,info) 1303 1282 equation 1304 optExp = fixOption(cache,inEnv,optExp, inHt,fixExp);1305 forbody = fixList(cache,inEnv,forbody, inHt,fixStatement);1283 optExp = fixOption(cache,inEnv,optExp,tree,fixExp); 1284 forbody = fixList(cache,inEnv,forbody,tree,fixStatement); 1306 1285 then SCode.ALG_FOR(iter,optExp,forbody,comment,info); 1307 1286 1308 1287 case SCode.ALG_PARFOR(iter,optExp,forbody,comment,info) 1309 1288 equation 1310 optExp = fixOption(cache,inEnv,optExp, inHt,fixExp);1311 forbody = fixList(cache,inEnv,forbody, inHt,fixStatement);1289 optExp = fixOption(cache,inEnv,optExp,tree,fixExp); 1290 forbody = fixList(cache,inEnv,forbody,tree,fixStatement); 1312 1291 then SCode.ALG_PARFOR(iter,optExp,forbody,comment,info); 1313 1292 1314 1293 case SCode.ALG_WHILE(exp,whilebody,comment,info) 1315 1294 equation 1316 exp = fixExp(cache,inEnv,exp, inHt);1317 whilebody = fixList(cache,inEnv,whilebody, inHt,fixStatement);1295 exp = fixExp(cache,inEnv,exp,tree); 1296 whilebody = fixList(cache,inEnv,whilebody,tree,fixStatement); 1318 1297 then SCode.ALG_WHILE(exp,whilebody,comment,info); 1319 1298 1320 1299 case SCode.ALG_WHEN_A(whenlst,comment,info) 1321 1300 equation 1322 whenlst = fixListTuple2(cache,inEnv,whenlst, inHt,fixExp,fixListAlgorithmItem);1301 whenlst = fixListTuple2(cache,inEnv,whenlst,tree,fixExp,fixListAlgorithmItem); 1323 1302 then SCode.ALG_WHEN_A(whenlst,comment,info); 1324 1303 1325 1304 case SCode.ALG_ASSERT(exp, exp1, exp2, comment, info) 1326 1305 algorithm 1327 exp := fixExp(cache, inEnv, exp, inHt);1328 exp1 := fixExp(cache, inEnv, exp1, inHt);1329 exp2 := fixExp(cache, inEnv, exp2, inHt);1306 exp := fixExp(cache, inEnv, exp, tree); 1307 exp1 := fixExp(cache, inEnv, exp1, tree); 1308 exp2 := fixExp(cache, inEnv, exp2, tree); 1330 1309 then SCode.ALG_ASSERT(exp, exp1, exp2, comment, info); 1331 1310 1332 1311 case SCode.ALG_TERMINATE(exp, comment, info) 1333 1312 algorithm 1334 exp := fixExp(cache, inEnv, exp, inHt);1313 exp := fixExp(cache, inEnv, exp, tree); 1335 1314 then SCode.ALG_TERMINATE(exp, comment, info); 1336 1315 1337 1316 case SCode.ALG_REINIT(cr, exp, comment, info) 1338 1317 algorithm 1339 cr := fixCref(cache, inEnv, cr, inHt);1340 exp := fixExp(cache, inEnv, exp, inHt);1318 cr := fixCref(cache, inEnv, cr, tree); 1319 exp := fixExp(cache, inEnv, exp, tree); 1341 1320 then SCode.ALG_REINIT(cr, exp, comment, info); 1342 1321 1343 1322 case SCode.ALG_NORETCALL(exp,comment,info) 1344 1323 equation 1345 exp = fixExp(cache,inEnv,exp, inHt);1324 exp = fixExp(cache,inEnv,exp,tree); 1346 1325 then SCode.ALG_NORETCALL(exp,comment,info); 1347 1326 … … 1366 1345 input FCore.Graph inEnv; 1367 1346 input output Absyn.ArrayDim ads; 1368 input list<HashTableStringToPath.HashTable> inHt;1369 algorithm 1370 ads := fixList(inCache, inEnv, ads, inHt, fixSubscript);1347 input AvlSetString.Tree tree; 1348 algorithm 1349 ads := fixList(inCache, inEnv, ads, tree, fixSubscript); 1371 1350 end fixArrayDim; 1372 1351 … … 1379 1358 input FCore.Graph inEnv; 1380 1359 input Absyn.Subscript inSub; 1381 input list<HashTableStringToPath.HashTable> inHt;1360 input AvlSetString.Tree tree; 1382 1361 output Absyn.Subscript outSub; 1383 1362 algorithm … … 1389 1368 case Absyn.SUBSCRIPT(exp) 1390 1369 algorithm 1391 exp := fixExp(cache, inEnv, exp, inHt);1370 exp := fixExp(cache, inEnv, exp, tree); 1392 1371 then Absyn.SUBSCRIPT(exp); 1393 1372 end match; … … 1402 1381 input FCore.Graph inEnv; 1403 1382 input Absyn.TypeSpec inTs; 1404 input list<HashTableStringToPath.HashTable> inHt;1383 input AvlSetString.Tree tree; 1405 1384 output Absyn.TypeSpec outTs; 1406 1385 algorithm … … 1413 1392 case Absyn.TPATH(path,arrayDim) 1414 1393 equation 1415 arrayDim = fixOption(cache,inEnv,arrayDim, inHt,fixArrayDim);1416 path = fixPath(cache,inEnv,path, inHt);1394 arrayDim = fixOption(cache,inEnv,arrayDim,tree,fixArrayDim); 1395 path = fixPath(cache,inEnv,path,tree); 1417 1396 then Absyn.TPATH(path,arrayDim); 1418 1397 case Absyn.TCOMPLEX(path,typeSpecs,arrayDim) 1419 1398 equation 1420 arrayDim = fixOption(cache,inEnv,arrayDim, inHt,fixArrayDim);1421 path = fixPath(cache,inEnv,path, inHt);1422 typeSpecs = fixList(cache,inEnv,typeSpecs, inHt,fixTypeSpec);1399 arrayDim = fixOption(cache,inEnv,arrayDim,tree,fixArrayDim); 1400 path = fixPath(cache,inEnv,path,tree); 1401 typeSpecs = fixList(cache,inEnv,typeSpecs,tree,fixTypeSpec); 1423 1402 then Absyn.TCOMPLEX(path,typeSpecs,arrayDim); 1424 1403 end match; … … 1432 1411 input FCore.Graph inEnv; 1433 1412 input Absyn.Path inPath; 1434 input list<HashTableStringToPath.HashTable> inHt;1413 input AvlSetString.Tree tree; 1435 1414 output Absyn.Path outPath; 1436 1415 algorithm … … 1447 1426 equation 1448 1427 id = Absyn.pathFirstIdent(inPath); 1449 path2 = lookupName(id, inHt); 1450 path2 = Absyn.pathReplaceFirstIdent(inPath, path2); 1451 path2 = FGraph.pathStripGraphScopePrefix(path2, inEnv, false); 1428 true = AvlSetString.hasKey(tree, id); 1429 path2 = FGraph.pathStripGraphScopePrefix(inPath, inEnv, false); 1452 1430 //fprintln(Flags.DEBUG, "Replacing: " + Absyn.pathString(inPath) + " with " + Absyn.pathString(path2) + " s:" + FGraph.printGraphPathStr(inEnv)); 1453 1431 then path2; … … 1481 1459 end matchcontinue; 1482 1460 end fixPath; 1483 1484 protected function lookupName1485 input String inName;1486 input list<HashTableStringToPath.HashTable> inHT;1487 output Absyn.Path outPath;1488 algorithm1489 for ht in inHT loop1490 try1491 outPath := BaseHashTable.get(inName, ht);1492 return;1493 else1494 end try;1495 end for;1496 fail();1497 end lookupName;1498 1461 1499 1462 protected function lookupVarNoErrorMessage … … 1521 1484 input FCore.Graph inEnv; 1522 1485 input Absyn.ComponentRef inCref; 1523 input list<HashTableStringToPath.HashTable> inHt;1486 input AvlSetString.Tree tree; 1524 1487 output Absyn.ComponentRef outCref; 1525 1488 algorithm 1526 outCref := matchcontinue (inEnv,inCref ,inHt)1489 outCref := matchcontinue (inEnv,inCref) 1527 1490 local 1528 1491 String id; … … 1530 1493 DAE.ComponentRef cref_; 1531 1494 FCore.Graph env, denv; 1532 list<HashTableStringToPath.HashTable> ht;1533 1495 Absyn.ComponentRef cref; 1534 1496 SCode.Element c; 1535 1497 Boolean isOutside; 1536 1498 1537 case (env,cref ,ht)1499 case (env,cref) 1538 1500 equation 1539 1501 id = Absyn.crefFirstIdent(cref); 1540 //fprintln(Flags.DEBUG,"Try ht lookup " + id); 1541 path = lookupName(id, ht); 1542 //fprintln(Flags.DEBUG,"Got path " + Absyn.pathString(path)); 1543 cref = Absyn.crefReplaceFirstIdent(cref,path); 1502 true = AvlSetString.hasKey(tree, id); 1544 1503 cref = FGraph.crefStripGraphScopePrefix(cref, env, false); 1545 //fprintln(Flags.DEBUG, "Cref HT fixed: " + Absyn.printComponentRefStr(cref));1546 1504 cref = if Absyn.crefEqual(cref, inCref) then inCref else cref; 1547 1505 then cref; 1548 1506 1549 1507 // try lookup var (constant in a package?) 1550 case (env,cref ,_)1508 case (env,cref) 1551 1509 equation 1552 1510 id = Absyn.crefFirstIdent(cref); … … 1564 1522 then cref; 1565 1523 1566 case (env,cref ,_)1524 case (env,cref) 1567 1525 equation 1568 1526 id = Absyn.crefFirstIdent(cref); … … 1594 1552 input FCore.Graph inEnv; 1595 1553 input SCode.Mod inMod; 1596 input list<HashTableStringToPath.HashTable> inHT;1554 input AvlSetString.Tree tree; 1597 1555 output SCode.Mod outMod = inMod; 1598 1556 algorithm … … 1608 1566 case SCode.MOD() 1609 1567 algorithm 1610 subModLst := fixList(inCache, inEnv, outMod.subModLst, inHT, fixSubMod);1568 subModLst := fixList(inCache, inEnv, outMod.subModLst, tree, fixSubMod); 1611 1569 outMod.subModLst := subModLst; 1612 1570 1613 1571 if isSome(outMod.binding) then 1614 1572 SOME(exp) := outMod.binding; 1615 exp := fixExp(inCache, inEnv, exp, inHT);1573 exp := fixExp(inCache, inEnv, exp, tree); 1616 1574 outMod.binding := SOME(exp); 1617 1575 end if; … … 1620 1578 case SCode.REDECL(element = SCode.COMPONENT()) 1621 1579 algorithm 1622 e := fixElement(inCache, inEnv, outMod.element, inHT);1580 e := fixElement(inCache, inEnv, outMod.element, tree); 1623 1581 outMod.element := e; 1624 1582 then outMod; … … 1626 1584 case SCode.REDECL(element = e as SCode.CLASS(classDef = cdef)) 1627 1585 algorithm 1628 cdef := fixClassdef(inCache, inEnv, cdef, inHT);1586 cdef := fixClassdef(inCache, inEnv, cdef, tree); 1629 1587 e.classDef := cdef; 1630 1588 outMod.element := e; … … 1648 1606 input FCore.Graph inEnv; 1649 1607 input output SCode.SubMod subMod; 1650 input list<HashTableStringToPath.HashTable> inHt;1608 input AvlSetString.Tree tree; 1651 1609 protected 1652 1610 Absyn.Ident ident; … … 1654 1612 algorithm 1655 1613 SCode.NAMEMOD(ident, mod1) := subMod; 1656 mod2 := fixModifications(inCache, inEnv, mod1, inHt);1614 mod2 := fixModifications(inCache, inEnv, mod1, tree); 1657 1615 if not referenceEq(mod1, mod2) then 1658 1616 subMod := SCode.NAMEMOD(ident, mod2); … … 1668 1626 input FCore.Graph inEnv; 1669 1627 input Absyn.Exp inExp; 1670 input list<HashTableStringToPath.HashTable> inHt;1628 input AvlSetString.Tree tree; 1671 1629 output Absyn.Exp outExp; 1672 1630 algorithm 1673 (outExp,_) := Absyn.traverseExp(inExp,fixExpTraverse,(cache,inEnv, inHt));1631 (outExp,_) := Absyn.traverseExp(inExp,fixExpTraverse,(cache,inEnv,tree)); 1674 1632 end fixExp; 1675 1633 … … 1680 1638 " 1681 1639 input output Absyn.Exp exp; 1682 input output tuple<array<FCore.Cache>,FCore.Graph, list<HashTableStringToPath.HashTable>> tpl;1640 input output tuple<array<FCore.Cache>,FCore.Graph,AvlSetString.Tree> tpl; 1683 1641 algorithm 1684 1642 exp := match (exp,tpl) … … 1689 1647 array<FCore.Cache> cache; 1690 1648 FCore.Graph env; 1691 list<HashTableStringToPath.HashTable> ht;1692 1693 case (Absyn.CREF(cref),(cache,env, ht))1694 equation 1695 cref1 = fixCref(cache,env,cref, ht);1649 AvlSetString.Tree tree; 1650 1651 case (Absyn.CREF(cref),(cache,env,tree)) 1652 equation 1653 cref1 = fixCref(cache,env,cref,tree); 1696 1654 then (if referenceEq(cref, cref1) then exp else Absyn.CREF(cref1)); 1697 1655 1698 case (Absyn.CALL(cref,fargs),(cache,env, ht))1656 case (Absyn.CALL(cref,fargs),(cache,env,tree)) 1699 1657 equation 1700 1658 // print("cref actual: " + Absyn.crefString(cref) + " scope: " + FGraph.printGraphPathStr(env) + "\n"); 1701 cref1 = fixCref(cache,env,cref, ht);1659 cref1 = fixCref(cache,env,cref,tree); 1702 1660 // print("cref fixed : " + Absyn.crefString(cref) + "\n"); 1703 1661 then (if referenceEq(cref, cref1) then exp else Absyn.CALL(cref1,fargs)); 1704 1662 1705 case (Absyn.PARTEVALFUNCTION(cref,fargs),(cache,env, ht))1706 equation 1707 cref1 = fixCref(cache,env,cref, ht);1663 case (Absyn.PARTEVALFUNCTION(cref,fargs),(cache,env,tree)) 1664 equation 1665 cref1 = fixCref(cache,env,cref,tree); 1708 1666 then (if referenceEq(cref, cref1) then exp else Absyn.PARTEVALFUNCTION(cref1,fargs)); 1709 1667 … … 1717 1675 input FCore.Graph inEnv; 1718 1676 input Option<Type_A> inA; 1719 input list<HashTableStringToPath.HashTable> inHt;1677 input AvlSetString.Tree tree; 1720 1678 input FixAFn fixA; 1721 1679 output Option<Type_A> outA; … … 1725 1683 input FCore.Graph inEnv; 1726 1684 input Type_A inA; 1727 input list<HashTableStringToPath.HashTable> inHt;1685 input AvlSetString.Tree tree; 1728 1686 output Type_A outTypeA; 1729 1687 end FixAFn; … … 1736 1694 case SOME(A1) 1737 1695 equation 1738 A2 = fixA(inCache, inEnv, A1, inHt);1696 A2 = fixA(inCache, inEnv, A1, tree); 1739 1697 then if referenceEq(A1,A2) then inA else SOME(A2); 1740 1698 end match; … … 1746 1704 input FCore.Graph inEnv; 1747 1705 input list<Type_A> inA; 1748 input list<HashTableStringToPath.HashTable> inHt;1706 input AvlSetString.Tree tree; 1749 1707 input FixAFn fixA; 1750 1708 output list<Type_A> outA; … … 1754 1712 input FCore.Graph inEnv; 1755 1713 input Type_A inA; 1756 input list<HashTableStringToPath.HashTable> inHt;1714 input AvlSetString.Tree tree; 1757 1715 output Type_A outTypeA; 1758 1716 end FixAFn; … … 1762 1720 return; 1763 1721 end if; 1764 outA := List.mapCheckReferenceEq(inA, function fixA(inCache=inCache, inEnv=inEnv, inHt=inHt));1722 outA := List.mapCheckReferenceEq(inA, function fixA(inCache=inCache, inEnv=inEnv, tree=tree)); 1765 1723 end fixList; 1766 1724 … … 1770 1728 input FCore.Graph inEnv; 1771 1729 input list<list<Type_A>> inA; 1772 input list<HashTableStringToPath.HashTable> inHt;1730 input AvlSetString.Tree tree; 1773 1731 input FixAFn fixA; 1774 1732 output list<list<Type_A>> outA = {}; … … 1778 1736 input FCore.Graph inEnv; 1779 1737 input Type_A inA; 1780 input list<HashTableStringToPath.HashTable> inHt;1738 input AvlSetString.Tree tree; 1781 1739 output Type_A outTypeA; 1782 1740 end FixAFn; … … 1787 1745 end if; 1788 1746 1789 outA := List.mapCheckReferenceEq(inA, function fixList(inCache=inCache, inEnv=inEnv, inHt=inHt, fixA=fixA));1747 outA := List.mapCheckReferenceEq(inA, function fixList(inCache=inCache, inEnv=inEnv, tree=tree, fixA=fixA)); 1790 1748 end fixListList; 1791 1749 … … 1795 1753 input FCore.Graph inEnv; 1796 1754 input list<tuple<Type_A,Type_B>> inRest; 1797 input list<HashTableStringToPath.HashTable> inHt;1755 input AvlSetString.Tree tree; 1798 1756 input FixAFn fixA; 1799 1757 input FixBFn fixB; … … 1804 1762 input FCore.Graph inEnv; 1805 1763 input Type_A inA; 1806 input list<HashTableStringToPath.HashTable> inHt;1764 input AvlSetString.Tree tree; 1807 1765 output Type_A outLst; 1808 1766 end FixAFn; … … 1811 1769 input FCore.Graph inEnv; 1812 1770 input Type_B inA; 1813 input list<HashTableStringToPath.HashTable> inHt;1771 input AvlSetString.Tree tree; 1814 1772 output Type_B outTypeA; 1815 1773 end FixBFn; … … 1818 1776 Type_B b1,b2; 1819 1777 algorithm 1820 outA := fixList(inCache, inEnv, inRest, inHt, function fixTuple2(fixA=fixA, fixB=fixB));1778 outA := fixList(inCache, inEnv, inRest, tree, function fixTuple2(fixA=fixA, fixB=fixB)); 1821 1779 end fixListTuple2; 1822 1780 … … 1826 1784 input FCore.Graph inEnv; 1827 1785 input output tuple<Type_A,Type_B> tpl; 1828 input list<HashTableStringToPath.HashTable> inHt;1786 input AvlSetString.Tree tree; 1829 1787 input FixAFn fixA; 1830 1788 input FixBFn fixB; … … 1834 1792 input FCore.Graph inEnv; 1835 1793 input Type_A inA; 1836 input list<HashTableStringToPath.HashTable> inHt;1794 input AvlSetString.Tree tree; 1837 1795 output Type_A outLst; 1838 1796 end FixAFn; … … 1841 1799 input FCore.Graph inEnv; 1842 1800 input Type_B inA; 1843 input list<HashTableStringToPath.HashTable> inHt;1801 input AvlSetString.Tree tree; 1844 1802 output Type_B outTypeA; 1845 1803 end FixBFn; … … 1849 1807 algorithm 1850 1808 (a1, b1) := tpl; 1851 a2 := fixA(inCache, inEnv, a1, inHt);1852 b2 := fixB(inCache, inEnv, b1, inHt);1809 a2 := fixA(inCache, inEnv, a1, tree); 1810 b2 := fixB(inCache, inEnv, b1, tree); 1853 1811 if not (referenceEq(a1,a2) and referenceEq(b1,b2)) then 1854 1812 tpl := (a2, b2);
Note: See TracChangeset
for help on using the changeset viewer.