Skip to content

Commit

Permalink
moving to laptop.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@821 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Jul 25, 2002
1 parent 9397f50 commit 86d4891
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modeq/absyn_builder/walker.g
Expand Up @@ -538,7 +538,7 @@ element returns [void* ast]
component_list returns [void* ast]
{
l_stack el_stack;
void* e;
void* e=0;
}
:
e = component_declaration { el_stack.push(e); }
Expand Down
8 changes: 7 additions & 1 deletion modeq/interactive.rml
Expand Up @@ -63,6 +63,11 @@ val Line_records = "type LinePattern=enumeration(None,Solid,Dash,Dot,DashDot,Das

val Icon_records = "record CoordinateSystem Real extent[2,2]; end CoordinateSystem; record Icon CoordinateSystem coordinateSystem(extent ={{-10.0, -10.0}, {10.0, 10.0}}); end Icon;"

(* This variable contains all records needed for the graphical primitives, such as Line, Ellipse, etc. *)
(* PA. Only Line for now... *)
val Graphics_records = "type LinePattern=enumeration(None,Solid,Dash,Dot,DashDot,DashDotDot); type Arrow=enumeration(None,Open,Filled,Half); record Line Boolean visible=true; Real points[2,:]; Integer color[3]={0,0,0}; LinePattern pattern = LinePattern.Solid; Real thickness=0.25; Arrow arrow[2]={Arrow.None,Arrow.None}; Real arrowSize = 3.0; Boolean smooth=false; end Line;"


(** relation: evaluate
** This relation evaluates expressions feeded interactively to the compiler.
**)
Expand Down Expand Up @@ -522,7 +527,8 @@ end

relation get_icon_annotation_str: (Absyn.ElementArg list) => string =

rule get_annotation_string (Icon_records,Absyn.ANNOTATION([ann])) => s1 &
rule string_append(Icon_records,Graphics_records) => records &
get_annotation_string (records,Absyn.ANNOTATION([ann])) => s1 &
get_graphics_constructors_str(mod) => s2 &
string_append(s1,",") => s3 &
string_append(s3,s2) => str
Expand Down
21 changes: 18 additions & 3 deletions modeq/staticexp.rml
Expand Up @@ -800,7 +800,7 @@ relation elab_call_args : (Env.Env, Absyn.Path, Absyn.Exp list)

(* Lookup.lookup_type(env,fn) => (t as Types.T_FUNCTION(params,restype)) & *)
Lookup.lookup_functions_in_env(env,fn) => typelist &
(* print "We got the type list\n" & *)
print "We got the type list\n" &
elab_types (env, args, typelist) => (args', c, restype) &
(* & print "We just elaborated the types\n" *)
is_tuple restype => tuple &
Expand Down Expand Up @@ -854,10 +854,12 @@ relation elab_types: (Env.Env, Absyn.Exp list, Types.Type list)

(* We found a match.*)
rule Debug.fprintln ("sei", "We try the elab_input") &
Debug.fprintln ("sei", "testing type:") &
Debug.fcall ("sei", Types.print_type,t) &
elab_input_args(env, args, params ) => (args',c) &
Debug.fprintln ("sei", "We found a match." )
------------------
elab_types(env, args, Types.T_FUNCTION(params,restype)::trest)
elab_types(env, args, (t as Types.T_FUNCTION(params,restype))::trest)
=> (args', c, restype)

(* We did not found a match, try next. *)
Expand Down Expand Up @@ -1062,6 +1064,19 @@ end
relation elab_input_args : (Env.Env, Absyn.Exp list, Types.FuncArg list)
=> (Exp.Exp list, bool) =

rule Debug.fprint("sei","elab_input_args called\n") &
list_length(explst) => elen &
int_string(elen) => elenstr &
Debug.fprint("sei","explen = ") &
Debug.fprint("sei",elenstr) &
Debug.fprint("sei", ", ") &
list_length(funcarglst) => farglen &
int_string(farglen) => farglenlst &
Debug.fprint("sei","farg len = ") &
Debug.fprint("sei",farglenlst)
---------------------
elab_input_args(env,explst,funcarglst) => fail

axiom elab_input_args(_, [], []) => ([], true)
(*PR. What is the c for. If all input arguments from the function
* call are constants then the result is a constant.
Expand All @@ -1077,7 +1092,7 @@ relation elab_input_args : (Env.Env, Absyn.Exp list, Types.FuncArg list)
Which is not done at all now??
*)

rule Debug.fprintln ("sei", "Entering elab_input_args-2") &
rule Debug.fprintln ("sei", "Entering elab_input_args-2\n") &
elab_exp(env, e) => (e',PROP(t, c1)) &
match_type(e', t, vt) => (e'',_) &
elab_input_args(env, es, vs) => (args', c2) &
Expand Down

0 comments on commit 86d4891

Please sign in to comment.