Skip to content

Commit 950f878

Browse files
Deleted flag +synchronousFeatures and replaced it by checking for flag +std=3.3 or greater
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@21539 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 12bda04 commit 950f878

File tree

10 files changed

+51
-56
lines changed

10 files changed

+51
-56
lines changed

Compiler/FrontEnd/Ceval.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ algorithm
11531153
// BTH
11541154
case "Clock"
11551155
equation
1156-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
1156+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
11571157
then cevalBuiltinClock;
11581158
// MetaModelica type conversions
11591159
case "intString" equation true = Config.acceptMetaModelicaGrammar(); then cevalIntString;

Compiler/FrontEnd/ClassInf.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,9 @@ algorithm
432432
case (SCode.R_PREDEFINED_STRING(),p) then TYPE_STRING(p);
433433
case (SCode.R_PREDEFINED_BOOLEAN(),p) then TYPE_BOOL(p);
434434
// BTH
435-
case (SCode.R_PREDEFINED_CLOCK(),p)
435+
case (SCode.R_PREDEFINED_CLOCK(),p)
436436
equation
437-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
437+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
438438
then TYPE_CLOCK(p);
439439
case (SCode.R_PREDEFINED_ENUMERATION(),p) then TYPE_ENUM(p);
440440
/* Meta Modelica extensions */

Compiler/FrontEnd/Inst.mo

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,9 +1297,9 @@ algorithm
12971297
case "String" then DAE.T_STRING_DEFAULT;
12981298
case "Boolean" then DAE.T_BOOL_DEFAULT;
12991299
// BTH
1300-
case "Clock"
1300+
case "Clock"
13011301
equation
1302-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
1302+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
13031303
then DAE.T_CLOCK_DEFAULT;
13041304
end match;
13051305
end getBasicTypeType;
@@ -1314,9 +1314,9 @@ algorithm
13141314
case "String" then getStringAttributeType;
13151315
case "Boolean" then getBoolAttributeType;
13161316
// BTH
1317-
case "Clock"
1317+
case "Clock"
13181318
equation
1319-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
1319+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
13201320
then getClockAttributeType;
13211321
end match;
13221322
end getBasicTypeAttrTyper;
@@ -1883,10 +1883,10 @@ algorithm
18831883
System.setPartialInstantiation(partialInst);
18841884
then (cache,env,ih,ci_state,{});
18851885

1886-
// BTH
1886+
// BTH
18871887
case (cache,env,ih,_,_,ci_state,(SCode.CLASS(name = "Clock")),_,_,_,_)
18881888
equation
1889-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
1889+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
18901890
System.setPartialInstantiation(partialInst);
18911891
then (cache,env,ih,ci_state,{});
18921892

Compiler/FrontEnd/InstUtil.mo

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ public function prefixEqualUnlessBasicType
609609
input SCode.Element cls;
610610
algorithm
611611
_ := matchcontinue (pre1, pre2, cls)
612-
local
612+
local
613613
// adrpo: TODO! FIXME!, I think here we should have pre1 = Prefix.CLASSPRE(variability1) == pre2 = Prefix.CLASSPRE(variability2)
614614

615615
// don't care about prefix for:
@@ -634,7 +634,7 @@ algorithm
634634
// BTH
635635
case (_, _, SCode.CLASS(name = "Clock"))
636636
equation
637-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
637+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
638638
then ();
639639

640640
// anything else, check for equality!
@@ -656,7 +656,7 @@ algorithm
656656
case("String") then true;
657657
case("Boolean") then true;
658658
// BTH
659-
case("Clock") then Util.if_(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true, false);
659+
case("Clock") then Util.if_(intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33), true, false);
660660
else false;
661661
end match;
662662
end isBuiltInClass;
@@ -859,11 +859,11 @@ algorithm
859859
true = listMember(r, {SCode.R_TYPE(), SCode.R_CONNECTOR(false), SCode.R_CONNECTOR(true)});
860860
true = listMember(id, {"Real", "Integer", "Boolean", "String"});
861861
then ();
862-
862+
863863
//BTH same as above but extended with Clock type if Flags.SYNCHRONOUS_FEATURES == true
864864
case (_, _, _, r, {SCode.EXTENDS(baseClassPath=Absyn.IDENT(id))})
865865
equation
866-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
866+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
867867
true = listMember(r, {SCode.R_TYPE(), SCode.R_CONNECTOR(false), SCode.R_CONNECTOR(true)});
868868
true = listMember(id, {"Real", "Integer", "Boolean", "String", "Clock"});
869869
then ();
@@ -902,16 +902,16 @@ protected
902902
list<SCode.Restriction> rstLst;
903903
algorithm
904904
// BTH add Clock type to both lists if Flags.SYNCHRONOUS_FEATURES == true
905-
strLst := Util.if_(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES),
905+
strLst := Util.if_(intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33),
906906
{"Real", "Integer", "String", "Boolean", "Clock"},
907907
{"Real", "Integer", "String", "Boolean"});
908908
b1 := listMember(childName, strLst);
909-
910-
rstLst := Util.if_(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES),
909+
910+
rstLst := Util.if_(intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33),
911911
{SCode.R_TYPE(), SCode.R_PREDEFINED_INTEGER(), SCode.R_PREDEFINED_REAL(), SCode.R_PREDEFINED_STRING(), SCode.R_PREDEFINED_BOOLEAN(), SCode.R_PREDEFINED_CLOCK()},
912912
{SCode.R_TYPE(), SCode.R_PREDEFINED_INTEGER(), SCode.R_PREDEFINED_REAL(), SCode.R_PREDEFINED_STRING(), SCode.R_PREDEFINED_BOOLEAN()});
913913
b2 := listMember(childRestriction, rstLst);
914-
914+
915915
b3 := valueEq(parentRestriction, SCode.R_TYPE());
916916

