Skip to content

Commit

Permalink
Cosmetic changes to .mo files.
Browse files Browse the repository at this point in the history
- changed all .rml to .mo
- changed all RML to MMC
- got rid of spaces between imports.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2575 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Oct 12, 2006
1 parent 0aaa9dc commit efb579b
Show file tree
Hide file tree
Showing 39 changed files with 143 additions and 550 deletions.
19 changes: 5 additions & 14 deletions Compiler/Algorithm.mo
Expand Up @@ -39,27 +39,25 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

file: Algorithm.rml
file: Algorithm.mo
module: Algorithm
description: Algorithm datatypes
RCS: $Id$
This file contains data types and functions for managing
algorithm sections. The algorithms in the AST are analyzed by the `Inst\'
module (Inst.rml) which uses this module to represent the algorithms. No
module (Inst.mo) which uses this module to represent the algorithms. No
processing of any kind, except for building the datastructure is
done in this module.
It is used primarily by Inst.rml which both provides its input data
It is used primarily by Inst.mo which both provides its input data
and uses its \"output\" data.
"

public import OpenModelica.Compiler.Exp;

public import OpenModelica.Compiler.Types;

public import OpenModelica.Compiler.SCode;

public
Expand Down Expand Up @@ -146,19 +144,12 @@ uniontype Else "An if statements can one or more `elseif\' branches and an
end Else;

protected import OpenModelica.Compiler.Util;

protected import OpenModelica.Compiler.Print;

protected import OpenModelica.Compiler.Debug;

protected import OpenModelica.Compiler.Error;

protected import OpenModelica.Compiler.Absyn;

public function makeAssignment "adrpo -- not used
with \"Dump.rml\"

function: makeAssignment
public function makeAssignment "function: makeAssignment
This function creates an `ASSIGN\' construct, and checks that the
assignment is semantically valid, which means that the component
Expand Down Expand Up @@ -526,7 +517,7 @@ algorithm
outStatement:=
matchcontinue (inExp1,inExp2,inProperties3,inProperties4)
local Exp.Exp cond,msg;
case (cond,msg,Types.PROP(type_ = (Types.T_BOOL(varLstBool = _),_)),Types.PROP(type_ = (Types.T_STRING(varLstString = _),_))) then ASSERT(cond,msg); /* RML does not handle the pattern below T_BOOL(_), hence we need to
case (cond,msg,Types.PROP(type_ = (Types.T_BOOL(varLstBool = _),_)),Types.PROP(type_ = (Types.T_STRING(varLstString = _),_))) then ASSERT(cond,msg); /* MetaModelica Compiler (MMC) does not handle the pattern below T_BOOL(_), hence we need to
implement this differently. rule not let T_BOOL(_) = condt &
Print.printBuf \"# Type error in assert condition.\\n\" &
Print.printBuf \" Expected Boolean, got \" &
Expand Down
19 changes: 7 additions & 12 deletions Compiler/Builtin.mo
Expand Up @@ -39,7 +39,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
file: Builtin.rml
file: Builtin.mo
module: Builtin
description: Builting tyepes and variables
Expand All @@ -55,25 +55,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"

public import OpenModelica.Compiler.Absyn;

public import OpenModelica.Compiler.SCode;

public import OpenModelica.Compiler.Env;

protected import OpenModelica.Compiler.Types "protected imports" ;

/* protected imports */
protected import OpenModelica.Compiler.Types;
protected import OpenModelica.Compiler.ClassInf;

public constant SCode.Class rlType=SCode.CLASS("RealType",false,false,SCode.R_PREDEFINED_REAL(),
SCode.PARTS({},{},{},{},{},NONE)) "adrpo -- not used
with \"Debug.rml\"
with \"Print.rml\"
/*
- The primitive types
These are the primitive types that are used to build the types
`Real\', `Integer\' etc.
" ;
*/
public constant SCode.Class rlType=SCode.CLASS("RealType",false,false,SCode.R_PREDEFINED_REAL(),
SCode.PARTS({},{},{},{},{},NONE)) " real type ";

public constant SCode.Class intType=SCode.CLASS("IntegerType",false,false,SCode.R_PREDEFINED_INT(),
SCode.PARTS({},{},{},{},{},NONE));
Expand Down
44 changes: 8 additions & 36 deletions Compiler/Ceval.mo
Expand Up @@ -39,7 +39,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

