Skip to content

Commit

Permalink
Removed the old MetaModelica operators from the parser (+& ==& +. ==.…
Browse files Browse the repository at this point in the history
…, etc)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23050 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 29, 2014
1 parent 38435b1 commit d6355a4
Show file tree
Hide file tree
Showing 143 changed files with 3,623 additions and 3,640 deletions.
32 changes: 16 additions & 16 deletions Compiler/BackEnd/BackendDAECreate.mo
Expand Up @@ -423,7 +423,7 @@ algorithm
equation
// show only on failtrace!
true = Flags.isSet(Flags.FAILTRACE);
Debug.traceln("- BackendDAECreate.lower3 failed on: " +& DAEDump.dumpElementsStr({inElement}));
Debug.traceln("- BackendDAECreate.lower3 failed on: " + DAEDump.dumpElementsStr({inElement}));
then
fail();
end match;
Expand Down Expand Up @@ -541,7 +541,7 @@ algorithm
then (vars, knvars, exvars, eqns);
case (elem::_, _, _, _, _, _)
equation
str = "BackendDAECreate.lowerVars failed for " +& DAEDump.dumpElementsStr({elem});
str = "BackendDAECreate.lowerVars failed for " + DAEDump.dumpElementsStr({elem});
Error.addMessage(Error.INTERNAL_ERROR, {str});
then fail();

Expand Down Expand Up @@ -630,7 +630,7 @@ algorithm

else
equation
str = "BackendDAECreate.lowerVar failed for " +& DAEDump.dumpElementsStr({inElement});
str = "BackendDAECreate.lowerVar failed for " + DAEDump.dumpElementsStr({inElement});
Error.addMessage(Error.INTERNAL_ERROR, {str});
then fail();

Expand Down Expand Up @@ -766,7 +766,7 @@ algorithm

else
equation
str = "BackendDAECreate.lowerKnownVar failed for " +& DAEDump.dumpElementsStr({inElement});
str = "BackendDAECreate.lowerKnownVar failed for " + DAEDump.dumpElementsStr({inElement});
Error.addMessage(Error.INTERNAL_ERROR, {str});
then fail();
end matchcontinue;
Expand Down Expand Up @@ -851,33 +851,33 @@ algorithm
case (DAE.CALL(path=_),_,_,_)
equation
e1 = BaseHashTable.get(iExp,iInlineHT);
// print("use chache Inline\n" +& ExpressionDump.printExpStr(iExp) +& "\n");
// print("use chache Inline\n" + ExpressionDump.printExpStr(iExp) + "\n");
source = DAEUtil.addSymbolicTransformation(iSource,DAE.OP_INLINE(DAE.PARTIAL_EQUATION(iExp),DAE.PARTIAL_EQUATION(e1)));
then (e1,source,iInlineHT,{});
case (DAE.CALL(path=_),_,_,_)
equation
// print("add chache Inline\n" +& ExpressionDump.printExpStr(iExp) +& "\n");
// print("add chache Inline\n" + ExpressionDump.printExpStr(iExp) + "\n");
(e1, source, inlined,_) = Inline.inlineExp(iExp, fnstpl, iSource);
inlineHT = if inlined then BaseHashTable.add((iExp,e1), iInlineHT) else iInlineHT;
then (e1,source,inlineHT,{});
case (DAE.ASUB(e,elst),_,_,_)
equation
e1 = BaseHashTable.get(e,iInlineHT);
// print("use chache Inline\n" +& ExpressionDump.printExpStr(iExp) +& "\n");
// print("use chache Inline\n" + ExpressionDump.printExpStr(iExp) + "\n");
source = DAEUtil.addSymbolicTransformation(iSource,DAE.OP_INLINE(DAE.PARTIAL_EQUATION(e),DAE.PARTIAL_EQUATION(e1)));
(e, source, _,_) = Inline.inlineExp(DAE.ASUB(e1,elst), fnstpl, source);
then (e,source,iInlineHT,{});
case (DAE.ASUB(e,elst),_,_,_)
equation
// print("add chache Inline(1)\n" +& ExpressionDump.printExpStr(iExp) +& "\n");
// print("add chache Inline(1)\n" + ExpressionDump.printExpStr(iExp) + "\n");
(e1, _, inlined,assrtLst1) = Inline.inlineExp(e, fnstpl, iSource);
inlineHT = if inlined then BaseHashTable.add((e,e1), iInlineHT) else iInlineHT;
(e, source, _,assrtLst2) = Inline.inlineExp(DAE.ASUB(e1,elst), fnstpl, iSource);
assrtLst = listAppend(assrtLst1,assrtLst2);
then (e,source,inlineHT,assrtLst);
case (_,_,_,_)
equation
// print("no chache Inline\n" +& ExpressionDump.printExpStr(iExp) +& "\n");
// print("no chache Inline\n" + ExpressionDump.printExpStr(iExp) + "\n");
(e, source, _,_) = Inline.inlineExp(iExp, fnstpl, iSource);
then (e,source,iInlineHT,{});
end matchcontinue;
Expand Down Expand Up @@ -1088,7 +1088,7 @@ algorithm
then inType;
case (DAE.T_FUNCTION(funcResultType = _))
then inType;
else equation print("lowerType: " +& Types.printTypeStr(inType) +& " failed\n"); then fail();
else equation print("lowerType: " + Types.printTypeStr(inType) + " failed\n"); then fail();
end matchcontinue;
end lowerType;

