Changeset 11804


Ignore:
Timestamp:
Oct 30, 2018 4:28:54 PM (14 months ago)
Author:
Jonathan Kämpe
Message:

#5670 Added some documentation for FGlobalVariable. Updated fclass tostring to use "global variable" instead of "package constant".

Location:
branches/dev-1637/Compiler
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-1637/Compiler/ModelicaFlatTree/src/jastadd/PrettyPrint.jrag

    r11777 r11804  
    10521052        }
    10531053        if (getNumFGlobalVariable() > 0) {
    1054             str.println(indent, "package constant");
     1054            str.println(indent, "global variables");
    10551055            for (FVariable fv : getFGlobalVariables()) {
    10561056                p.print(fv, str, nextInd);
  • branches/dev-1637/Compiler/ModelicaFlatTree/src/jastadd/ast/FlatModelica.ast

    r11777 r11804  
    134134abstract FTypePrefix : BaseNode;
    135135
     136/**
     137 * Variables accessed in a global scope separate from the normal lookup scope
     138 * (in the flat tree). Can be looked up from functions and equations. For example
     139 * package constants that can't be inlined during flattening. Referenced by FGlobalAccessExp.
     140 */
    136141FGlobalVariable : FVariable ::= FType;
    137142
  • branches/dev-1637/Compiler/ModelicaFrontEnd/test/modelica/ArrayTests.mo

    r11655 r11804  
    90099009 constant Real c[2] = 3;
    90109010 Real x;
    9011 package constant
     9011global variables
    90129012 constant Real ArrayTests.Other.ArrayConst3.c[2] = {2, 3};
    90139013equation
  • branches/dev-1637/Compiler/ModelicaFrontEnd/test/modelica/FunctionTests.mo

    r11777 r11804  
    482482 Real z[1];
    483483 Real z[2];
    484 package constant
     484global variables
    485485 constant Real FunctionTests.FunctionFlatten9.a[3] = {1, 2, 3};
    486486equation
     
    10021002fclass FunctionTests.FunctionFlatten21
    10031003 Real x = FunctionTests.FunctionFlatten21.f();
    1004 package constant
     1004global variables
    10051005 constant Real FunctionTests.FunctionFlatten21.f.x; // TODO: Compilation error?
    10061006
     
    10811081fclass FunctionTests.FunctionFlatten23
    10821082 Real y;
    1083 package constant
     1083global variables
    10841084 constant FunctionTests.FunctionFlatten23.R FunctionTests.FunctionFlatten23.f.r = FunctionTests.FunctionFlatten23.R(1, {3.14});
    10851085equation
     
    1030210302 constant Real a[3] = 3;
    1030310303 Real x;
    10304 package constant
     10304global variables
    1030510305 constant Real FunctionTests.UnknownArray29.a[3] = {1, 2, 3};
    1030610306equation
     
    1248112481 constant Real d[2] = {1, 2};
    1248212482 Real x = FunctionTests.ExtendFunc2.f2(1, 2);
    12483 package constant
     12483global variables
    1248412484 constant Real FunctionTests.ExtendFunc2.d[2] = {1, 2};
    1248512485
  • branches/dev-1637/Compiler/ModelicaFrontEnd/test/modelica/NameTests.mo

    r11655 r11804  
    17111711 parameter Integer j = 1 /* 1 */;
    17121712 Real y = NameTests.ConstantLookup32.f(j);
    1713 package constant
     1713global variables
    17141714 constant NameTests.ConstantLookup32.A NameTests.ConstantLookup32.C.d[2] = {NameTests.ConstantLookup32.A(3), NameTests.ConstantLookup32.A(4)};
    17151715
     
    17681768 parameter Integer j = 1 /* 1 */;
    17691769 Real y = NameTests.ConstantLookup33.f(j);
    1770 package constant
     1770global variables
    17711771 constant NameTests.ConstantLookup33.D.A NameTests.ConstantLookup33.C.d[2] = {NameTests.ConstantLookup33.D.A(3), NameTests.ConstantLookup33.D.A(4)};
    17721772
     
    18171817 parameter Integer j = 1 /* 1 */;
    18181818 parameter Real z;
    1819 package constant
     1819global variables
    18201820 constant NameTests.ConstantLookup34.A.B NameTests.ConstantLookup34.A.x[2] = {NameTests.ConstantLookup34.A.B({1, 2}), NameTests.ConstantLookup34.A.B({3, 4})};
    18211821parameter equation
     
    18991899 parameter Integer b.j = 1 /* 1 */;
    19001900 parameter Real b.z;
    1901 package constant
     1901global variables
    19021902 constant Real NameTests.ConstantLookup35.L.a[2] = {1, 2};
    19031903parameter equation
     
    19461946 parameter Integer j = 1 /* 1 */;
    19471947 parameter Real z;
    1948 package constant
     1948global variables
    19491949 constant NameTests.ConstantLookup36.B NameTests.ConstantLookup36.f.a[2] = {NameTests.ConstantLookup36.B({1, 2}), NameTests.ConstantLookup36.B({3, 4})};
    19501950parameter equation
  • branches/dev-1637/Compiler/ModelicaFrontEnd/test/modelica/RecordTests.mo

    r11777 r11804  
    20872087 Real w;
    20882088 discrete Integer i;
    2089 package constant
     2089global variables
    20902090 constant RecordTests.UnmodifiableComponent5.R RecordTests.UnmodifiableComponent5.r[2] = {RecordTests.UnmodifiableComponent5.R(1), RecordTests.UnmodifiableComponent5.R(2)};
    20912091initial equation
  • branches/dev-1637/Compiler/ModelicaFrontEnd/test/modelica/VariabilityTests.mo

    r11655 r11804  
    12111211 constant Real x = 1;
    12121212 Real y = VariabilityTests.ExternalObjectConstant1.f(global(VariabilityTests.ExternalObjectConstant1.eo1));
    1213 package constant
     1213global variables
    12141214 constant VariabilityTests.ExternalObjectConstant1.EO VariabilityTests.ExternalObjectConstant1.eo = VariabilityTests.ExternalObjectConstant1.EO.constructor(1.0);
    12151215 constant VariabilityTests.ExternalObjectConstant1.EO VariabilityTests.ExternalObjectConstant1.eo1 = global(VariabilityTests.ExternalObjectConstant1.eo);
     
    12851285 constant Real x = 1;
    12861286 Real y = VariabilityTests.ExternalObjectConstant2.f(global(VariabilityTests.ExternalObjectConstant2.eo1));
    1287 package constant
     1287global variables
    12881288 constant VariabilityTests.ExternalObjectConstant2.EO VariabilityTests.ExternalObjectConstant2.eo = VariabilityTests.ExternalObjectConstant2.EO.constructor(1.0);
    12891289 constant VariabilityTests.ExternalObjectConstant2.EO VariabilityTests.ExternalObjectConstant2.eo1 = VariabilityTests.ExternalObjectConstant2.g(global(VariabilityTests.ExternalObjectConstant2.eo));
     
    13681368fclass VariabilityTests.ExternalObjectGlobalConstant1
    13691369 Real y = VariabilityTests.ExternalObjectGlobalConstant1.f(time);
    1370 package constant
     1370global variables
    13711371 constant VariabilityTests.ExternalObjectGlobalConstant1.P.EO VariabilityTests.ExternalObjectGlobalConstant1.P.eo = VariabilityTests.ExternalObjectGlobalConstant1.P.EO.constructor(1.0);
    13721372 constant VariabilityTests.ExternalObjectGlobalConstant1.P.EO VariabilityTests.ExternalObjectGlobalConstant1.P.eo1 = global(VariabilityTests.ExternalObjectGlobalConstant1.P.eo);
  • branches/dev-1637/Compiler/ModelicaMiddleEnd/test/modelica/FunctionInlining.mo

    r11777 r11804  
    51265126 parameter Integer temp_2;
    51275127 parameter Real y.x;
    5128 package constant
     5128global variables
    51295129 constant FunctionInlining.GlobalConst2.R2 FunctionInlining.GlobalConst2.f.a = FunctionInlining.GlobalConst2.R2({FunctionInlining.GlobalConst2.R1(2), FunctionInlining.GlobalConst2.R1(3)});
    51305130parameter equation
     
    51685168 Real y;
    51695169 discrete Integer temp_1;
    5170 package constant
     5170global variables
    51715171 constant FunctionInlining.GlobalConst3.R1 FunctionInlining.GlobalConst3.r[1] = {FunctionInlining.GlobalConst3.R1(2)};
    51725172initial equation
     
    52295229fclass FunctionInlining.GlobalConstExtObj1
    52305230 Real y;
    5231 package constant
     5231global variables
    52325232 constant FunctionInlining.GlobalConstExtObj1.P.EO FunctionInlining.GlobalConstExtObj1.P.eo = FunctionInlining.GlobalConstExtObj1.P.EO.constructor({1.0});
    52335233 constant FunctionInlining.GlobalConstExtObj1.P.EO FunctionInlining.GlobalConstExtObj1.P.eo1 = global(FunctionInlining.GlobalConstExtObj1.P.eo);
  • branches/dev-1637/Compiler/ModelicaMiddleEnd/test/modelica/VariabilityPropagationTests.mo

    r11783 r11804  
    26762676 constant Real x = 1;
    26772677 parameter Real y;
    2678 package constant
     2678global variables
    26792679 constant VariabilityPropagationTests.ExternalObjectConstant1.EO VariabilityPropagationTests.ExternalObjectConstant1.eo = VariabilityPropagationTests.ExternalObjectConstant1.EO.constructor(1.0);
    26802680parameter equation
     
    27492749 constant Real x = 1;
    27502750 parameter Real y;
    2751 package constant
     2751global variables
    27522752 constant VariabilityPropagationTests.ExternalObjectConstant2.EO VariabilityPropagationTests.ExternalObjectConstant2.eo = VariabilityPropagationTests.ExternalObjectConstant2.EO.constructor(1.0);
    27532753parameter equation
Note: See TracChangeset for help on using the changeset viewer.