{ addCell(null, "TopCell", "<top>"); addCell("TopCell", "ThreadCell", "<t>", Multiplicity.STAR); addCell("ThreadCell", "KCell", "<k>", Sorts.K()); addCell("ThreadCell", "EnvCell", "<env>", Sort("Map")); addCell("ThreadCell", "OptCell", "<opt>", Multiplicity.OPTIONAL, Sorts.K()); addUnit("OptCell", KLabel(".OptCell")); addUnit("ThreadCell", KLabel(".ThreadCellBag")); addConcat("ThreadCell", KLabel("_ThreadCellBag_")); }
{ addCell(null, "TopCell", "<top>"); addCell("TopCell", "ThreadCell", "<t>", Multiplicity.STAR, Sorts.K()); addCell("TopCell", "ExtraCell", "<extra>"); addUnit("ThreadCell", KLabel(".ThreadCellBag")); addConcat("ThreadCell", KLabel("_ThreadCellBag_")); }
public Module gen(Module mod) { Set<Sentence> res = new HashSet<>(); for (Sort sort : iterable(mod.definedSorts())) { Production prod = Production( "is" + sort.name(), Sorts.Bool(), Seq( Terminal("is" + sort.name()), Terminal("("), NonTerminal(Sorts.K()), Terminal(")")), Att().add(Attribute.FUNCTION_KEY).add(Attribute.PREDICATE_KEY, sort.name())); if (!mod.productions().contains(prod)) res.add(prod); } return Module( mod.name(), mod.imports(), (scala.collection.immutable.Set<Sentence>) mod.localSentences().$bar(immutable(res)), mod.att()); }