Tabnine Logo
PriorityBlock.getProductions
Code IndexAdd Tabnine to your IDE (free)

How to use
getProductions
method
in
org.kframework.kil.PriorityBlock

Best Java code snippets using org.kframework.kil.PriorityBlock.getProductions (Showing top 5 results out of 315)

origin: kframework/k

public void visit(Syntax syntax) {
  this.sort = syntax.getDeclaredSort().getRealSort();
  syntax.getPriorityBlocks().forEach(pb -> pb.getProductions().forEach(this::visit));
}
origin: kframework/k

  @Test
  public void testLexicalRules2() throws Exception {
    // TODO: remove once the new parser is fully functional
    String def = "module TEST syntax Str ::= Token{{[a]|[b] \".\"}+NT~[x]*} endmodule";

    List<DefinitionItem> defItemList = Outer.parse(Source.apply("generated by OuterParsingTests"), def, null);

    Module mod = (Module) defItemList.get(0);
    Syntax syn = (Syntax) mod.getItems().get(0);
    Lexical lex = (Lexical) syn.getPriorityBlocks().get(0).getProductions().get(0).getItems().get(0);

    Assert.assertEquals("{[a]|[b] \".\"}+NTDz~[x]*", lex.getLexicalRule());
  }
}
origin: kframework/k

@Test
public void testLexicalRules() throws Exception {
  // TODO: remove once the new parser is fully functional
  String def = "module TEST syntax Str ::= Token{((~[\\'\\n\\r\\\\])|([\\\\]~[\\n\\r]))*} endmodule";
  List<DefinitionItem> defItemList = Outer.parse(Source.apply("generated by OuterParsingTests"), def, null);
  Module mod = (Module) defItemList.get(0);
  Syntax syn = (Syntax) mod.getItems().get(0);
  Lexical lex = (Lexical) syn.getPriorityBlocks().get(0).getProductions().get(0).getItems().get(0);
  Assert.assertEquals("((~[\\'\\n\\r\\\\])|([\\\\]~[\\n\\r]))*", lex.getLexicalRule());
}
origin: kframework/k

  private static void check(ModuleItem i) {
    if (i instanceof Syntax) {
      Syntax s = (Syntax) i;
      for (PriorityBlock b : s.getPriorityBlocks()) {
        for (Production p : b.getProductions()) {
          if (p.getItems().size() == 1 && p.getItems().get(0) instanceof UserList) { // Syntax Es ::= List{E,""}
            Sort listSort = s.getDeclaredSort().getSort(); // Es
            Sort elemSort = ((UserList) p.getItems().get(0)).getSort(); // E
            if (isBaseSort(listSort)) {
              throw KEMException.compilerError(listSort + " can not be extended to be a list sort.", p);
            }
            if (listSort.equals(elemSort)) {
              throw KEMException.compilerError("Circular lists are not allowed.", p);
            }
          } else {
            for (ProductionItem it : p.getItems()) {
              if (it instanceof UserList) { // Syntax Es ::= ... List{E,""} ...
                throw KEMException.compilerError("Inline list declarations are not allowed.", it);
              }
            }
          }
        }
      }
    }
  }
}
origin: kframework/k

  .getProductions().stream().filter(p -> p.getKLabel(kore) != null).map(p -> Tag(p.getKLabel(kore)))
  .collect(Collectors.toSet()));
for (Production p : b.getProductions()) {
  if (p.containsAttribute("reject")) // skip productions of the old reject type
    continue;
org.kframework.kilPriorityBlockgetProductions

Popular methods of PriorityBlock

  • <init>
  • equals
  • getAssoc
  • hashCode

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • onRequestPermissionsResult (Fragment)
  • getSharedPreferences (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • JLabel (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top Sublime Text plugins
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