Skip to content

Commit

Permalink
- fixes for the upcoming mmc compiler;
Browse files Browse the repository at this point in the history
- corrections to input variables and variables from matchcontinue

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2755 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Mar 20, 2007
1 parent dd039f4 commit 40c43e7
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion Compiler/Algorithm.mo
Expand Up @@ -483,7 +483,7 @@ public function makeWhenA "function: makeWhenA
output Statement outStatement;
algorithm
outStatement:=
matchcontinue (inExp,inProperties,inStatementLst)
matchcontinue (inExp,inProperties,inStatementLst,elseWhenStmt)
local
Exp.Exp e;
list<Statement> stmts;
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Codegen.mo
Expand Up @@ -5855,7 +5855,7 @@ protected function generateExtcallVardecls2F77 "function: generateExtcallVardecl
output Integer outInteger;
algorithm
(outCFunction,outDAEExtArgLst,i,outInteger):=
matchcontinue (inDAEExtArgLst,inExtArg,inInteger)
matchcontinue (inDAEExtArgLst,inExtArg,i,inInteger)
local
Integer tnr,tnr_1,tnr_2,i2;
CFunction retdecl,decl,decls,res;
Expand Down
20 changes: 10 additions & 10 deletions Compiler/DAELow.mo
Expand Up @@ -2759,7 +2759,7 @@ protected function countSimpleEquations2
input Integer partialSum "to enable tail-recursion";
output Integer numEqns;
algorithm
numEqns := matchcontinue(eqns)
numEqns := matchcontinue(eqns,partialSum)
local Equation e;
case({},partialSum) then partialSum;

Expand Down Expand Up @@ -2794,7 +2794,7 @@ If the equation is not simple, this function will fail.
output Exp.Exp e2;
algorithm
(e1,e2):=
matchcontinue (eqn)
matchcontinue (eqn,swap)
local
Exp.Exp e;
Exp.Type t;
Expand Down Expand Up @@ -3800,7 +3800,7 @@ protected function getWhenEquationFromVariable
output WhenEquation outEquation;
output list<Equation> outEquations;
algorithm
(outEquation, outEquations) := matchcontinue(cr,euqations)
(outEquation, outEquations) := matchcontinue(inCr,inEquations)
local
Exp.ComponentRef cr1,cr2;
WhenEquation eq;
Expand Down Expand Up @@ -6533,7 +6533,7 @@ protected function dumpIncidenceRow "function: dumpIncidenceRow
input list<Integer> inIntegerLst;
algorithm
_:=
matchcontinue (inIntegerLst,rowIndex)
matchcontinue (inIntegerLst)
local
String s;
Value x;
Expand Down Expand Up @@ -7962,7 +7962,7 @@ public function equationEqual "Returns true if two equations are equal"
algorithm
res := matchcontinue(e1,e2)
local
Exp.Exp e11,e12,e21,e22,e1,e2;
Exp.Exp e11,e12,e21,e22,exp1,exp2;
Integer i1,i2;
Exp.ComponentRef cr1,cr2;
case (EQUATION(e11,e12),EQUATION(e21,e22)) equation
Expand All @@ -7971,11 +7971,11 @@ algorithm
case(ARRAY_EQUATION(i1,_),ARRAY_EQUATION(i2,_)) equation
res = intEq(i1,i2);
then res;
case(SOLVED_EQUATION(cr1,e1),SOLVED_EQUATION(cr2,e2)) equation
res = boolAnd(Exp.crefEqual(cr1,cr2),Exp.expEqual(e1,e2));
case(SOLVED_EQUATION(cr1,exp1),SOLVED_EQUATION(cr2,exp2)) equation
res = boolAnd(Exp.crefEqual(cr1,cr2),Exp.expEqual(exp1,exp2));
then res;
case(RESIDUAL_EQUATION(e1),RESIDUAL_EQUATION(e2)) equation
res = Exp.expEqual(e1,e2);
case(RESIDUAL_EQUATION(exp1),RESIDUAL_EQUATION(exp2)) equation
res = Exp.expEqual(exp1,exp2);
then res;
case(ALGORITHM(i1,_,_),ALGORITHM(i2,_,_)) equation
res = intEq(i1,i2);
Expand Down Expand Up @@ -11626,7 +11626,7 @@ protected function variableReplacementsNoDollar "function: variableReplacementsN
output list<Exp.Exp> outExpExpLst2;
algorithm
(outExpExpLst1,outExpExpLst2):=
matchcontinue (inVarLst1,inVarLst2)
matchcontinue (inVarLst1,inVarLst2,inVarLst3)
local
list<Exp.Exp> s1,t1,s2,t2,s,t,s3,t3;
list<Var> vars,knvars,extvars;
Expand Down
4 changes: 2 additions & 2 deletions Compiler/Env.mo
Expand Up @@ -1388,7 +1388,7 @@ protected function cacheGetEnv3 "Help function to cacheGetEnv2, searches down in
input list<CacheTree> children;
output Env env;
algorithm
env := matchcontinue(path,tree)
env := matchcontinue(path,children)

