Skip to content

Commit

Permalink
undated to Java names all the names of the external relations!
Browse files Browse the repository at this point in the history
please, if you add some other external relations do not use "_" in it
at least until we move to MetaModelica.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2220 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Mar 16, 2006
1 parent 7a8e3d9 commit d3bbcb5
Show file tree
Hide file tree
Showing 53 changed files with 1,527 additions and 2,786 deletions.
6 changes: 3 additions & 3 deletions Compiler/Absyn.rml
Expand Up @@ -539,7 +539,7 @@ relation element_spec_name : ElementSpec => Ident =

axiom element_spec_name COMPONENTS(_,_,[COMPONENTITEM(COMPONENT(n,_,_),_,_)]) => n

rule Print.print_buf "# element_spec_name EXTENDS\n"
rule Print.printBuf "# element_spec_name EXTENDS\n"
-------------------------------------
element_spec_name EXTENDS(_,_) => fail

Expand Down Expand Up @@ -696,7 +696,7 @@ relation get_cref_from_exp: ( Exp ) => ComponentRef list =
get_cref_from_exp(RANGE(e1,NONE,e2)) => res

rule (*Util.list_map(expl,get_cref_from_exp) => res*)
Print.print_buf "Not implemented yet\n"
Print.printBuf "Not implemented yet\n"
------------------
get_cref_from_exp(TUPLE(expl)) => []

Expand Down Expand Up @@ -871,7 +871,7 @@ end
relation print_restr : Restriction => () =