917917
//b2 := listMember(childRestriction, {SCode.R_TYPE(), SCode.R_ENUMERATION(), SCode.R_PREDEFINED_INTEGER(), SCode.R_PREDEFINED_REAL(), SCode.R_PREDEFINED_STRING(), SCode.R_PREDEFINED_BOOLEAN(), SCode.R_PREDEFINED_ENUMERATION()});
@@ -3776,9 +3776,9 @@ algorithm
37763776
case (cache, _, _, _, cl as SCode.CLASS(name = "String"), _, _) then (cache,{},cl,DAE.NOMOD());
37773777
case (cache, _, _, _, cl as SCode.CLASS(name = "Boolean"), _, _) then (cache,{},cl,DAE.NOMOD());
37783778
// BTH
3779-
case (cache, _, _, _, cl as SCode.CLASS(name = "Clock"), _, _)
3779+
case (cache, _, _, _, cl as SCode.CLASS(name = "Clock"), _, _)
37803780
equation
3781-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
3781+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
37823782
then (cache,{},cl,DAE.NOMOD());
37833783

37843784
case (cache, _, _, _, cl as SCode.CLASS(restriction = SCode.R_RECORD(_),
@@ -8321,16 +8321,16 @@ algorithm
83218321
// you cannot redeclare a basic type, only the properties and the binding, i.e.
83228322
// redeclare constant Boolean standardOrderComponents = true
83238323
case (DAE.REDECL(_, _, {(SCode.COMPONENT(typeSpec=Absyn.TPATH(path=path)), _)})) equation
8324-
true = Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES);
8325-
8324+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
8325+
83268326
name = Absyn.pathFirstIdent(path);
83278327
// BTH
83288328
true = listMember(name, {"Real", "Integer", "Boolean", "String", "Clock"});
83298329
then true;
8330-
8330+
83318331
case (DAE.REDECL(_, _, {(SCode.COMPONENT(typeSpec=Absyn.TPATH(path=path)), _)})) equation
8332-
false = Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES);
8333-
8332+
false = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
8333+
83348334
name = Absyn.pathFirstIdent(path);
83358335
// BTH
83368336
true = listMember(name, {"Real", "Integer", "Boolean", "String"});

Compiler/FrontEnd/MetaUtil.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,9 @@ algorithm
370370
case(Absyn.IDENT("String")) then DAE.T_STRING_DEFAULT;
371371
case(Absyn.IDENT("Boolean")) then DAE.T_BOOL_DEFAULT;
372372
// BTH
373-
case(Absyn.IDENT("Clock"))
373+
case(Absyn.IDENT("Clock"))
374374
equation
375-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
375+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
376376
then DAE.T_CLOCK_DEFAULT;
377377
end match;
378378
end reparseType;

Compiler/FrontEnd/NFInst.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,9 @@ algorithm
557557
case ("String", _) then DAE.T_STRING(inAttributes, DAE.emptyTypeSource);
558558
case ("Boolean", _) then DAE.T_BOOL(inAttributes, DAE.emptyTypeSource);
559559
// BTH
560-
case ("Clock", _)
560+
case ("Clock", _)
561561
equation
562-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
562+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
563563
then DAE.T_CLOCK(inAttributes, DAE.emptyTypeSource);
564564
case ("StateSelect", _) then DAE.T_ENUMERATION_DEFAULT;
565565
end match;

Compiler/FrontEnd/NFSCodeLookup.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ algorithm
12791279
case "ExternalObject" then BUILTIN_EXTERNALOBJECT;
12801280
case "Clock"
12811281
equation
1282-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
1282+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
12831283
then BUILTIN_CLOCK;
12841284
case "$RealType" then BUILTIN_REALTYPE_ITEM;
12851285
case "$IntegerType" then BUILTIN_INTEGERTYPE_ITEM;

