Skip to content

Commit

Permalink
Fixed getNthComponentAnnotation
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@884 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Dec 17, 2002
1 parent 6515683 commit 9338f70
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions modeq/dump.rml
Expand Up @@ -68,6 +68,7 @@ with "debug.rml"
relation select_string: (bool,string,string) => string
relation get_string_list : ('a list, 'a => string, string) => string
relation get_option_str: ('a option, 'a => string) => string
relation unparse_annotation_option: Absyn.Annotation option => string
end


Expand Down
6 changes: 6 additions & 0 deletions modeq/exp.rml
Expand Up @@ -1061,6 +1061,12 @@ relation print_exp2_str : (Exp,int) => string =
-------------------------------------
print_exp2_str (RANGE(_,start,SOME(step),stop),pri1) => s'''''

rule RTOpts.modelica_output => false &
int_real ival => rval &
real_string rval => res
---------------------------------------
print_exp2_str (CAST(REAL,ICONST(ival)),_) => res


rule RTOpts.modelica_output => false &
print_exp_str e => s &
Expand Down
14 changes: 9 additions & 5 deletions modeq/interactive.rml
Expand Up @@ -1578,22 +1578,26 @@ end

relation get_componentitems_annotation: Absyn.ComponentItem list => string =

rule get_annotation_string(Placement_records, ann) => s1 &
rule get_annotation_string(Placement_records, Absyn.ANNOTATION(mod)) => s1 &
string_append("{",s1) => s2 &
string_append(s2,"},") => s3 &
get_componentitems_annotation(rest) => str &
string_append(s3,str) => res
----------------------------
get_componentitems_annotation (Absyn.COMPONENTITEM(_,SOME(Absyn.COMMENT(SOME(ann),_)))::(rest as (_::_))) => res
get_componentitems_annotation (Absyn.COMPONENTITEM(_,SOME(Absyn.COMMENT(SOME(
Absyn.ANNOTATION(Absyn.MODIFICATION(_,Absyn.CREF_IDENT("Diagram",_),Absyn.CLASSMOD(mod,_),_)::_)
),_)))::(rest as (_::_))) => res

rule get_annotation_string(Placement_records, ann) => s1 &
rule get_annotation_string(Placement_records, Absyn.ANNOTATION(mod)) => s1 &
string_append("{",s1) => s2 &
string_append(s2,"}") => res
----------------------------
get_componentitems_annotation ([Absyn.COMPONENTITEM(_,SOME(Absyn.COMMENT(SOME(ann),_)))]) => res
get_componentitems_annotation ([Absyn.COMPONENTITEM(_,SOME(Absyn.COMMENT(SOME(
Absyn.ANNOTATION(Absyn.MODIFICATION(_,Absyn.CREF_IDENT("Diagram",_),Absyn.CLASSMOD(mod,_),_)::_)
),_)))]) => res

rule get_componentitems_annotation(rest) => str &
string_append("{},",str) => res
string_append("{nada},",str) => res
-----------------------
get_componentitems_annotation (Absyn.COMPONENTITEM(_,SOME(Absyn.COMMENT(NONE,_)))::(rest as (_::_))) => res

Expand Down

0 comments on commit 9338f70

Please sign in to comment.