local
Ident id,id2;
Expand Down Expand Up @@ -1455,7 +1455,7 @@ end cacheAddEnv;

protected function cacheAddEnv2
input Absyn.Path path;
input list<CacheTree> inChilren;
input list<CacheTree> inChildren;
input Env env;
output list<CacheTree> outChildren;
algorithm
Expand Down
20 changes: 10 additions & 10 deletions Compiler/Inst.mo
Expand Up @@ -944,7 +944,7 @@ protected function instClassBasictype "function: instClassBasictype
NOTE: This function should only be called from inst_basictype_baseclass.
This is new functionality in Modelica v 2.2.
"
input Env.Cache inEnv;
input Env.Cache inCache;
input Env inEnv;
input Mod inMod;
input Prefix inPrefix;
Expand Down Expand Up @@ -1567,7 +1567,7 @@ to the inner variable"
input VarTransform.VariableReplacements inRepl;
output VarTransform.VariableReplacements outRepl;
algorithm
repl := matchcontinue(innerVars,outerVars)
repl := matchcontinue(innerVars,outerVars,inRepl)
local VarTransform.VariableReplacements repl;
DAE.Element v;
case({},_,repl) then repl;
Expand Down Expand Up @@ -2693,7 +2693,7 @@ protected function instElementList "function: instElementList
output list<Types.Var> outTypesVarLst;
algorithm
(outCache,outDAEElementLst,outEnv,outSets,outState,outTypesVarLst):=
matchcontinue (inCache,inEnv1,inMod2,inPrefix3,inSets4,inState5,inTplSCodeElementModLst6,inInstDims7,inBoolean8,inBoolean9)
matchcontinue (inCache,inEnv1,inMod2,inPrefix3,inSets4,inState5,inTplSCodeElementModLst6,inInstDims7,inBoolean8)
local
list<Env.Frame> env,env_1,env_2;
Connect.Sets csets,csets_1,csets_2;
Expand Down Expand Up @@ -4808,14 +4808,14 @@ protected function instArray "function: instArray
input Boolean inBoolean;
input Option<Absyn.Comment> inAbsynCommentOption;
input Absyn.InnerOuter io;
output Env.Cache cache;
output Env.Cache outCache;
output Env outEnv;
output list<DAE.Element> outDAEElementLst;
output Connect.Sets outSets;
output Types.Type outType;
algorithm
(outCache,outEnv,outDAEElementLst,outSets,outType):=
matchcontinue (inCache,inEnv,inState,inMod,inPrefix,inSets,inIdent,inTplSCodeClassSCodeAttributes,protection,inInteger,inDimExp,inDimExpLst,inIntegerLst,inInstDims,inBoolean,inAbsynCommentOption,io)
matchcontinue (cache,inEnv,inState,inMod,inPrefix,inSets,inIdent,inTplSCodeClassSCodeAttributes,protection,inInteger,inDimExp,inDimExpLst,inIntegerLst,inInstDims,inBoolean,inAbsynCommentOption,io)
local
Exp.Exp e,e_1;
Types.Properties p,p2;
Expand Down Expand Up @@ -4945,7 +4945,7 @@ public function elabComponentArraydimFromEnv "function elabComponentArraydimFrom
output list<DimExp> outDimExpLst;
algorithm
(outCache,outDimExpLst) :=
matchcontinue (inEnv,inComponentRef)
matchcontinue (inCache,inEnv,inComponentRef)
local
Types.Var ty;
String n,id;
Expand Down Expand Up @@ -5482,7 +5482,7 @@ public function instClassDecl "function: instClassDecl
output list<DAE.Element> outDAEElementLst;
algorithm
(outCache,outEnv,outDAEElementLst):=
matchcontinue (inCache,inEnv,inMod,inPrefix,inSets,inClass,inInstDims,inBoolean)
matchcontinue (inCache,inEnv,inMod,inPrefix,inSets,inClass,inInstDims)
local
list<Env.Frame> env_1,env_2,env;
list<DAE.Element> dae;
Expand Down Expand Up @@ -6049,7 +6049,7 @@ protected function instExtGetAnnotation "function: instExtGetAnnotation
output Option<Absyn.Annotation> outAbsynAnnotationOption;
algorithm
outAbsynAnnotationOption:=
matchcontinue (inExternalDecl,els)
matchcontinue (inExternalDecl)
local Option<Absyn.Annotation> ann;
case (Absyn.EXTERNALDECL(annotation_ = ann)) then ann;
end matchcontinue;
Expand Down Expand Up @@ -7057,7 +7057,7 @@ This function detect this case and elaborates expressions without vectorization.
output Exp.Exp outE1;
output Exp.Exp outE2;
algorithm
(outCache,outE1,outE2) := matchcontinue(inCache,env,e1,e2,prop,impl)
(outCache,outE1,outE2) := matchcontinue(inCache,env,e1,e2,elabedE1,elabedE2,prop,impl)
local Env.Cache cache;
Boolean b1,b2;
case(cache,env,e1,e2,elabedE1,elabedE2,prop,impl) equation
Expand Down Expand Up @@ -9360,7 +9360,7 @@ public function instRecordConstructorElt "function: instRecordConstructorElt
a record constructor.
E.g if the element is Real x; the resulting Var is \"input Real x;\"
"
input Env.Cache inCaache;
input Env.Cache inCache;
input Env inEnv;
input SCode.Element inElement;
input Boolean inBoolean;
Expand Down
6 changes: 3 additions & 3 deletions Compiler/Interactive.mo
Expand Up @@ -277,7 +277,7 @@ protected function getEcho "function: getEcho
output Boolean outBoolean;
algorithm
outBoolean:=
matchcontinue (inInteractiveSymbolTable)
matchcontinue ()
local
list<Env.Frame> env;
Boolean res;
Expand Down Expand Up @@ -558,7 +558,7 @@ protected function evaluateForStmt "evaluates a for-statement in an algorithm se
output InteractiveSymbolTable outInteractiveSymbolTable;
algorithm
outInteractiveSymbolTable:=
matchcontinue (forVar,valList,algItemList, inInteractiveSymbolTable)
matchcontinue (iter,valList,algItemList, inInteractiveSymbolTable)
local
Values.Value val;
list<Values.Value> vallst;
Expand Down Expand Up @@ -591,7 +591,7 @@ protected function evaluateForStmtRangeOpt
output InteractiveSymbolTable outInteractiveSymbolTable;
algorithm
outInteractiveSymbolTable:=
matchcontinue (forVar, startVal, stepVal, stopVal, algItemList, inInteractiveSymbolTable)
matchcontinue (iter, startVal, stepVal, stopVal, algItemList, inInteractiveSymbolTable)
local
Values.Value startv, stepv, stopv, nextv;
list<Values.Value> vallst;
Expand Down
20 changes: 10 additions & 10 deletions Compiler/Refactor.mo
Expand Up @@ -13,7 +13,7 @@ public function refactorGraphicalAnnotation "function: refactorGraphicalAnnnotat
input Absyn.Class classToRefactor;
output Absyn.Class changedClass; //Manipulerad AST
algorithm
changedClass := matchcontinue inProgram
changedClass := matchcontinue (wholeAST, classToRefactor)
local
list<Absyn.Class> classList, other;
Absyn.Class c;
Expand Down Expand Up @@ -142,7 +142,7 @@ protected function refactorGraphAnnInClassParts "function: refactorGraphAnnInCla
input Env.Env env;
output list<Absyn.ClassPart> outParts;
algorithm
outParts := matchcontinue (inParts,inProgram,classPath,inClassEnv)
outParts := matchcontinue (inParts,inProgram,classPath,env)
local
Absyn.Program p;
list<Absyn.ClassPart> restParts,resParts,resultParts;
Expand Down Expand Up @@ -262,13 +262,13 @@ end refactorGraphAnnInContentList;
protected function refactorGraphAnnInElItem"function: refactorGraphAnnInElItem
Helper function to refactorGraphAnnInClassPart. Part of the AST traverse.
"
input Absyn.ElementItem inIntem;
input Absyn.ElementItem inItem;
input Absyn.Program inProgram;
input Absyn.Path classPath;
input Env.Env inClassEnv;
output Absyn.ElementItem outItem;
algorithm
outItem := matchcontinue (inItem ,inProgram,classPath,inClassEnv)
outItem := matchcontinue (inItem,inProgram,classPath,inClassEnv)
local
Absyn.Program p;
Context context;
Expand Down Expand Up @@ -421,7 +421,7 @@ protected function refactorConstrainClass "function: refactorGraphAnnInElement