Expand Down Expand Up @@ -1358,7 +1358,7 @@ algorithm

case (_,_,_,_,_)
equation
s = "BackendDAECreate.lowerEqn failed for " +& DAEDump.dumpElementsStr({inElement});
s = "BackendDAECreate.lowerEqn failed for " + DAEDump.dumpElementsStr({inElement});
Error.addSourceMessage(Error.INTERNAL_ERROR, {s}, DAEUtil.getElementSourceFileInfo(DAEUtil.getElementSource(inElement)));
then fail();

Expand Down Expand Up @@ -1705,7 +1705,7 @@ algorithm
equation
// show only on failtrace!
true = Flags.isSet(Flags.FAILTRACE);
Debug.traceln("- BackendDAECreate.lowerExtendedRecordEqn failed on: " +& ExpressionDump.printExpStr(inExp1) +& " = " +& ExpressionDump.printExpStr(inExp2) +& "\n");
Debug.traceln("- BackendDAECreate.lowerExtendedRecordEqn failed on: " + ExpressionDump.printExpStr(inExp1) + " = " + ExpressionDump.printExpStr(inExp2) + "\n");
then
fail();
end matchcontinue;
Expand Down Expand Up @@ -1806,7 +1806,7 @@ algorithm

case (DAE.WHEN_EQUATION(condition = _, source = source), _, _, _)
equation
str = "BackendDAECreate.lowerWhenEqn: equation not handled:\n" +&
str = "BackendDAECreate.lowerWhenEqn: equation not handled:\n" +
DAEDump.dumpElementsStr({inElement});
Error.addSourceMessage(Error.INTERNAL_ERROR, {str}, DAEUtil.getElementSourceFileInfo(source));
then
Expand Down Expand Up @@ -1954,7 +1954,7 @@ algorithm
case (el::_, _, _, _, _)
equation
true = Flags.isSet(Flags.FAILTRACE);
Debug.traceln("- BackendDAECreate.lowerWhenEqn2 failed on:" +& DAEDump.dumpElementsStr({el}));
Debug.traceln("- BackendDAECreate.lowerWhenEqn2 failed on:" + DAEDump.dumpElementsStr({el}));
then
fail();