Compiler/FrontEnd/Static.mo

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ algorithm
598598
// BTH
599599
case (cache,_,Absyn.CLOCK(value = ck),_,st,_,_,_,_)
600600
equation
601-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
601+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
602602
then
603603
(cache,DAE.CLKCONST(ck),DAE.PROP(DAE.T_CLOCK_DEFAULT,DAE.C_CONST()),st);
604604

@@ -4619,7 +4619,7 @@ algorithm
46194619

46204620
call = Expression.makePureBuiltinCall("Clock", {}, ty);
46214621
then (cache, call, DAE.PROP(DAE.T_CLOCK_DEFAULT, DAE.C_CONST()));
4622-
4622+
46234623
// clock with Integer interval "Clock(intervalCounter)"
46244624
case (cache,env,{aintervalCounter},{},impl,pre,_)
46254625
equation
@@ -6889,37 +6889,37 @@ algorithm
68896889
case "getInstanceName" then elabBuiltinGetInstanceName;
68906890
case "classDirectory" then elabBuiltinClassDirectory;
68916891
case "sample" then elabBuiltinSample;
6892-
case "Clock"
6892+
case "Clock"
68936893
equation
6894-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
6894+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
68956895
then elabBuiltinClock;
6896-
case "previous"
6896+
case "previous"
68976897
equation
6898-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
6898+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
68996899
then elabBuiltinPrevious;
6900-
case "hold"
6900+
case "hold"
69016901
equation
6902-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
6902+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
69036903
then elabBuiltinHold;
6904-
case "subSample"
6904+
case "subSample"
69056905
equation
6906-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
6906+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
69076907
then elabBuiltinSubSample;
6908-
case "superSample"
6908+
case "superSample"
69096909
equation
6910-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
6910+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
69116911
then elabBuiltinSuperSample;
6912-
case "shiftSample"
6912+
case "shiftSample"
69136913
equation
6914-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
6914+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
69156915
then elabBuiltinShiftSample;
6916-
case "backSample"
6916+
case "backSample"
69176917
equation
6918-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
6918+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
69196919
then elabBuiltinBackSample;
6920-
case "noClock"
6920+
case "noClock"
69216921
equation
6922-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
6922+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
69236923
then elabBuiltinNoClock;
69246924
end match;
69256925
end elabBuiltinHandler;

Compiler/Script/Interactive.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9602,9 +9602,9 @@ algorithm
96029602
case (Absyn.IDENT(name = "Boolean"),_,_) then (Absyn.CLASS("Boolean",false,false,false,Absyn.R_PREDEFINED_BOOLEAN(),
96039603
Absyn.dummyParts,Absyn.dummyInfo),Absyn.IDENT("Boolean"));
96049604
// BTH
9605-
case (Absyn.IDENT(name = "Clock"),_,_)
9605+
case (Absyn.IDENT(name = "Clock"),_,_)
96069606
equation
9607-
true = boolEq(Flags.getConfigBool(Flags.SYNCHRONOUS_FEATURES), true);
9607+
true = intGe(Flags.getConfigEnum(Flags.LANGUAGE_STANDARD), 33);
96089608
then (Absyn.CLASS("Clock",false,false,false,Absyn.R_PREDEFINED_CLOCK(),
96099609
Absyn.dummyParts,Absyn.dummyInfo),Absyn.IDENT("Clock"));
96109610

Compiler/Util/Flags.mo

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -899,10 +899,6 @@ constant ConfigFlag PROFILING_LEVEL = CONFIG_FLAG(58, "profiling",
899899
})),
900900
Util.gettext("Sets the profiling level to use. Profiled equations and functions record execution time and count for each time step taken by the integrator."));
901901

902-
constant ConfigFlag SYNCHRONOUS_FEATURES = CONFIG_FLAG(59, "synchronousFeatures",
903-
NONE(), EXTERNAL(), BOOL_FLAG(false), NONE(),
904-
Util.gettext("Activate support for the synchronous language elements of Modelica 3.3, Chapter 16."));
905-
906902
// This is a list of all configuration flags. A flag can not be used unless it's
907903
// in this list, and the list is checked at initialization so that all flags are
908904
// sorted by index (and thus have unique indices).
@@ -964,8 +960,7 @@ constant list<ConfigFlag> allConfigFlags = {
964960
GENERATE_SYMBOLIC_JACOBIAN,
965961
GENERATE_SYMBOLIC_LINEARIZATION,
966962
INT_ENUM_CONVERSION,
967-
PROFILING_LEVEL,
968-
SYNCHRONOUS_FEATURES
963+
PROFILING_LEVEL
969964
};
970965

971966
public function new

0 commit comments

Comments
 (0)