@Override public Set<K> merge(Set<K> a, Set<K> b) { return Collections.or(a, b); } }
@Override public Set<K> unit() { return Collections.<K>Set(); }
@Override public Seq<Sort> params() { return Seq(); }
public scala.collection.Set<K> apply(KApply k) { if (k.klabel().name().equals(Strategy.strategyCellName())) return org.kframework.Collections.Set(k); else return super.apply(k); } }.apply(theNew).head();
@Test public void testFrom() throws Exception { org.kframework.definition.Definition actual = Definition.from("module X endmodule"); Module modSyntax = Module.apply("X$SYNTAX", Set()); Module mod = new Module("X", Set(modSyntax), Set(), Att()); assertEquals(org.kframework.definition.Definition.apply(mod, Set(mod, modSyntax), Att()), actual); } }
private boolean equalsSyntax(Module _this, Module that) { if (!_this.productions().equals(that.productions())) return false; if (!_this.priorities().equals(that.priorities())) return false; if (!_this.leftAssoc().equals(that.leftAssoc())) return false; if (!_this.rightAssoc().equals(that.rightAssoc())) return false; return _this.sortDeclarations().equals(that.sortDeclarations()); }
/** * Parses a string with a particular start symbol/sort. * * @param startSymbol the start symbol/sort * @param toParse the String to parse * @return a pair: the left projection is a parsed string as a K, if successful; * the right projection is the set of issues encountered while parsing */ public Tuple2<Option<K>, Set<Warning>> apply(Sort startSymbol, String toParse) { return apply(startSymbol, toParse, Source.apply("generated")); }
@API public interface Warning { }
/** * Parses the text to create a {@link Definition} object. */ public static org.kframework.definition.Definition from(String definitionText, String mainModuleName, Source source) { return from(definitionText, mainModuleName, source, Lists.newArrayList(Kompile.BUILTIN_DIRECTORY)); }
public static Parser from(Module module) { return new Parser(module); } }
private boolean isFinalState(int steps, RewriterResult result) { return result.rewriteSteps().isPresent() && result.rewriteSteps().get() < steps; }
@Override public Set<E> unit() { return Collections.<E>Set(); }
@Override public Seq<org.kframework.kore.Sort> params() { return Seq(); }
@API public interface Warning { }
@Override public Set<K> merge(Set<K> a, Set<K> b) { return Collections.or(a, b); } }
@Override public Set<K> unit() { return Collections.<K>Set(); }
@Override public Set<E> merge(Set<E> a, Set<E> b) { return Collections.or(a, b); }