Expand Down Expand Up @@ -2439,7 +2439,7 @@ algorithm
equation
// only report error if no other error is in the queue!
0 = Error.getNumErrorMessages();
str = "BackendDAECreate.lowerAlgorithm failed for:\n" +& DAEDump.dumpElementsStr({inElement});
str = "BackendDAECreate.lowerAlgorithm failed for:\n" + DAEDump.dumpElementsStr({inElement});
Error.addSourceMessage(
Error.INTERNAL_ERROR,
{str},
Expand Down Expand Up @@ -3330,7 +3330,7 @@ algorithm
case((key,SOME(DAE.FUNCTION(path=path,functions=functions,type_=type_,visibility=vis,partialPrefix=pPref,isImpure=isImpure,inlineType=iType,source=source,comment=comment))))
equation
pathName = Absyn.pathString(path);
pathName = Util.stringReplaceChar(pathName,".","_")+&"_";
pathName = Util.stringReplaceChar(pathName,".","_")+"_";
functions = List.map1(functions,renameFunctionParameter2,pathName);
then((key,SOME(DAE.FUNCTION(path,functions,type_,vis,pPref,isImpure,iType,source,comment))));
else
Expand Down
44 changes: 22 additions & 22 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -1849,7 +1849,7 @@ algorithm
then (listReverse(iEquationList), listReverse(iVariableList));

case((BackendDAE.RESIDUAL_EQUATION(exp=exp,source=source,attr=eqAttr))::restEquationList, index,_,_) equation
varName = "$res" +& intString(index);
varName = "$res" + intString(index);
componentRef = DAE.CREF_IDENT(varName, DAE.T_REAL_DEFAULT, {});
expVarName = DAE.CREF(componentRef, DAE.T_REAL_DEFAULT);
currEquation = BackendDAE.EQUATION(expVarName, exp, source, eqAttr);
Expand All @@ -1860,7 +1860,7 @@ algorithm
then (equationList, variableList);

case(currEquation::_, _,_,_) equation
errorMessage = "./Compiler/BackEnd/BackendDAEOptimize.mo: function convertResidualsIntoSolvedEquations2 failed: " +& BackendDump.equationString(currEquation);
errorMessage = "./Compiler/BackEnd/BackendDAEOptimize.mo: function convertResidualsIntoSolvedEquations2 failed: " + BackendDump.equationString(currEquation);
Error.addMessage(Error.INTERNAL_ERROR, {errorMessage});
then fail();

Expand Down Expand Up @@ -1960,7 +1960,7 @@ algorithm
// bcall2(b,BackendDump.dumpBackendDAE,BackendDAE.DAE({syst},shared), "partitionIndependentBlocksHelper");
// printPartition(b,ixs);
systs = if b then SynchronousFeatures.partitionIndependentBlocksSplitBlocks(i,syst,ixs,mT,throwNoError) else {syst};
// print("Number of partitioned systems: " +& intString(listLength(systs)) +& "\n");
// print("Number of partitioned systems: " + intString(listLength(systs)) + "\n");
// List.map1_0(systs, BackendDump.dumpEqSystem, "System");
then (systs,shared);
else
Expand Down Expand Up @@ -2064,10 +2064,10 @@ algorithm
case (BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(comps=comps)),(shared, b))
equation
((i1,i2,i3,i4)) = countOperationstraverseComps(comps,isyst,shared,(0,0,0,0));
print("Add Operations: " +& intString(i1) +& "\n");
print("Mul Operations: " +& intString(i2) +& "\n");
print("Oth Operations: " +& intString(i3) +& "\n");
print("Trig Operations: " +& intString(i4) +& "\n");
print("Add Operations: " + intString(i1) + "\n");
print("Mul Operations: " + intString(i2) + "\n");
print("Oth Operations: " + intString(i3) + "\n");
print("Trig Operations: " + intString(i4) + "\n");
then
(isyst,(shared,b));
end match;
Expand Down Expand Up @@ -2876,7 +2876,7 @@ algorithm
eqstr = stringDelimitList(List.map(listAppend(trueBranches,{falseBranch}),BackendDump.dumpEqnsStr),"\n");
strs = List.map(nrOfEquationsBranches, intString);
str = stringDelimitList(strs,",");
str = "{" +& str +& "," +& intString(nrOfEquations) +& "}";
str = "{" + str + "," + intString(nrOfEquations) + "}";
Error.addSourceMessage(Error.IF_EQUATION_UNBALANCED_2,{str,eqstr},DAEUtil.getElementSourceFileInfo(source));
then
fail();
Expand Down Expand Up @@ -3020,7 +3020,7 @@ algorithm
// failure
case _
equation
str = "- BackendDAEOptimize.makeEquationToResidualExp failed to transform equation: " +& BackendDump.equationString(eq) +& " to residual form!";
str = "- BackendDAEOptimize.makeEquationToResidualExp failed to transform equation: " + BackendDump.equationString(eq) + " to residual form!";
Error.addMessage(Error.INTERNAL_ERROR, {str});
then fail();
end matchcontinue;
Expand Down Expand Up @@ -4173,14 +4173,14 @@ algorithm
// simple condition [already in ht]
case (condition, _, index, ht) equation
localIndex = BaseHashTable.get(condition, ht);
crStr = "$whenCondition" +& intString(localIndex);
crStr = "$whenCondition" + intString(localIndex);
condition = DAE.CREF(DAE.CREF_IDENT(crStr, DAE.T_BOOL_DEFAULT, {}), DAE.T_BOOL_DEFAULT);
then (condition, {}, {}, index, ht);

