Tabnine Logo
Definition
Code IndexAdd Tabnine to your IDE (free)

How to use
Definition
in
org.kframework

Best Java code snippets using org.kframework.Definition (Showing top 4 results out of 315)

origin: kframework/k

/**
 * 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));
}
origin: kframework/k

/**
 * Parses the text to create a {@link Definition} object.
 */
public static org.kframework.definition.Definition from(String definitionText, String mainModuleName) {
  return from(definitionText, mainModuleName, Source.apply("generated"));
}
origin: kframework/k

/**
 * Parses the text to create a {@link Definition} object.
 * The main module of the definition will be last module defined in the text file.
 */
public static org.kframework.definition.Definition from(String definitionText) {
  Pattern pattern = Pattern.compile("(?:^|\\s)module ([A-Z][A-Z\\-]*)");
  Matcher m = pattern.matcher(definitionText);
  if(!m.find()) {
    throw new RuntimeException("Could not find any module in the definition");
  }
  String nameOfLastModule = m.group(m.groupCount());
  return from(definitionText, nameOfLastModule, Source.apply("generated"));
}
origin: kframework/k

  @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);
  }
}
org.kframeworkDefinition

Most used methods

  • from
    Parses the text to create a Definition object.

Popular in Java

  • Reading from database using SQL prepared statement
  • compareTo (BigDecimal)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JButton (javax.swing)
  • JTable (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now