|
59 | 59 | import org.eclipse.xtext.xbase.lib.IteratorExtensions; |
60 | 60 | import org.eclipse.xtext.xbase.lib.StringExtensions; |
61 | 61 | import org.lflang.InferredType; |
62 | | -import org.lflang.MessageReporter; |
63 | 62 | import org.lflang.TimeUnit; |
64 | 63 | import org.lflang.TimeValue; |
65 | 64 | import org.lflang.generator.CodeMap; |
|
99 | 98 | import org.lflang.lf.WidthSpec; |
100 | 99 | import org.lflang.lf.WidthTerm; |
101 | 100 | import org.lflang.target.Target; |
102 | | -import org.lflang.target.TargetConfig; |
103 | 101 | import org.lflang.util.StringUtil; |
104 | 102 |
|
105 | 103 | /** |
@@ -511,14 +509,14 @@ public static List<Mode> allModes(Reactor definition) { |
511 | 509 | return ASTUtils.collectElements(definition, featurePackage.getReactor_Modes()); |
512 | 510 | } |
513 | 511 |
|
514 | | -// public static List<ReactorInstance> recursiveChildren(ReactorInstance r) { |
515 | | -// List<ReactorInstance> ret = new ArrayList<>(); |
516 | | -// ret.add(r); |
517 | | -// for (var child : r.children) { |
518 | | -// ret.addAll(recursiveChildren(child)); |
519 | | -// } |
520 | | -// return ret; |
521 | | -// } |
| 512 | + // public static List<ReactorInstance> recursiveChildren(ReactorInstance r) { |
| 513 | + // List<ReactorInstance> ret = new ArrayList<>(); |
| 514 | + // ret.add(r); |
| 515 | + // for (var child : r.children) { |
| 516 | + // ret.addAll(recursiveChildren(child)); |
| 517 | + // } |
| 518 | + // return ret; |
| 519 | + // } |
522 | 520 |
|
523 | 521 | /** |
524 | 522 | * Return all the superclasses of the specified reactor in deepest-first order. For example, if A |
@@ -606,37 +604,39 @@ public static <T extends EObject> List<T> collectElements( |
606 | 604 | * This will also assign levels to reactions, then, if the program is federated, perform an AST |
607 | 605 | * transformation to disconnect connections between federates. |
608 | 606 | */ |
609 | | -// public static ReactorInstance createMainReactorInstance( |
610 | | -// Instantiation mainDef, |
611 | | -// List<Reactor> reactors, |
612 | | -// MessageReporter messageReporter, |
613 | | -// TargetConfig targetConfig) { |
614 | | -// if (mainDef != null) { |
615 | | -// // Recursively build instances. |
616 | | -// ReactorInstance main = |
617 | | -// new ReactorInstance(toDefinition(mainDef.getReactorClass()), messageReporter, reactors); |
618 | | -// var reactionInstanceGraph = main.assignLevels(); |
619 | | -// if (reactionInstanceGraph.nodeCount() > 0) { |
620 | | -// messageReporter |
621 | | -// .nowhere() |
622 | | -// .error("Main reactor has causality cycles. Skipping code generation."); |
623 | | -// return null; |
624 | | -// } |
625 | | -// // Inform the run-time of the breadth/parallelism of the reaction graph |
626 | | -// var breadth = reactionInstanceGraph.getBreadth(); |
627 | | -// if (breadth == 0) { |
628 | | -// messageReporter.nowhere().warning("The program has no reactions"); |
629 | | -// } else { |
630 | | -// CompileDefinitionsProperty.INSTANCE.update( |
631 | | -// targetConfig, |
632 | | -// Map.of( |
633 | | -// "LF_REACTION_GRAPH_BREADTH", String.valueOf(reactionInstanceGraph.getBreadth()))); |
634 | | -// } |
635 | | -// return main; |
636 | | -// } |
637 | | -// return null; |
638 | | -// } |
639 | | -// |
| 607 | + // public static ReactorInstance createMainReactorInstance( |
| 608 | + // Instantiation mainDef, |
| 609 | + // List<Reactor> reactors, |
| 610 | + // MessageReporter messageReporter, |
| 611 | + // TargetConfig targetConfig) { |
| 612 | + // if (mainDef != null) { |
| 613 | + // // Recursively build instances. |
| 614 | + // ReactorInstance main = |
| 615 | + // new ReactorInstance(toDefinition(mainDef.getReactorClass()), messageReporter, |
| 616 | + // reactors); |
| 617 | + // var reactionInstanceGraph = main.assignLevels(); |
| 618 | + // if (reactionInstanceGraph.nodeCount() > 0) { |
| 619 | + // messageReporter |
| 620 | + // .nowhere() |
| 621 | + // .error("Main reactor has causality cycles. Skipping code generation."); |
| 622 | + // return null; |
| 623 | + // } |
| 624 | + // // Inform the run-time of the breadth/parallelism of the reaction graph |
| 625 | + // var breadth = reactionInstanceGraph.getBreadth(); |
| 626 | + // if (breadth == 0) { |
| 627 | + // messageReporter.nowhere().warning("The program has no reactions"); |
| 628 | + // } else { |
| 629 | + // CompileDefinitionsProperty.INSTANCE.update( |
| 630 | + // targetConfig, |
| 631 | + // Map.of( |
| 632 | + // "LF_REACTION_GRAPH_BREADTH", |
| 633 | + // String.valueOf(reactionInstanceGraph.getBreadth()))); |
| 634 | + // } |
| 635 | + // return main; |
| 636 | + // } |
| 637 | + // return null; |
| 638 | + // } |
| 639 | + // |
640 | 640 | /** |
641 | 641 | * Adds the elements into the given list at a location matching to their textual position. |
642 | 642 | * |
@@ -1657,9 +1657,9 @@ public static boolean isInCode(INode node) { |
1657 | 1657 | * |
1658 | 1658 | * @param instance The instance to check. |
1659 | 1659 | */ |
1660 | | -// public static boolean isTopLevel(NamedInstance instance) { |
1661 | | -// return instance.getParent() == null; |
1662 | | -// } |
| 1660 | + // public static boolean isTopLevel(NamedInstance instance) { |
| 1661 | + // return instance.getParent() == null; |
| 1662 | + // } |
1663 | 1663 |
|
1664 | 1664 | /** Return true if the given node starts on the same line as the given other node. */ |
1665 | 1665 | public static Predicate<INode> sameLine(ICompositeNode compNode) { |
|
0 commit comments