Changeset 13486


Ignore:
Timestamp:
Sep 16, 2019 9:09:57 AM (3 months ago)
Author:
randersson
Message:

#5842 Merged trunk into branch

Location:
branches/dev-5842
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-5842

    • Property svn:mergeinfo changed
      /trunk (added)merged: 13476
  • branches/dev-5842/Compiler/ModelicaFrontEnd/src/jastadd/flattening/Flattening.jrag

    r13456 r13486  
    21582158    syn boolean InstComponentDecl.isBuiltIn() = false;
    21592159    eq InstBuiltIn.isBuiltIn()                = true;
     2160    syn boolean InstBuiltInClassDecl.isBuiltIn()                = true;
     2161    syn boolean SrcBuiltInClassDecl.isBuiltIn()       = true;
     2162    syn boolean SrcClassDecl.isBuiltIn() = ((SourceRoot) root()).getProgram().getBuiltInTypes().hasChild(this)
     2163            || ((SourceRoot) root()).getProgram().getBuiltInFunctions().hasChild(this);
     2164   
     2165    public boolean List.hasChild(ASTNode node) {
     2166        for(ASTNode child : children) {
     2167            if(child == node) {
     2168                return true;
     2169            }
     2170        }
     2171        return false;
     2172    }
     2173   
    21602174
    21612175    public void InstComponentModification.collectAttributes(Flattener f,
  • branches/dev-5842/Compiler/ModelicaFrontEnd/src/jastadd/instance/InstLookupComponents.jrag

    r13317 r13486  
    2323    interface InstCallable  extends    InstLookupResult.Item {}
    2424
     25        /**
     26         * Indicates that the target was not found.
     27         */
     28        public static <T extends Item> InstLookupResult<T> InstLookupResult.notFound() {
     29            return (InstLookupResult<T>) NOT_FOUND;
     30        }
     31
     32        /**
     33         * Indicates that the target was found.
     34         *
     35         * Includes the found class or component.
     36         */
     37        public static <T extends Item> InstLookupResult<T> InstLookupResult.found(T target) {
     38            return new Found(target);
     39        }
     40
     41        /**
     42         * Indicates that the target was found, but not accessible due to a constrainedby clause.
     43         *
     44         * Includes the declaration with the limiting constrainedby clause.
     45         */
     46        public static <T extends Item> InstLookupResult<T> InstLookupResult.constrained(T target, InstNode constr) {
     47            return new Constrained(target, constr);
     48        }
     49
     50        /**
     51         * Indicates that the target was found, but not accessible due to a constrainedby clause.
     52         *
     53         * Includes the declaration with the limiting constrainedby clause.
     54         */
     55        public static <T extends Item> InstLookupResult<T> InstLookupResult.constrained(InstLookupResult<T> res, InstNode constr) {
     56            return new Constrained(res.target(), constr);
     57        }
     58       
     59        /**
     60         * Indicates that the target was found as an outer, target() returns the corresponding inner.
     61         */
     62        public static InstLookupResult<InstComponentDecl> InstLookupResult.outer(InstComponentDecl outer) {
     63            return new Outer(outer);
     64        }
     65
     66
    2567    /**
    2668     * Result class for lookups in the instance tree.
     
    3375            public InstLookupResult<InstComponentDecl> memberInstComponent(String name);
    3476            public InstCallable asCallable();
    35         }
    36        
    37         /**
    38          * Indicates that the target was not found.
    39          */
    40         public static <T extends Item> InstLookupResult<T> notFound() {
    41             return (InstLookupResult<T>) NOT_FOUND;
    42         }
    43 
    44         /**
    45          * Indicates that the target was found.
    46          *
    47          * Includes the found class or component.
    48          */
    49         public static <T extends Item> InstLookupResult<T> found(T target) {
    50             return new Found(target);
    51         }
    52 
    53         /**
    54          * Indicates that the target was found, but not accessible due to a constrainedby clause.
    55          *
    56          * Includes the declaration with the limiting constrainedby clause.
    57          */
    58         public static <T extends Item> InstLookupResult<T> constrained(T target, InstNode constr) {
    59             return new Constrained(target, constr);
    60         }
    61 
    62         /**
    63          * Indicates that the target was found, but not accessible due to a constrainedby clause.
    64          *
    65          * Includes the declaration with the limiting constrainedby clause.
    66          */
    67         public static <T extends Item> InstLookupResult<T> constrained(InstLookupResult<T> res, InstNode constr) {
    68             return new Constrained(res.target(), constr);
    69         }
    70        
    71         /**
    72          * Indicates that the target was found as an outer, target() returns the corresponding inner.
    73          */
    74         public static InstLookupResult<InstComponentDecl> outer(InstComponentDecl outer) {
    75             return new Outer(outer);
    76         }
    77 
     77            public InstNode asInstNode();
     78        }
     79       
    7880        /**
    7981         * Did the lookup succeed?
  • branches/dev-5842/Compiler/ModelicaFrontEnd/src/jastadd/instance/Types.jrag

    r12962 r13486  
    6666    eq InstPrimitive.isPrimitiveType()     = true;
    6767    eq InstClassDecl.isPrimitiveType()     = isPrimitive();
     68   
     69    syn boolean SrcBaseNode.isPrimitiveType() = false;
     70    eq SrcClassDecl.isPrimitiveType() = isPrimitive();
    6871
    6972    public static String InstNode.subTypeMessage(String name, String message) {
  • branches/dev-5842/Compiler/ModelicaFrontEnd/src/jastadd/util/Util.jrag

    r13396 r13486  
    16201620    }
    16211621   
     1622    syn InstClassDecl InstNode.asInstClassDecl() {
     1623        throw new UnsupportedOperationException();
     1624    }
    16221625    syn InstClassDecl InstClassDecl.asInstClassDecl() = this;
    16231626    syn InstClassDecl InstPartialFunction.asInstClassDecl()  = unknownInstClassDecl();
     
    16291632    syn InstClassDecl InstPartialFunction.actualInstClassDecl() = myInstClass().actualInstClass();
    16301633   
    1631     syn InstNode InstClassDecl.asInstNode() = this;
    1632     syn InstNode InstPartialFunction.asInstNode()  = this;
     1634    syn InstNode InstNode.asInstNode() = this;
    16331635   
    16341636    syn InstCallable InstFunctionCall.myInstCallable() = getName().myInstCallable();
Note: See TracChangeset for help on using the changeset viewer.