algorithm

outCC := matchcontinue (inElement,inProgram,classPath,inClassEnv)
outCC := matchcontinue (inCC,inProgram,classPath,inClassEnv)

local
Absyn.Program p;
Expand Down Expand Up @@ -683,7 +683,7 @@ protected function getRestrictionInClass"function: getRestrictionFromClass
argument and then returns the restriction to that class.
"

input Absyn.Class inClasS;
input Absyn.Class inClass;
output Absyn.Restriction outRestriction;

algorithm
Expand Down Expand Up @@ -767,7 +767,7 @@ protected function getIconTransformation"function: getIconTransformation

algorithm

iconTrans := matchcontinue(ax1,ay1,ax2,ay2,inRotation,inPath,inProg,inClassEnv)
iconTrans := matchcontinue(ax1,ay1,ax2,ay2,inRotation,classPath,inPath,inProg,inClassEnv)

local

Expand Down Expand Up @@ -1364,7 +1364,7 @@ protected function getCoordsFromAlgs"function: getCoordsFromAlgs

algorithm

(x1,y1,x2,y2) := matchcontinue(inAlgs,contextToGetCoordsFrom,context)
(x1,y1,x2,y2) := matchcontinue(inAlgs,contextToGetCoordsFrom)

local

Expand Down Expand Up @@ -2815,7 +2815,7 @@ protected function getValueFromExp

