Changeset 14186


Ignore:
Timestamp:
Nov 26, 2019 7:46:49 PM (2 weeks ago)
Author:
amartensen
Message:

5879 extracted code for getting the inners annotation node to the attribute innerNode()

Location:
branches/dev-2559/Compiler/ModelicaFrontEnd/src/jastadd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-2559/Compiler/ModelicaFrontEnd/src/jastadd/errorcheck/ErrorCheck.jrag

    r14022 r14186  
    746746                    getCopiedOuter().error("Can't generate missing inner declaration for %s, due to the outer declarations being of different types: %s", name(), sb);
    747747                    error = true;
     748                }
     749                for(AnnotationNode an : myInnerNode()) {
     750                    SrcModification inner = (SrcModification) an.ast();
     751                    InstModification im = inner.newInstModification();
     752                    im.setParent(this);
     753                    im.checkModificationNames(checkType);
    748754                }
    749755            }
  • branches/dev-2559/Compiler/ModelicaFrontEnd/src/jastadd/instance/InnerOuter.jrag

    r14166 r14186  
    113113    }
    114114   
     115    inh AnnotationNode InstGeneratedInner.myInnerNode();
     116    eq BaseNode.getChild().myInnerNode()      = null;
     117    eq InstClassDecl.getChild().myInnerNode() = innerNode();
     118
    115119    inh SrcModification InstGeneratedInner.myInnerAnnotation(String name);
    116120    eq BaseNode.getChild().myInnerAnnotation(String name) = null;
    117121    eq InstClassDecl.getChild().myInnerAnnotation(String name) {
    118         AnnotationNode an = annotation().forPath("__Modelon/inners").forPath(name);
     122        AnnotationNode an = innerNode().forPath(name);
    119123        if (!an.exists()) {
    120124            return null;
     
    122126        return (SrcModification) an.ast();
    123127    }
     128
     129    syn AnnotationNode BaseNode.innerNode() = annotation().vendorNode().forPath("inners");
    124130
    125131    public InstGeneratedInner.InstGeneratedInner(InstClassDecl parent, InstComponentDecl outer, InstComponentDecl nonInner) {
Note: See TracChangeset for help on using the changeset viewer.