Skip to content

Commit 5ff6e65

Browse files
author
x97davka
committed
Ugly DAE.VARVAL hack
Some cleanups git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@452 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent ac7bf3f commit 5ff6e65

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

modeq/inst.rml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ relation inst_element : (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
354354
inst_element(env,mods,pre,csets,ci_state, SCode.CLASSDEF(n,_,_,c))
355355
=> (dae,env',csets,ci_state,[])
356356

357-
(** A variable
357+
(** A component
358358
**
359359
** This is the rule for instantiating a model component. A
360360
** component can be a structured subcomponent or a variable,
@@ -399,7 +399,7 @@ relation inst_element : (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
399399
elab_arraydim(env,ad,eq) => dims &
400400

401401
(** Instantiate the component *)
402-
inst_var(env,mod',pre,csets,n,cl,attr,eq,dims,[])
402+
inst_var(env,mod',pre,csets,n,cl,attr,dims,[])
403403
=> (dae1,csets',ty) &
404404

405405
(** The environment is extended with the new variable *)
@@ -454,7 +454,7 @@ end
454454
(** relation: inst_var *)
455455

456456
relation inst_var : (Env.Env,Mod.Mod,Prefix.Prefix,Connect.Sets,Ident,
457-
SCode.Class,SCode.Attributes,Mod.EqMod option,
457+
SCode.Class,SCode.Attributes,
458458
int list, int list)
459459
=> (DAE.Element list,Connect.Sets,Types.Type) =
460460

@@ -475,20 +475,20 @@ relation inst_var : (Env.Env,Mod.Mod,Prefix.Prefix,Connect.Sets,Ident,
475475
list_append(daex,dae3) => dae
476476
--------------------------
477477
inst_var(env,mod,pre,csets,n,cl,SCode.ATTR(_,flow,acc,vt,dir),
478-
eq,[],idxs)
478+
[],idxs)
479479
=> (dae,csets',ty)
480480

481481
rule print "= inst_array mod: " & print n & Mod.print_mod mod & print "\n" &
482482
inst_array(env,mod,pre,csets,n,(cl,attr),1,dim,dims,idxs)
483483
=> (dae, csets', ty) &
484484
Types.lift_array(ty,SOME(dim)) => ty'
485485
-------------------------------
486-
inst_var(env,mod,pre,csets,n,cl,attr,eq,dim::dims,idxs)
486+
inst_var(env,mod,pre,csets,n,cl,attr,dim::dims,idxs)
487487
=> (dae,csets',ty')
488488

489489
rule print "- inst_var failed: " & print n & print "\n"
490490
--------------------------------------------------
491-
inst_var(_,_,_,_,n,_,_,_,_,_) => fail
491+
inst_var(_,_,_,_,n,_,_,_,_) => fail
492492

493493
end
494494

@@ -504,7 +504,7 @@ relation inst_array : (Env.Env,Mod.Mod,Prefix.Prefix,Connect.Sets,Ident,
504504
=> ([], csets, Types.T_NOTYPE)
505505

506506
rule Mod.lookup_idx_modification(mod,i) => mod' &
507-
inst_var(env,mod',pre,csets,n,cl,attr,NONE,dims,i::idxs)
507+
inst_var(env,mod',pre,csets,n,cl,attr,dims,i::idxs)
508508
=> (dae1,csets',ty) &
509509
int_add(i,1) => i' &
510510
inst_array(env,mod,pre,csets',n,(cl,attr),i',stop,dims,idxs)
@@ -1551,6 +1551,14 @@ end
15511551
relation inst_mod_equation : (Exp.ComponentRef, Types.Type, Mod)
15521552
=> DAE.Element list =
15531553

1554+
(*!ignorecode*)
1555+
(* This is pretty ugly, but I don't want to infect the report *)
1556+
rule RTOpts.modelica_output => true
1557+
------------------------------
1558+
inst_mod_equation(cr,ty1, mod as Mod.MOD(_,_,SOME((e,prop2))))
1559+
=> [DAE.VARVAL(e)]
1560+
(*!includecode*)
1561+
15541562
rule inst_eq_equation(Exp.CREF(cr),
15551563
Static.PROP(ty1,false(*FIXME*)), e,prop2) => dae
15561564
-----------------------------------------------

0 commit comments

Comments
 (0)