Skip to content

Commit

Permalink
started writing function elabField
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Šilar authored and OpenModelica-Hudson committed Feb 10, 2016
1 parent 8d38966 commit 01c0933
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Compiler/FrontEnd/Inst.mo
Expand Up @@ -3547,6 +3547,8 @@ algorithm
(cache, dims) = InstUtil.elabArraydim(cache, env2, own_cref, t, ad, eq, impl,
NONE(), true, is_function_input, pre, info, inst_dims);

dims = InstUtil.elabField(attr, dims);

// adrpo: 2011-11-18: see if the component is an INPUT or OUTPUT and class is a record
// and add it to the cache!
// (cache, _, _) = addRecordConstructorsToTheCache(cache, cenv, ih, mod_1, pre, ci_state, dir, cls, inst_dims);
Expand Down
20 changes: 20 additions & 0 deletions Compiler/FrontEnd/InstUtil.mo
Expand Up @@ -4601,6 +4601,26 @@ algorithm
end matchcontinue;
end elabArraydimType2;

public function elabField
input SCode.Attributes attr;
input DAE.Dimensions inDims;
output DAE.Dimensions outDims;
algorithm
outDims := match(attr)
local
DAE.Dimension dim_f;
case(SCode.ATTR(isField=Absyn.NONFIELD()))
//TODO: check that the domain attribute (modifier) is not present.
then
inDims;
case(SCode.ATTR(isField=Absyn.FIELD()))
equation
dim_f = DAE.DIM_INTEGER(4);
then
dim_f::inDims;
end match;
end elabField;

public function addFunctionsToDAE
"@author: adrpo
we might need to intantiate partial functions, but we should NOT add them to the DAE!"
Expand Down

0 comments on commit 01c0933

Please sign in to comment.