Changeset 13486
- Timestamp:
- Sep 16, 2019 9:09:57 AM (3 months ago)
- Location:
- branches/dev-5842
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/dev-5842
-
branches/dev-5842/Compiler/ModelicaFrontEnd/src/jastadd/flattening/Flattening.jrag
r13456 r13486 2158 2158 syn boolean InstComponentDecl.isBuiltIn() = false; 2159 2159 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 2160 2174 2161 2175 public void InstComponentModification.collectAttributes(Flattener f, -
branches/dev-5842/Compiler/ModelicaFrontEnd/src/jastadd/instance/InstLookupComponents.jrag
r13317 r13486 23 23 interface InstCallable extends InstLookupResult.Item {} 24 24 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 25 67 /** 26 68 * Result class for lookups in the instance tree. … … 33 75 public InstLookupResult<InstComponentDecl> memberInstComponent(String name); 34 76 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 78 80 /** 79 81 * Did the lookup succeed? -
branches/dev-5842/Compiler/ModelicaFrontEnd/src/jastadd/instance/Types.jrag
r12962 r13486 66 66 eq InstPrimitive.isPrimitiveType() = true; 67 67 eq InstClassDecl.isPrimitiveType() = isPrimitive(); 68 69 syn boolean SrcBaseNode.isPrimitiveType() = false; 70 eq SrcClassDecl.isPrimitiveType() = isPrimitive(); 68 71 69 72 public static String InstNode.subTypeMessage(String name, String message) { -
branches/dev-5842/Compiler/ModelicaFrontEnd/src/jastadd/util/Util.jrag
r13396 r13486 1620 1620 } 1621 1621 1622 syn InstClassDecl InstNode.asInstClassDecl() { 1623 throw new UnsupportedOperationException(); 1624 } 1622 1625 syn InstClassDecl InstClassDecl.asInstClassDecl() = this; 1623 1626 syn InstClassDecl InstPartialFunction.asInstClassDecl() = unknownInstClassDecl(); … … 1629 1632 syn InstClassDecl InstPartialFunction.actualInstClassDecl() = myInstClass().actualInstClass(); 1630 1633 1631 syn InstNode InstClassDecl.asInstNode() = this; 1632 syn InstNode InstPartialFunction.asInstNode() = this; 1634 syn InstNode InstNode.asInstNode() = this; 1633 1635 1634 1636 syn InstCallable InstFunctionCall.myInstCallable() = getName().myInstCallable();
Note: See TracChangeset
for help on using the changeset viewer.