Changeset 13463


Ignore:
Timestamp:
Sep 12, 2019 4:36:28 PM (3 months ago)
Author:
molsson
Message:

#5813 Added contribute method for flattening of external statements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-jk-2263/Compiler/ModelicaFrontEnd/src/jastadd/flattening/Flattening.jrag

    r13358 r13463  
    779779                new FCExternalLanguage());
    780780        stmt.extractLibrary(this);
     781        contribute(stmt);
    781782        if (hasInstExternalCall()) {
    782783            InstExternalCall call = getInstExternalCall();
     
    832833        stmt.extractLibrary(this);
    833834        sl.add(stmt);
     835        contribute(stmt);
    834836        return false;
    835837    }
     
    34033405
    34043406        /**
     3407         * This method is called during flattening of external statements. All
     3408         * expressions that are added must be flattened.
     3409         */
     3410        protected void contribute(AnnotationNode src, FExternalStmt dest) {}
     3411
     3412        /**
    34053413         * This method is called in order to determine if an attribute should
    34063414         * be considered as active. Return true if the attributes that was
     
    34933501    }
    34943502   
     3503    public class InstExternal {
     3504        public FExternalStmt contribute(FExternalStmt stmt) {
     3505            for (AttributeContributor contributor : attributeContributors()) {
     3506                contributor.contribute(annotation(), stmt);
     3507            }
     3508            return stmt;
     3509        }
     3510    }
     3511   
     3512    public class FExternalStmt {
     3513        public FExternalStmt contribute(FExternalStmt stmt) {
     3514            for (AttributeContributor contributor : attributeContributors()) {
     3515                contributor.contribute(annotation(), stmt);
     3516            }
     3517            return stmt;
     3518        }
     3519    }
     3520   
    34953521}
    34963522
Note: See TracChangeset for help on using the changeset viewer.