public static void transform(GraGra grammar, GraTraEventListener l) { if (grammar == null) return; System.out.println(grammar.getGraTraOptions().toString()); createGraTraInstance(grammar); gratra.addGraTraListener(l); gratra.setGraGra(grammar); gratra.setHostGraph(grammar.getGraph()); gratra.enableWriteLogFile(writeLogFile); MorphCompletionStrategy strategy = CompletionStrategySelector.getDefault(); // strategy = new Completion_NAC(new Completion_InjCSP()); if (grammar.getGraTraOptions().isEmpty()) { grammar.setGraTraOptions(strategy); gratra.setCompletionStrategy(strategy); } else { if (grammar.getGraTraOptions().contains("showGraphAfterStep")) grammar.getGraTraOptions().remove("showGraphAfterStep"); gratra.setGraTraOptions(grammar.getGraTraOptions()); System.out.println("Options: " + grammar.getGraTraOptions()); System.out.println(); } grammar.destroyAllMatches(); if (priority) ((PriorityGraTraImpl) gratra).transform(); else if (layered) ((LayeredGraTraImpl) gratra).transform(); else if (ruleSequence) ((RuleSequencesGraTraImpl) gratra).transform(); else ((DefaultGraTraImpl) gratra).transform(); }
// olga void createGraTra() { createGraTraInstance(gragra); gratra.addGraTraListener(this); System.out.println("The gragra was set or not: " + gratra.setGraGra(gragra)); gratra.getHostGraph(); }