Changeset 14237


Ignore:
Timestamp:
Nov 29, 2019 6:08:13 PM (12 days ago)
Author:
amartensen
Message:

#5879 moved up the myEnvironment() equations from InstGeneratedInner to InstClassDecl, minor cleanup to the contribution for the NTA InstGeneratedInner.

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

Legend:

Unmodified
Added
Removed
  • branches/dev-2559/Compiler/ModelicaFrontEnd/src/jastadd/ast/InstanceTree.ast

    r14235 r14237  
    4141                               [Dummy3:InstConstraining];      // Dummy node to prevent InstConstraining from being classified as root
    4242
    43 abstract InstClassDecl: InstBaseNode ::= <SrcClassDecl:SrcClassDecl> /[ClassAnnotation:InstClassModification]/ /FunctionType:FType/ /GeneratedInnerModifications:InstModification*/;
     43abstract InstClassDecl: InstBaseNode ::= <SrcClassDecl:SrcClassDecl> /[ClassAnnotation:InstClassModification]/ /FunctionType:FType/ /InstGeneratedInners:InstGeneratedInner*/ /GeneratedInnerModifications:InstModification*/;
    4444abstract InstBaseClassDecl : InstClassDecl ::= [InstConstrainingClass] InstRestriction;
    4545InstLibNode              : InstClassDecl ::= /ActualInstClass:InstClassDecl/;
  • branches/dev-2559/Compiler/ModelicaFrontEnd/src/jastadd/errorcheck/ErrorCheck.jrag

    r14235 r14237  
    693693            }
    694694            getInstRestriction().collectErrors(checkType);
    695             getInstGeneratedInners().collectErrors(checkType);
     695            getInstGeneratedInnersList().collectErrors(checkType);
    696696            if (getSrcBaseClassDecl() instanceof SrcFullClassDecl) {
    697697                SrcFullClassDecl fcd = (SrcFullClassDecl) getSrcBaseClassDecl();
  • branches/dev-2559/Compiler/ModelicaFrontEnd/src/jastadd/flattening/Flattening.jrag

    r14123 r14237  
    9898        Flattener f = new Flattener(fc);
    9999        flatten(f, FlattenBindingExp.ALL, level);
    100         getInstGeneratedInners().flatten(f, FlattenBindingExp.ALL, level);
     100        getInstGeneratedInnersList().flatten(f, FlattenBindingExp.ALL, level);
    101101        flattenUsedFuncsAndEnums(f);
    102102        flattenInstClassDeclExtra(f);
     
    324324    public void InstClassDecl.flattenUsedFuncsAndEnums(Flattener f) {
    325325        super.flattenUsedFuncsAndEnums(f);
    326         getInstGeneratedInners().flattenUsedFuncsAndEnums(f);
     326        getInstGeneratedInnersList().flattenUsedFuncsAndEnums(f);
    327327    }
    328328
  • branches/dev-2559/Compiler/ModelicaFrontEnd/src/jastadd/flattening/connections/Connections.jrag

    r13675 r14237  
    13361336    public void InstClassDecl.buildConnectionSets(FAccess prefix, ConnectionSetManager csm, boolean connect) {
    13371337        super.buildConnectionSets(prefix, csm, connect);
    1338         getInstGeneratedInners().buildConnectionSets(prefix, csm, connect);
     1338        getInstGeneratedInnersList().buildConnectionSets(prefix, csm, connect);
    13391339    }
    13401340
  • branches/dev-2559/Compiler/ModelicaFrontEnd/src/jastadd/instance/InnerOuter.jrag

    r14235 r14237  
    7676        String name = outer.name();
    7777        InstGeneratedInner res = null;
    78         List<InstGeneratedInner> inners = getInstGeneratedInners();
     78        List<InstGeneratedInner> inners = getInstGeneratedInnersList();
    7979        for (InstGeneratedInner node : inners) {
    8080            if (node.matches(name)) {
     
    8787        } else {
    8888            res = new InstGeneratedInner(this, outer, nonInner);
    89             inners.add(res);
    90             inners.getChild(inners.getNumChild() - 1);  // Make sure res is final
     89            addInstGeneratedInners(res);
     90            return getInstGeneratedInners(getNumInstGeneratedInners() - 1).getInstComponentDecl();  // Make sure res is final
    9191        }
    9292        return res.getInstComponentDecl();
    9393    }
    9494
    95     syn nta List<InstGeneratedInner> InstClassDecl.getInstGeneratedInners() = new List<InstGeneratedInner>();
     95    syn nta List<InstGeneratedInner> InstClassDecl.getInstGeneratedInnersList() = new List<InstGeneratedInner>();
    9696
    9797    eq InstClassDecl.getGeneratedInnerModifications().lookupInstComponentInInstElement(String name) {
    98         for (InstGeneratedInner igi : getInstGeneratedInners()) {
     98        for (InstGeneratedInner igi : getInstGeneratedInnersList()) {
    9999            InstComponentDecl icd = igi.getInstComponentDecl();
    100100            if (icd.matches(name)) {
     
    105105    }
    106106
    107     eq InstGeneratedInner.getChild().myEnvironment()            = new Environment().mergeInnerClone(myGeneratedInnerModifications());
    108     eq InstGeneratedInner.getChild().myEnvironment(String name) = new Environment().mergeInnerClone(myGeneratedInnerModifications()).filter(name);
     107    eq InstClassDecl.getInstGeneratedInners().myEnvironment()            = new Environment().mergeInnerClone(getGeneratedInnerModificationsList());
     108    eq InstClassDecl.getInstGeneratedInners().myEnvironment(String name) = new Environment().mergeInnerClone(getGeneratedInnerModificationsList()).filter(name);
    109109   
    110     inh List<InstModification> InstGeneratedInner.myGeneratedInnerModifications();
    111     eq InstClassDecl.getChild().myGeneratedInnerModifications() = getGeneratedInnerModificationsList();
    112 
    113110    syn lazy List<InstModification> InstClassDecl.getGeneratedInnerModificationsList() {
    114111        List<InstModification> res = new List<>();
Note: See TracChangeset for help on using the changeset viewer.