Skip to content

Commit 4ee2c6c

Browse files
committed
- some more infos about arraycrefs in dumpSimCode
1 parent 57c9092 commit 4ee2c6c

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

Compiler/SimCode/SimCodeUtil.mo

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7690,28 +7690,41 @@ algorithm
76907690
Integer i;
76917691
DAE.ComponentRef name, name2;
76927692
Option<DAE.Exp> init;
7693+
Option<DAE.ComponentRef> arrCref;
7694+
Option<Integer> variable_index;
76937695
SimCodeVar.AliasVariable aliasvar;
7694-
String s1, s2;
7695-
case (SimCodeVar.SIMVAR(name= name, aliasvar = SimCodeVar.NOALIAS(), index = i, initialValue=init))
7696+
String s1, s2, s3;
7697+
list<String> numArrayElement;
7698+
case (SimCodeVar.SIMVAR(name= name, aliasvar = SimCodeVar.NOALIAS(), index = i, initialValue=init, arrayCref=arrCref,variable_index=variable_index, numArrayElement=numArrayElement))
76967699
equation
76977700
s1 = ComponentReference.printComponentRefStr(name);
7698-
print(" No Alias for var : " + s1 + " index: "+intString(i)+" initial: "+ExpressionDump.printOptExpStr(init) +"\n");
7701+
if Util.isSome(arrCref) then s3 = " \tarrCref:"+ComponentReference.printComponentRefStr(Util.getOption(arrCref)); else s3=""; end if;
7702+
print(" No Alias for var : " + s1 + " index: "+intString(i)+" initial: "+ExpressionDump.printOptExpStr(init) + s3 + " index:("+printVarIndx(variable_index)+")" +" [" + stringDelimitList(numArrayElement,",")+"] " + "\n");
76997703
then ();
7700-
case (SimCodeVar.SIMVAR(name= name, aliasvar = SimCodeVar.ALIAS(varName = name2)))
7704+
case (SimCodeVar.SIMVAR(name= name, aliasvar = SimCodeVar.ALIAS(varName = name2), arrayCref=arrCref,variable_index=variable_index, numArrayElement=numArrayElement))
77017705
equation
77027706
s1 = ComponentReference.printComponentRefStr(name);
77037707
s2 = ComponentReference.printComponentRefStr(name2);
7704-
print(" Alias for var " + s1 + " is " + s2 + "\n");
7708+
if Util.isSome(arrCref) then s3 = " arrCref:"+ComponentReference.printComponentRefStr(Util.getOption(arrCref)); else s3=""; end if;
7709+
print(" Alias for var " + s1 + " is " + s2 + s3 + " index:("+printVarIndx(variable_index)+")" +" [" + stringDelimitList(numArrayElement,",")+"] " + "\n");
77057710
then ();
7706-
case (SimCodeVar.SIMVAR(name= name, aliasvar = SimCodeVar.NEGATEDALIAS(varName = name2)))
7711+
case (SimCodeVar.SIMVAR(name= name, aliasvar = SimCodeVar.NEGATEDALIAS(varName = name2), arrayCref=arrCref,variable_index=variable_index, numArrayElement=numArrayElement))
77077712
equation
77087713
s1 = ComponentReference.printComponentRefStr(name);
77097714
s2 = ComponentReference.printComponentRefStr(name2);
7710-
print(" Minus Alias for var " + s1 + " is " + s2 + "\n");
7715+
if Util.isSome(arrCref) then s3 = " arrCref:"+ComponentReference.printComponentRefStr(Util.getOption(arrCref)); else s3=""; end if;
7716+
print(" Minus Alias for var " + s1 + " is " + s2 + s3 + " index:("+printVarIndx(variable_index)+")" + " [" + stringDelimitList(numArrayElement,",")+"] " + "\n");
77117717
then ();
77127718
end match;
77137719
end dumpVar;
77147720

7721+
protected function printVarIndx
7722+
input Option<Integer> i;
7723+
output String s;
7724+
algorithm
7725+
if Util.isSome(i) then s:=intString(Util.getOption(i)); else s := ""; end if;
7726+
end printVarIndx;
7727+
77157728
public function dumpVarLst"dumps a list of SimVars to stdout.
77167729
author:Waurich TUD 2014-05"
77177730
input list<SimCodeVar.SimVar> varLst;

0 commit comments

Comments
 (0)