Tabnine Logo
ProductionReference.location
Code IndexAdd Tabnine to your IDE (free)

How to use
location
method
in
org.kframework.parser.ProductionReference

Best Java code snippets using org.kframework.parser.ProductionReference.location (Showing top 3 results out of 315)

origin: kframework/k-legacy

public static KEMException criticalError(String message, ProductionReference node) {
  return create(ExceptionType.ERROR, KExceptionGroup.CRITICAL, message, null, node.location().orElse(null), node.source().orElse(null));
}
origin: kframework/k

  String msg = "Found sort '" + childSort + "' where list sort '" + expectedSort + "' was expected. Moving on.";
  warnings.add(new ParseFailedException(
      new KException(KException.ExceptionType.HIDDENWARNING, KException.KExceptionGroup.LISTS, msg, child.source().get(), child.location().get())));
  newItems.add(child);
} else {
  TermCons terminator = TermCons.apply(ConsPStack.empty(), ulTerm.pTerminator, child.location(), child.source());
  TermCons newTc = TermCons.apply(ConsPStack.from(Arrays.asList(terminator, child)), ul.pList, child.location(), child.source());
  newItems.add(newTc);
  changed = true;
origin: kframework/k

  public Either<java.util.Set<ParseFailedException>, Term> apply(ProductionReference pr) {
    if (pr instanceof TermCons) {
      TermCons tc = (TermCons) pr;
      if (VariableTypeInferenceFilter.hasPolySort(tc)) {
        return VariableTypeInferenceFilter.visitPolyChildren(tc, this::apply);
      }
    }
    if (pr instanceof Constant && pr.production().sort().equals(Sorts.KVariable())) {
      // skip variables since they will always have a different sort at this stage.
      return Right.apply(pr);
    }
    if ((!strict && !subsorts.lessThanEq(pr.production().sort(), sort)) || (strict && !pr.production().sort().equals(sort))) {
      String msg = "Unexpected sort " + pr.production().sort() + " for term parsed as production " + pr.production() + ". Expected " + sort + ".";
      KException kex = new KException(KException.ExceptionType.ERROR, KException.KExceptionGroup.CRITICAL, msg, pr.source().orElse(null), pr.location().orElse(null));
      return Left.apply(Sets.newHashSet(new VariableTypeClashException(kex)));
    }
    return Right.apply(pr);
  }
}
org.kframework.parserProductionReferencelocation

Popular methods of ProductionReference

  • source
  • production

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • setRequestProperty (URLConnection)
  • Kernel (java.awt.image)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Github Copilot alternatives
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