file: Ceval.rml
file: Ceval.mo
module: Ceval
description: Constant propagation of expressions
Expand All @@ -65,18 +65,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"

public import OpenModelica.Compiler.Env;

public import OpenModelica.Compiler.Exp;

public import OpenModelica.Compiler.Interactive;

public import OpenModelica.Compiler.Values;

public import OpenModelica.Compiler.DAELow;

public import OpenModelica.Compiler.Absyn;
public import OpenModelica.Compiler.Types;

public import OpenModelica.Compiler.Types;
public
uniontype Msg
record MSG "Give error message" end MSG;
Expand All @@ -86,53 +81,30 @@ uniontype Msg
end Msg;

protected import OpenModelica.Compiler.SimCodegen;

protected import OpenModelica.Compiler.Static;

protected import OpenModelica.Compiler.Print;

protected import OpenModelica.Compiler.ModUtil;

protected import OpenModelica.Compiler.System;

protected import OpenModelica.Compiler.SCode;

protected import OpenModelica.Compiler.Inst;

protected import OpenModelica.Compiler.Lookup;

protected import OpenModelica.Compiler.Dump;

protected import OpenModelica.Compiler.DAE;

protected import OpenModelica.Compiler.Debug;

protected import OpenModelica.Compiler.Util;

protected import OpenModelica.Compiler.ClassInf;

protected import OpenModelica.Compiler.RTOpts;

protected import OpenModelica.Compiler.Parser;

protected import OpenModelica.Compiler.Prefix;

protected import OpenModelica.Compiler.Codegen;

protected import OpenModelica.Compiler.ClassLoader;

protected import OpenModelica.Compiler.Derive;

protected import OpenModelica.Compiler.Connect;

protected import OpenModelica.Compiler.Error;

protected import OpenModelica.Compiler.Settings;

protected function cevalBuiltin "adrpo -- not used
with \"ErrorExt.rml\"

function: cevalBuiltin
protected function cevalBuiltin "function: cevalBuiltin
Helper for ceval. Parts for builtin calls are moved here, for readability.
See ceval for documentation.
Expand Down Expand Up @@ -776,7 +748,7 @@ algorithm
(cache,Values.REAL(stop_1),st_2) = ceval(cache,env, stop, impl, st_1, dim, msg);
diff = stop_1 -. start_1;
step = intReal(1);
arr = cevalRangeReal(start_1, step, stop_1) "bug in rml, 1.0 => 0.0 in cygwin" ;
arr = cevalRangeReal(start_1, step, stop_1) "bug in MetaModelica Compiler (MMC), 1.0 => 0.0 in cygwin" ;
then
(cache,Values.ARRAY(arr),st_2);

Expand Down Expand Up @@ -2889,7 +2861,7 @@ algorithm
command = Settings.getCompileCommand();
false = Util.isEmptyString(command);
retVal = System.regularFileExists(command);
true = retVal != 0;
true = retVal <> 0;
str=Util.stringAppendList({"command ",command," not found. Check OPENMODELICAHOME"});
Error.addMessage(Error.SIMULATOR_BUILD_ERROR, {str});
then fail();
Expand All @@ -2906,7 +2878,7 @@ algorithm
*/
s_call = Util.stringAppendList({"\"",omhome_1,pd,"bin",pd,"Compile","\""});
retVal = System.regularFileExists(s_call);
true = retVal != 0;
true = retVal <> 0;
str=Util.stringAppendList({"command ",s_call," not found. Check OPENMODELICAHOME"});
Error.addMessage(Error.SIMULATOR_BUILD_ERROR, {str});
then
Expand Down Expand Up @@ -4033,7 +4005,7 @@ algorithm
Option<Interactive.InteractiveSymbolTable> st;
Msg msg;
Env.Cache cache;
case (cache,env,{exp},impl,st,msg) /* tan is not implemented in RML for some strange reason. */
case (cache,env,{exp},impl,st,msg) /* tan is not implemented in MetaModelica Compiler (MMC) for some strange reason. */
equation
(cache,Values.REAL(rv),_) = ceval(cache,env, exp, impl, st, NONE, msg);
sv = realSin(rv);
Expand Down Expand Up @@ -4137,7 +4109,7 @@ algorithm
Option<Interactive.InteractiveSymbolTable> st;
Msg msg;
Env.Cache cache;
case (cache,env,{exp},impl,st,msg) /* atan is not implemented in RML for some strange reason. */
case (cache,env,{exp},impl,st,msg) /* atan is not implemented in MetaModelica Compiler (MMC) for some strange reason. */
equation
(cache,Values.REAL(rv),_) = ceval(cache,env, exp, impl, st, NONE, msg);
rv_1 = System.atan(rv);
Expand Down
8 changes: 2 additions & 6 deletions Compiler/ClassInf.mo
Expand Up @@ -39,7 +39,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