// simple condition [not yet in ht]
case (condition, _, index, ht) equation
ht = BaseHashTable.add((condition, index), ht);
crStr = "$whenCondition" +& intString(index);
crStr = "$whenCondition" + intString(index);

var = BackendDAE.VAR(DAE.CREF_IDENT(crStr, DAE.T_BOOL_DEFAULT, {}), BackendDAE.DISCRETE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_BOOL_DEFAULT, NONE(), NONE(), {}, inSource, NONE(), NONE(), DAE.NON_CONNECTOR());
var = BackendVariable.setVarFixed(var, true);
Expand Down Expand Up @@ -4358,7 +4358,7 @@ algorithm

// array-condition
case (DAE.ARRAY(array={condition}), _, index) equation
crStr = "$whenCondition" +& intString(index);
crStr = "$whenCondition" + intString(index);

var = BackendDAE.VAR(DAE.CREF_IDENT(crStr, DAE.T_BOOL_DEFAULT, {}), BackendDAE.DISCRETE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_BOOL_DEFAULT, NONE(), NONE(), {}, inSource, NONE(), NONE(), DAE.NON_CONNECTOR());
var = BackendVariable.setVarFixed(var, true);
Expand All @@ -4374,7 +4374,7 @@ algorithm

// simple condition
case (condition, _, index) equation
crStr = "$whenCondition" +& intString(index);
crStr = "$whenCondition" + intString(index);

var = BackendDAE.VAR(DAE.CREF_IDENT(crStr, DAE.T_BOOL_DEFAULT, {}), BackendDAE.DISCRETE(), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_BOOL_DEFAULT, NONE(), NONE(), {}, inSource, NONE(), NONE(), DAE.NON_CONNECTOR());
var = BackendVariable.setVarFixed(var, true);
Expand Down Expand Up @@ -4633,7 +4633,7 @@ algorithm
case(_, _, _)
equation
/* Might be part of a different equation-system...
str = "BackendDAECreate.updateStatesVars failed for: " +& ComponentReference.printComponentRefStr(cr);
str = "BackendDAECreate.updateStatesVars failed for: " + ComponentReference.printComponentRefStr(cr);
Error.addMessage(Error.INTERNAL_ERROR, {str});
*/
then (inVars, iExp);
Expand Down Expand Up @@ -4667,7 +4667,7 @@ algorithm
case(_, _::newStates, _)
equation
/* Might be part of a different equation-system...
str = "BackendDAECreate.updateStatesVars failed for: " +& ComponentReference.printComponentRefStr(cr);
str = "BackendDAECreate.updateStatesVars failed for: " + ComponentReference.printComponentRefStr(cr);
Error.addMessage(Error.INTERNAL_ERROR, {str});
*/
vars = updateStatesVars(inVars, newStates, noStateFound);
Expand Down Expand Up @@ -4795,7 +4795,7 @@ algorithm
BackendDAE.DAE(eqs=eqs, shared=BackendDAE.SHARED(backendDAEType=backendDAEType)) := inBackendDAE;
warnings := listAllIterationVariables0(eqs);

Error.addCompilerNotification("List of all iteration variables (DAE kind: " +& BackendDump.printBackendDAEType2String(backendDAEType) +& ")\n" +& stringDelimitList(warnings, "\n"));
Error.addCompilerNotification("List of all iteration variables (DAE kind: " + BackendDump.printBackendDAEType2String(backendDAEType) + ")\n" + stringDelimitList(warnings, "\n"));
end listAllIterationVariables;

