Codota Logo
DefinitionTransformer.apply
Code IndexAdd Codota to your IDE (free)

How to use
apply
method
in
org.kframework.definition.DefinitionTransformer

Best Java code snippets using org.kframework.definition.DefinitionTransformer.apply (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: kframework/k

/**
 * Generates the definition containing the modules appropriate for generating rule parsers.
 */
public static Definition toRuleParser(Definition d) {
  RuleGrammarGenerator rgg = new RuleGrammarGenerator(d);
  return DefinitionTransformer.from(rgg::getRuleGrammar, "toRuleParser").apply(d);
}
origin: kframework/k

/**
 * Generates the module appropriate for generating the parser of a partial configuration,
 * with the exact cell labels not known apriori.
 */
public static Definition toGenericAbstractConfigurationParser(Definition d) {
  RuleGrammarGenerator rgg = new RuleGrammarGenerator(d);
  return DefinitionTransformer.from(rgg::getConfigGrammar, "toGenericAbstractConfigurationParser").apply(d);
}
origin: kframework/k

public static Definition resolveFreshConstants(Definition input) {
  return DefinitionTransformer.from(new ResolveFreshConstants(input, false)::resolve, "resolving !Var variables")
      .apply(input);
}
origin: kframework/k

  /**
   * Put a marker on the "regular" (i.e. non function/macro/etc.) rules that we can use later.
   */
private static Definition markRegularRules(Definition d) {
  ConfigurationInfoFromModule configInfo = new ConfigurationInfoFromModule(d.mainModule());
  return DefinitionTransformer.fromSentenceTransformer((mod, s) -> markRegularRules(d, configInfo, s, Att.topRule()), "mark regular rules").apply(d);
}
origin: kframework/k

  }, "adding default configuration").apply(definition);
} else {
  definitionWithConfigBubble = definition;
  Definition defWithConfig = DefinitionTransformer.from(resolveConfig::apply, "parsing configurations").apply(definitionWithConfigBubble);
  return defWithConfig;
} catch (KEMException e) {
origin: kframework/k

public static Definition transformDefinition(Definition input) {
  ConfigurationInfoFromModule configInfo = new ConfigurationInfoFromModule(input.mainModule());
  LabelInfo labelInfo = new LabelInfoFromModule(input.mainModule());
  return DefinitionTransformer.fromSentenceTransformer(
      new AddImplicitComputationCell(configInfo, labelInfo),
      "concretizing configuration").apply(input);
}
origin: kframework/k

  def = DefinitionTransformer.from(resolveConfig::apply, "parse config bubbles").apply(def);
} catch (KEMException e) {
  errors.add(e);
origin: kframework/k

public Definition resolveNonConfigBubbles(Definition defWithConfig, RuleGrammarGenerator gen) {
  Module ruleParserModule = gen.getRuleGrammar(defWithConfig.mainModule());
  ParseCache cache = loadCache(ruleParserModule);
  ParseInModule parser = RuleGrammarGenerator.getCombinedGrammar(cache.getModule(), isStrict);
  try (Scanner scanner = parser.getScanner()) {
    return DefinitionTransformer.from(m -> this.resolveNonConfigBubbles(m, scanner, gen), "parsing rules").apply(defWithConfig);
  }
}
origin: kframework/k

public static Definition transformDefinition(Definition input) {
  ConfigurationInfoFromModule configInfo = new ConfigurationInfoFromModule(input.mainModule());
  LabelInfo labelInfo = new LabelInfoFromModule(input.mainModule());
  SortInfo sortInfo = SortInfo.fromModule(input.mainModule());
  return DefinitionTransformer.fromSentenceTransformer(
      new ConcretizeCells(configInfo, labelInfo, sortInfo, input.mainModule())::concretize,
      "concretizing configuration"
  ).apply(input);
}
origin: kframework/k

DefinitionTransformer subsortKItem = DefinitionTransformer.from(Kompile::subsortKItem, "subsort all sorts to KItem");
DefinitionTransformer expandMacros = DefinitionTransformer.fromSentenceTransformer((m, s) -> new ExpandMacros(m, files, kompileOptions, false).expand(s), "expand macros");
Function1<Definition, Definition> resolveFreshConstants = d -> DefinitionTransformer.from(new ResolveFreshConstants(d, true)::resolve, "resolving !Var variables").apply(d);
DefinitionTransformer generatedTopFormat = DefinitionTransformer.from(GeneratedTopFormat::resolve, "setting generatedTop format attribute");
Function1<Definition, Definition> resolveIO = (d -> Kompile.resolveIOStreams(kem, d));
    .andThen(generatedTopFormat)
    .andThen(new Strategy(kompileOptions.experimental.heatCoolStrategies).addStrategyCellToRulesTransformer())
    .andThen(d -> Strategy.addStrategyRuleToMainModule(def.mainModule().name()).apply(d))
    .andThen(ConcretizeCells::transformDefinition)
    .andThen(subsortKItem)
org.kframework.definitionDefinitionTransformerapply

Popular methods of DefinitionTransformer

  • andThen
  • from
  • fromSentenceTransformer
  • fromRuleBodyTransformer
  • fromRuleBodyTransformerWithRule

Popular in Java

  • Running tasks concurrently on multiple threads
  • notifyDataSetChanged (ArrayAdapter)
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now