file: ClassInf.rml
file: ClassInf.mo
module: ClassInf
description: Class restrictions
Expand Down Expand Up @@ -140,13 +140,9 @@ uniontype Event "- Events"
end Event;

protected import OpenModelica.Compiler.Print;

protected import OpenModelica.Compiler.Error;

public function printStateStr "adrpo -- not used
with \"Absyn.rml\"

- Printing
public function printStateStr "- Printing
Some functions for printing error and debug information about the
state machine.
Expand Down
14 changes: 2 additions & 12 deletions Compiler/ClassLoader.mo
Expand Up @@ -39,7 +39,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

file: ClassLoader.rml
file: ClassLoader.mo
module: ClassLoader
description: Loading of classes from $OPENMODELICALIBRARY.
Expand All @@ -55,23 +55,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
public import OpenModelica.Compiler.Absyn;

protected import OpenModelica.Compiler.System;

protected import OpenModelica.Compiler.Interactive;

protected import OpenModelica.Compiler.Util;

protected import OpenModelica.Compiler.Parser;

protected import OpenModelica.Compiler.Print;

protected import OpenModelica.Compiler.Debug;

public function loadClass "adrpo -- not used
with \"Lookup.rml\"
with \"Env.rml\"
with \"Dump.rml\"

function: loadClass
public function loadClass "function: loadClass
This function takes a \'Path\' and the $OPENMODELICALIBRARY as a string
and tries to load the class from the path.
If the classname is qualified, the complete package is loaded.
Expand Down
37 changes: 10 additions & 27 deletions Compiler/Codegen.mo
Expand Up @@ -39,7 +39,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

file: Codegen.rml
file: Codegen.mo
module: Codegen
description: Generate C code from DAE (Flat Modelica) for Modelica
functions. This code is compiled and linked to the simulation code or when
Expand All @@ -56,11 +56,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------"

public import OpenModelica.Compiler.DAE;

public import OpenModelica.Compiler.Print;

public import OpenModelica.Compiler.Exp;

public import OpenModelica.Compiler.Absyn;

public
Expand Down Expand Up @@ -142,31 +139,17 @@ uniontype ExpContext
end ExpContext;

protected import OpenModelica.Compiler.Debug;



protected import OpenModelica.Compiler.Algorithm;

protected import OpenModelica.Compiler.ClassInf;

protected import OpenModelica.Compiler.ModUtil;

protected import OpenModelica.Compiler.Types;

protected import OpenModelica.Compiler.Util;

protected import OpenModelica.Compiler.Inst;

protected import OpenModelica.Compiler.Interactive;

protected import OpenModelica.Compiler.System;

protected import OpenModelica.Compiler.Error;

public constant CFunction cEmptyFunction=CFUNCTION("","",{},{},{},{},{},{}) "adrpo -- not used
with \"Dump.rml\"

-------------------------------------------------------------------------" ;
public constant CFunction cEmptyFunction=CFUNCTION("","",{},{},{},{},{},{}) " empty function ";

public function cMakeFunction "function: cMakeFunction
Expand Down Expand Up @@ -5767,14 +5750,14 @@ algorithm
res = stringAppend(name, ".data");
then
res;
/* case arg /* INPUT/OUTPUT STRING */
equation
DAE.EXTARG(componentRef = cref,attributes = attr,type_ = ty) = arg;
true = Types.isString(ty);
(name,_) = compRefCstr(cref);
res = stringAppend(name, ".data");
then
res;*/
// case arg /* INPUT/OUTPUT STRING */
// equation
// DAE.EXTARG(componentRef = cref,attributes = attr,type_ = ty) = arg;
// true = Types.isString(ty);
// (name,_) = compRefCstr(cref);
// res = stringAppend(name, ".data");
// then
// res;
case arg /* INPUT/OUTPUT NON-ARRAY */
equation
DAE.EXTARG(componentRef = cref,attributes = attr,type_ = ty) = arg;
Expand Down

0 comments on commit efb579b

Please sign in to comment.