encodeStringToIdentifier(sb, collectionLabel); sb.append(", "); List<K> components = Assoc.flatten(collectionLabel, Collections.singletonList(new LiftToKSequence().lower(k)), mainModule); LiftToKSequence lift = new LiftToKSequence(); boolean frame = false; for (K component : components) { apply(lift.lift(kapp)); } else { apply(lift.lift(kapp.klist().items().get(0)));
public Rule convert(Rule r) { Function1<Sentence, Sentence> convertLookups = new ConvertDataStructureToLookup(this.convertDataStructure)::convert; Function1<Sentence, Sentence> liftToKSequence = new LiftToKSequence()::lift; Function1<Sentence, Sentence> deconstructInts = new DeconstructIntegerAndFloatLiterals()::convert; Function1<Sentence, Sentence> expandMacros = this.expandMacros::expand; return (Rule) convertLookups .andThen(deconstructInts) .andThen(expandMacros) .andThen(liftToKSequence) .apply(r); }
this.convertDataStructure = new ConvertDataStructureToLookup(def.executionModule(), true); ModuleTransformer convertLookups = ModuleTransformer.fromSentenceTransformer(convertDataStructure::convert, "convert data structures to lookups"); ModuleTransformer liftToKSequence = ModuleTransformer.fromSentenceTransformer(new LiftToKSequence()::lift, "lift K into KSequence"); this.expandMacros = new ExpandMacros(def.executionModule(), files, kompileOptions, false); ModuleTransformer expandMacros = ModuleTransformer.fromSentenceTransformer(this.expandMacros::expand, "expand macro rules");