rule restr_string restr => str &
Print.print_buf str
Print.printBuf str
----------------
print_restr restr
end
Expand Down
14 changes: 7 additions & 7 deletions Compiler/Algorithm.rml
Expand Up @@ -189,10 +189,10 @@ relation make_assignment : (Exp.Exp, Types.Properties,
-------------------------------------------
make_assignment (lhs,lprop,rhs,rprop,_) => fail

rule Print.print_error_buf "- Algorithm.make_assignment failed\n" &
Print.print_error_buf " " & Exp.print_exp lhs &
Print.print_error_buf " := " & Exp.print_exp rhs &
Print.print_error_buf "\n"
rule Print.printErrorBuf "- Algorithm.make_assignment failed\n" &
Print.printErrorBuf " " & Exp.print_exp lhs &
Print.printErrorBuf " := " & Exp.print_exp rhs &
Print.printErrorBuf "\n"
---------------------------------------------
make_assignment (lhs, lprop, rhs, rprop, _) => fail

Expand Down Expand Up @@ -408,9 +408,9 @@ relation make_assert: (Exp.Exp,
(* RML does not handle the pattern below T_BOOL(_), hence we need to
implement this differently. *)
(* rule not let T_BOOL(_) = condt &
Print.print_buf "# Type error in assert condition.\n" &
Print.print_buf " Expected Boolean, got " &
Types.print_type condt & Print.print_buf "\n"
Print.printBuf "# Type error in assert condition.\n" &
Print.printBuf " Expected Boolean, got " &
Types.print_type condt & Print.printBuf "\n"
--------------------------------------------
make_assert(_,_,Types.PROP(condt,_),_) => fail
*)
Expand Down
4 changes: 2 additions & 2 deletions Compiler/Builtin.rml
Expand Up @@ -803,7 +803,7 @@ relation initial_env =
Env.extend_frame_t(env, "ndims", array6dimbool2int) => env &
Env.extend_frame_t(env, "ndims", array7dimbool2int) => env &
Env.extend_frame_t(env, "ndims", array8dimbool2int) => env &
(* Debug. Print.print_buf "\n Just before the built in built in size." & *)
(* Debug. Print.printBuf "\n Just before the built in built in size." & *)

Env.extend_frame_t(env, "size", array1dimint_int2int) => env &
Env.extend_frame_t(env, "size", array2dimint_int2int) => env &
Expand Down Expand Up @@ -1266,7 +1266,7 @@ relation initial_env =
Env.extend_frame_t(env, "sqrt", real2real) => env


(*Debug. Print.print_buf "\n Just AFTER the built in array functions part." *)
(*Debug. Print.printBuf "\n Just AFTER the built in array functions part." *)
----------------------------------------------
initial_env () => env

Expand Down
194 changes: 97 additions & 97 deletions Compiler/Ceval.rml

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions Compiler/ClassInf.rml
Expand Up @@ -164,59 +164,59 @@ end

relation print_state : State => () =

rule Print.print_buf "UNKNOWN " & Print.print_buf s
rule Print.printBuf "UNKNOWN " & Print.printBuf s
----------------------------
print_state UNKNOWN(s)

rule Print.print_buf "MODEL " & Print.print_buf s
rule Print.printBuf "MODEL " & Print.printBuf s
----------------------------
print_state MODEL(s)

rule Print.print_buf "RECORD " & Print.print_buf s
rule Print.printBuf "RECORD " & Print.printBuf s
----------------------------
print_state RECORD(s)

rule Print.print_buf "BLOCK " & Print.print_buf s
rule Print.printBuf "BLOCK " & Print.printBuf s
----------------------------
print_state BLOCK(s)

rule Print.print_buf "CONNECTOR " & Print.print_buf s
rule Print.printBuf "CONNECTOR " & Print.printBuf s
----------------------------
print_state CONNECTOR(s)

rule Print.print_buf "TYPE " & Print.print_buf s
rule Print.printBuf "TYPE " & Print.printBuf s
----------------------------
print_state TYPE(s)

rule Print.print_buf "PACKAGE " & Print.print_buf s
rule Print.printBuf "PACKAGE " & Print.printBuf s
----------------------------
print_state PACKAGE(s)

rule Print.print_buf "FUNCTION " & Print.print_buf s
rule Print.printBuf "FUNCTION " & Print.printBuf s
----------------------------
print_state FUNCTION(s)

rule Print.print_buf "TYPE_INTEGER " & Print.print_buf s
rule Print.printBuf "TYPE_INTEGER " & Print.printBuf s
----------------------------
print_state TYPE_INTEGER(s)

rule Print.print_buf "TYPE_REAL " & Print.print_buf s
rule Print.printBuf "TYPE_REAL " & Print.printBuf s
----------------------------
print_state TYPE_REAL(s)

rule Print.print_buf "TYPE_STRING " & Print.print_buf s
rule Print.printBuf "TYPE_STRING " & Print.printBuf s
----------------------------
print_state TYPE_STRING(s)

rule Print.print_buf "TYPE_BOOL " & Print.print_buf s
rule Print.printBuf "TYPE_BOOL " & Print.printBuf s
----------------------------
print_state TYPE_BOOL(s)

rule Print.print_buf "IS_NEW " & Print.print_buf s
rule Print.printBuf "IS_NEW " & Print.printBuf s
----------------------------
print_state IS_NEW(s)

rule Print.print_buf "HAS_EQUATIONS " & Print.print_buf s
rule Print.printBuf "HAS_EQUATIONS " & Print.printBuf s
----------------------------
print_state HAS_EQUATIONS(s)

Expand Down Expand Up @@ -249,11 +249,11 @@ end
(** relation: print_event *)
relation print_event : Event => () =

rule Print.print_buf "FOUND_EQUATION"
rule Print.printBuf "FOUND_EQUATION"
----------------------
print_event FOUND_EQUATION

rule Print.print_buf "NEWDEF"
rule Print.printBuf "NEWDEF"
--------------
print_event NEWDEF

Expand Down Expand Up @@ -335,8 +335,8 @@ relation trans : (State, Event) => State =
axiom trans(FUNCTION(s), FOUND_EQUATION) => fail
axiom trans(HAS_EQUATIONS(s), FOUND_EQUATION) => HAS_EQUATIONS(s)

rule Print.print_buf "- trans failed: " & print_state st &
Print.print_buf ", " & print_event ev & Print.print_buf "\n"
rule Print.printBuf "- trans failed: " & print_state st &
Print.printBuf ", " & print_event ev & Print.printBuf "\n"
--------------------------------------------------------
trans(st, ev) => fail

Expand Down Expand Up @@ -400,13 +400,13 @@ relation assert_valid : (State, SCode.Restriction) => () =
------------
assert_valid(st,re)

rule Print.print_error_buf "# Restriction violation: " &
rule Print.printErrorBuf "# Restriction violation: " &
get_state_name st => str &
Print.print_error_buf str &
Print.print_error_buf " is not a " &
Print.printErrorBuf str &
Print.printErrorBuf " is not a " &
SCode.restr_string re => str &
Print.print_error_buf str &
Print.print_error_buf "\n"
Print.printErrorBuf str &
Print.printErrorBuf "\n"
-------------------------------------------
assert_valid(st,re) => fail

Expand Down
42 changes: 21 additions & 21 deletions Compiler/ClassLoader.rml
Expand Up @@ -82,22 +82,22 @@ with "Dump.rml"
relation load_class: (Absyn.Path, string) => (Absyn.Program) =

(* Simple names: Just load the file if it can be found in $MODELICAPATH *)
rule System.group_delimiter => gd &
rule System.groupDelimiter => gd &
System.strtok(mp,gd) => mps &
load_class_from_mps(classname,mps) => p
-------------------------------------
load_class(Absyn.IDENT(classname),mp) => p

(* Qualified names: First check if it is defined in a file pack.mo *)
rule System.group_delimiter => gd &
rule System.groupDelimiter => gd &
System.strtok(mp,gd) => mps &
load_class_from_mps(pack,mps) => p
-------------------------------------
load_class(Absyn.QUALIFIED(pack,rest),mp) => p

(* Qualified names: Else, load the complete package and then check that *)
(* the package contains the file *)
rule System.group_delimiter => gd &
rule System.groupDelimiter => gd &
System.strtok(mp,gd) => mps &
load_complete_package_from_mps(pack,mps,Absyn.TOP,Absyn.PROGRAM([],Absyn.TOP)) => p &
Interactive.get_pathed_class_in_program(path,p)=> _
Expand All @@ -115,7 +115,7 @@ end
**)
relation exist_regular_file: (string) => () =

rule System.regular_file_exist filename => 0
rule System.regularFileExists filename => 0
----------------------------
exist_regular_file(filename)
end
Expand All @@ -126,7 +126,7 @@ end
**)
relation exist_directory_file: (string) => () =

