Skip to content

Commit

Permalink
- Added Absyn.Info for Absyn.IMPORT(...)
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7817 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jan 28, 2011
1 parent 16a6f00 commit d9dcf75
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions Compiler/FrontEnd/Absyn.mo
Expand Up @@ -386,6 +386,7 @@ uniontype ElementSpec "An element is something that occurs in a public or protec
record IMPORT
Import import_ "import" ;
Option<Comment> comment "comment" ;
Info info;
end IMPORT;

record COMPONENTS
Expand Down
7 changes: 4 additions & 3 deletions Compiler/FrontEnd/Dependency.mo
Expand Up @@ -336,9 +336,10 @@ algorithm
d = buildClassDependsInElementAttr(attr,optPath,cname,(d,p,env,ht));
d = buildClassDependsInComponentItems(citems,optPath,cname,(d,p,env,ht));
then d;
case(_,Absyn.IMPORT(import_,_),optPath,cname,(d,p,env,ht)) equation
d = buildClassDependsInImport(import_,optPath,cname,(d,p,env,ht));
then d;
case(_,Absyn.IMPORT(import_=import_),optPath,cname,(d,p,env,ht))
equation
d = buildClassDependsInImport(import_,optPath,cname,(d,p,env,ht));
then d;

case(false,Absyn.CLASSDEF(class_=cl as Absyn.CLASS(name="equalityConstraint", body = classDef)),optPath,cname,(d,p,env,ht))
equation
Expand Down
5 changes: 4 additions & 1 deletion Compiler/FrontEnd/Dump.mo
Expand Up @@ -5848,6 +5848,7 @@ algorithm
Option<Absyn.Annotation> annotationOpt;
list<Absyn.ElementArg> elementArg;
Absyn.Path path;
Absyn.Info info;
case Absyn.CLASSDEF(replaceable_,class_)
equation
Print.printBuf("record Absyn.CLASSDEF replaceable_ = ");
Expand All @@ -5866,12 +5867,14 @@ algorithm
printOption(annotationOpt, printAnnotationAsCorbaString);
Print.printBuf(" end Absyn.EXTENDS;");
then ();
case Absyn.IMPORT(import_, comment)
case Absyn.IMPORT(import_, comment, info)
equation
Print.printBuf("record Absyn.IMPORT import_ = ");
printImportAsCorbaString(import_);
Print.printBuf(", comment = ");
printOption(comment, printCommentAsCorbaString);
Print.printBuf(", info = ");
printInfoAsCorbaString(info);
Print.printBuf(" end Absyn.IMPORT;");
then ();
case Absyn.COMPONENTS(attributes,typeSpec,components)
Expand Down
6 changes: 3 additions & 3 deletions Compiler/OpenModelicaBootstrappingHeader.h
Expand Up @@ -1067,7 +1067,7 @@ extern struct record_description Absyn_ElementSpec_EXTENDS__desc;
#ifdef ADD_METARECORD_DEFINTIONS
#ifndef Absyn_ElementSpec_IMPORT__desc_added
#define Absyn_ElementSpec_IMPORT__desc_added
const char* Absyn_ElementSpec_IMPORT__desc__fields[2] = {"import_","comment"};
const char* Absyn_ElementSpec_IMPORT__desc__fields[3] = {"import_","comment","info"};
struct record_description Absyn_ElementSpec_IMPORT__desc = {
"Absyn_ElementSpec_IMPORT",
"Absyn.ElementSpec.IMPORT",
Expand All @@ -1077,8 +1077,8 @@ struct record_description Absyn_ElementSpec_IMPORT__desc = {
#else /* Only use the file as a header */
extern struct record_description Absyn_ElementSpec_IMPORT__desc;
#endif
#define Absyn__IMPORT_3dBOX2 5
#define Absyn__IMPORT(import_,comment) (mmc_mk_box3(5,&Absyn_ElementSpec_IMPORT__desc,import_,comment))
#define Absyn__IMPORT_3dBOX3 5
#define Absyn__IMPORT(import_,comment,info) (mmc_mk_box4(5,&Absyn_ElementSpec_IMPORT__desc,import_,comment,info))
#ifdef ADD_METARECORD_DEFINTIONS
#ifndef Absyn_ElementSpec_COMPONENTS__desc_added
#define Absyn_ElementSpec_COMPONENTS__desc_added
Expand Down
5 changes: 3 additions & 2 deletions Compiler/Script/Interactive.mo
Expand Up @@ -7574,6 +7574,7 @@ algorithm
Absyn.ElementSpec spec;
Option<Absyn.Comment> cmt;
list<Absyn.ElementArg> elargs;
Absyn.Info info;

case (Absyn.COMPONENTS(attributes = a,typeSpec = Absyn.TPATH(path_1,x),components = comp_items),old_comp,new_comp,env) /* the old name for the component signal if something in class have been changed rule */
equation
Expand All @@ -7592,11 +7593,11 @@ algorithm
new_path = changeLastIdent(path_1, new_comp);
then
(Absyn.EXTENDS(new_path,elargs,annOpt),true);
case (Absyn.IMPORT(import_ = import_,comment = cmt),old_comp,new_comp,env)
case (Absyn.IMPORT(import_ = import_,comment = cmt, info = info),old_comp,new_comp,env)
equation
(import_1,changed) = renameClassInImport(import_, old_comp, new_comp, env);
then
(Absyn.IMPORT(import_1,cmt),changed);
(Absyn.IMPORT(import_1,cmt,info),changed);
case (spec,_,comps,env) then (spec,false);
end matchcontinue;
end renameClassInElementSpec;
Expand Down
4 changes: 2 additions & 2 deletions Parser/Modelica.g
Expand Up @@ -361,9 +361,9 @@ element returns [void* ast] @declarations {
;

import_clause returns [void* ast] :
IMPORT (imp=explicit_import_name | imp=implicit_import_name) cmt=comment
im=IMPORT (imp=explicit_import_name | imp=implicit_import_name) cmt=comment
{
ast = Absyn__IMPORT(imp, mk_some_or_none(cmt));
ast = Absyn__IMPORT(imp, mk_some_or_none(cmt), INFO($im));
}
;
defineunit_clause returns [void* ast] :
Expand Down

0 comments on commit d9dcf75

Please sign in to comment.