Class Core

java.lang.Object
org.clafer.frontend.Core

public final class Core extends Object
The core of the explicit IR: a model is core if and only if it has no rich node (Ir.Node.isRich()).
  • Method Details

    • richNodes

      public static List<Ir.Node> richNodes(Ir.Model model)
      Parameters:
      model - a model
      Returns:
      its rich nodes, outermost first, in the order of the source
    • richInCore

      public static List<Diagnostic> richInCore(Ir.Model model)
      Parameters:
      model - a model
      Returns:
      the diagnostics of a model that declares itself the core (--core) but has rich constructs, one at each
    • describe

      public static String describe(Ir.Node node)
      Parameters:
      node - a node
      Returns:
      what it is, e.g., "enumeration"
    • children

      public static List<Ir.Node> children(Ir.Node node)
      Parameters:
      node - a node
      Returns:
      its children, in the order of the source
    • firstTemporal

      public static Optional<Ir.Node> firstTemporal(Ir.Node node)
      Parameters:
      node - a node
      Returns:
      the first temporal node of a tree, core or rich, if any: a temporal operator, modifier, anchor, pattern or transition