rule System.directory_exist filename => 0
rule System.directoryExists filename => 0
----------------------------
exist_directory_file(filename)
end
Expand Down Expand Up @@ -157,7 +157,7 @@ end
relation load_class_from_mp: (Absyn.Ident, string) => Absyn.Program =

rule System.trim(mp'," \"\t") => mp &
System.path_delimiter => pd &
System.pathDelimiter => pd &
string_append(class,".mo") => classfile &
Util.string_append_list([mp,pd,classfile])=> classfile' &
exist_regular_file(classfile') &
Expand All @@ -167,12 +167,12 @@ relation load_class_from_mp: (Absyn.Ident, string) => Absyn.Program =
load_class_from_mp(class,mp') => p

rule System.trim(mp'," \"\t") => mp &
System.path_delimiter => pd &
System.pathDelimiter => pd &
Util.string_append_list([mp,pd,class]) => dirfile &
Util.string_append_list([dirfile, pd, "package.mo"]) => packfile &
exist_directory_file dirfile &
exist_regular_file packfile &
Print.print_buf "Class is package stored in a directory, loading whole package(incl. subdir)\n" &
Print.printBuf "Class is package stored in a directory, loading whole package(incl. subdir)\n" &
load_complete_package_from_mp(class,mp,Absyn.TOP,
Absyn.PROGRAM([],Absyn.TOP)) => p
--------------------------------------
Expand Down Expand Up @@ -205,31 +205,31 @@ end
**)
relation load_complete_package_from_mp: (Absyn.Ident, string, Absyn.Within, Absyn.Program) => Absyn.Program =

rule System.path_delimiter => pd &
rule System.pathDelimiter => pd &
Util.string_append_list([mp,pd,pack]) => mp' &
Util.string_append_list([mp', pd, "package.mo"]) => packagefile &
exist_regular_file(packagefile) &
print "parsing " & print packagefile & print "\n" &
Parser.parse(packagefile) => Absyn.PROGRAM(p1,w1) &
Print.print_buf("loading ") & Print.print_buf(packagefile) & Print.print_buf "\n" &
Print.printBuf("loading ") & Print.printBuf(packagefile) & Print.printBuf "\n" &
Interactive.update_program(Absyn.PROGRAM(p1,w1),Absyn.PROGRAM(oldc,Absyn.TOP)) => p1' &
System.sub_directories(mp') => subdirs &
System.subDirectories(mp') => subdirs &
Util.string_delimit_list(subdirs, ", ") => subdirstr &
print "subdirs =" & print subdirstr & print "\n" &
load_complete_subdirs(subdirs,pack,mp',within,p1') => p2 &
load_complete_subfiles(pack,mp',within,p2) => p
------------------------------
load_complete_package_from_mp(pack,mp,within as Absyn.TOP,Absyn.PROGRAM(oldc,_)) => p

rule System.path_delimiter => pd &
rule System.pathDelimiter => pd &
Util.string_append_list([mp,pd,pack]) => mp' &
Util.string_append_list([mp',pd, "package.mo"]) => packagefile &
exist_regular_file(packagefile) &
print "parsing " & print packagefile & print "\n" &
Parser.parse(packagefile) => Absyn.PROGRAM(p1,w1) &
Print.print_buf("loading ") & Print.print_buf(packagefile) & Print.print_buf "\n" &
Print.printBuf("loading ") & Print.printBuf(packagefile) & Print.printBuf "\n" &
Interactive.update_program(Absyn.PROGRAM(p1,Absyn.WITHIN(wpath)),Absyn.PROGRAM(oldc,Absyn.TOP)) => p1' &
System.sub_directories(mp') => subdirs &
System.subDirectories(mp') => subdirs &
Util.string_delimit_list(subdirs, ", ") => subdirstr &
print "subdirs =" & print subdirstr & print "\n" &
load_complete_subdirs(subdirs,pack,mp',within,p1') => p2 &
Expand Down Expand Up @@ -281,14 +281,14 @@ relation load_complete_subfiles: (Absyn.Ident, string, Absyn.Within, Absyn.Progr
=> Absyn.Program =

rule (* Here *.mo files in same directory as package.mo should be loaded as sub-packages*)
System.mo_files(mp)=> mofiles &
System.moFiles(mp)=> mofiles &
Absyn.join_paths(within,Absyn.IDENT(pack)) => within' &
load_subpackage_files(mofiles,mp,Absyn.WITHIN(within'),oldp) => p
------------------------------------------
load_complete_subfiles(pack,mp,Absyn.WITHIN(within),oldp) => p

rule (* Here *.mo files in same directory as package.mo should be loaded as sub-packages*)
System.mo_files(mp)=> mofiles &
System.moFiles(mp)=> mofiles &
load_subpackage_files(mofiles,mp,Absyn.WITHIN(Absyn.IDENT(pack)),oldp) => p
------------------------------------------
load_complete_subfiles(pack,mp,Absyn.TOP,oldp) => p
Expand All @@ -308,11 +308,11 @@ relation load_subpackage_files: (string list, string, Absyn.Within, Absyn.Progra

axiom load_subpackage_files([],mp,within,Absyn.PROGRAM(cls,w)) => Absyn.PROGRAM(cls,w)

rule System.path_delimiter => pd &
rule System.pathDelimiter => pd &
Util.string_append_list([mp,pd,f]) => f' &
print "parsing " & print f' & print "\n" &
Parser.parse(f') => Absyn.PROGRAM(cls,_) &
Print.print_buf("loading ") & Print.print_buf(f') & Print.print_buf "\n" &
Print.printBuf("loading ") & Print.printBuf(f') & Print.printBuf "\n" &
Interactive.update_program(Absyn.PROGRAM(cls,within),Absyn.PROGRAM(oldc,Absyn.TOP))=> p' &
load_subpackage_files(fs, mp, within, p') => p''
-------------------------------
Expand All @@ -335,17 +335,17 @@ end
relation load_file:(string)
=> (Absyn.Program) =

rule System.regular_file_exist(name) => 0 &
rule System.regularFileExists(name) => 0 &
Util.get_absolute_directory_and_file(name) => (dir,"package.mo") &
Parser.parse(name) => p1' &
System.path_delimiter() => pd &
System.pathDelimiter() => pd &
Util.string_append_list([dir,pd,".."])=> dir' &
load_model_from_each_class(p1',dir') => p1
-----------------------------------
load_file (name)
=> p1

rule System.regular_file_exist(name) => 0 &
rule System.regularFileExists(name) => 0 &
Util.get_absolute_directory_and_file(name) => (dir,filename) &
Parser.parse(name) => p1
-----------------------------------
Expand Down

0 comments on commit d3bbcb5

Please sign in to comment.