algorithm

value := matchcontinue(realExpr)
value := matchcontinue(expr)

local

Expand Down Expand Up @@ -2930,7 +2930,7 @@ protected function fixPaths
input Absyn.Path inPath2;
output Absyn.Path outPath;
algorithm
outPath := matchcontinue (inPath1, inPath2, temp)
outPath := matchcontinue (inPath1, inPath2)
local
Absyn.Path ip1, ip2, p1, p2;
String str1, str2;
Expand Down
4 changes: 2 additions & 2 deletions Compiler/SCode.mo
Expand Up @@ -1876,7 +1876,7 @@ public function innerouterString "function: inner/outer String
output String outString;
algorithm
outString:=
matchcontinue (inner_,outer_)
matchcontinue (innerOuter)
case (Absyn.INNEROUTER()) then "INNER/OUTER";
case (Absyn.INNER()) then "INNER";
case (Absyn.OUTER()) then "OUTER";
Expand Down Expand Up @@ -2532,7 +2532,7 @@ protected function directionEqual "Returns true if two Direction:s are equal"
input Absyn.Direction dir2;
output Boolean equal;
algorithm
equal := matchcontinue(var1,var2)
equal := matchcontinue(dir1,dir2)
case(Absyn.INPUT(),Absyn.INPUT()) then true;
case(Absyn.OUTPUT(),Absyn.OUTPUT()) then true;
case(Absyn.BIDIR(),Absyn.BIDIR()) then true;
Expand Down

0 comments on commit 40c43e7

Please sign in to comment.