protected function listAllIterationVariables0 "author: lochel"
Expand Down Expand Up @@ -4853,23 +4853,23 @@ algorithm
varlst = List.map1r(vlst, BackendVariable.getVarAt, inVars);
false = List.isEmpty(varlst);

warning = "Iteration variables of nonlinear equation system:\n" +& warnAboutVars(varlst);
warning = "Iteration variables of nonlinear equation system:\n" + warnAboutVars(varlst);
warningList = listAllIterationVariables2(rest, inVars);
then warning::warningList;

case (BackendDAE.EQUATIONSYSTEM(vars=vlst, jacType=BackendDAE.JAC_GENERIC())::rest, _) equation
varlst = List.map1r(vlst, BackendVariable.getVarAt, inVars);
false = List.isEmpty(varlst);

warning = "Iteration variables of equation system w/o analytic Jacobian:\n" +& warnAboutVars(varlst);
warning = "Iteration variables of equation system w/o analytic Jacobian:\n" + warnAboutVars(varlst);
warningList = listAllIterationVariables2(rest, inVars);
then warning::warningList;

case (BackendDAE.EQUATIONSYSTEM(vars=vlst, jacType=BackendDAE.JAC_NO_ANALYTIC())::rest, _) equation
varlst = List.map1r(vlst, BackendVariable.getVarAt, inVars);
false = List.isEmpty(varlst);

warning = "Iteration variables of equation system w/o analytic Jacobian:\n" +& warnAboutVars(varlst);
warning = "Iteration variables of equation system w/o analytic Jacobian:\n" + warnAboutVars(varlst);
warningList = listAllIterationVariables2(rest, inVars);
then warning::warningList;

Expand All @@ -4878,7 +4878,7 @@ algorithm
false = List.isEmpty(varlst);

str = if linear then "linear" else "nonlinear";
warning = "Iteration variables of torn " +& str +& " equation system:\n" +& warnAboutVars(varlst);
warning = "Iteration variables of torn " + str + " equation system:\n" + warnAboutVars(varlst);
warningList = listAllIterationVariables2(rest, inVars);
then warning::warningList;

Expand All @@ -4903,12 +4903,12 @@ algorithm
then "";

case (v::{}) equation
crStr = " " +& BackendDump.varString(v);
crStr = " " + BackendDump.varString(v);
then crStr;

case (v::vars) equation
crStr = BackendDump.varString(v);
str = " " +& crStr +& "\n" +& warnAboutVars(vars);
str = " " + crStr + "\n" + warnAboutVars(vars);
then str;
end match;
end warnAboutVars;
Expand Down
8 changes: 4 additions & 4 deletions Compiler/BackEnd/BackendDAETransform.mo
Expand Up @@ -456,9 +456,9 @@ algorithm
Sorry - Support for Discrete Equation Systems is not yet implemented\n";
crlst = List.map(var_lst,BackendVariable.varCref);
slst = List.map(crlst,ComponentReference.printComponentRefStr);
msg = msg +& stringDelimitList(slst,"\n");
msg = msg + stringDelimitList(slst,"\n");
slst = List.map(eqn_lst,BackendDump.equationString);
msg = msg +& "\n" +& stringDelimitList(slst,"\n");
msg = msg + "\n" + stringDelimitList(slst,"\n");
Error.addInternalError(msg);
then
fail();
Expand Down Expand Up @@ -680,7 +680,7 @@ algorithm
case (e,_,_,_) /* equation no. assignments2 */
equation
true = Flags.isSet(Flags.FAILTRACE);
Debug.traceln("BackendDAETransform.getEquationAndSolvedVar_Internal failed at index: " +& intString(e));
Debug.traceln("BackendDAETransform.getEquationAndSolvedVar_Internal failed at index: " + intString(e));
then
fail();
end matchcontinue;
Expand Down Expand Up @@ -893,7 +893,7 @@ algorithm
(i_1,stack_3,comps_2);
else
equation
Debug.traceln("- BackendDAETransform.strongConnect failed for eqn " +& intString(v));
Debug.traceln("- BackendDAETransform.strongConnect failed for eqn " + intString(v));
then
fail();
end matchcontinue;
Expand Down

0 comments on commit d6355a4

Please sign in to comment.