Class LockStableIds

java.lang.Object
org.ek9lang.compiler.phase5.flow.LockStableIds

public final class LockStableIds extends Object
THE shared encodings of lock-analysis stable ids - use this, never re-spell a source:line:col location key or the placeholder: prefix.

These strings are foreign keys joining EnterCallSite, LockIdentityDescriptor, LockPrecedenceGraph and the MCP lock probes, so they must be byte-identical wherever they are minted or recognised. Two prefix families exist and must not be confused: the lock-identity ids (alloc:, field:, capture:, placeholder:, built by LockIdentityInference.stableIdFor(Object, IdentityOrigin)) and the separate object-root keys of the listener (also using field:, a different key space, never joined to lock-identity ids).

  • Field Details

  • Method Details

    • location

      public static String location(IToken token)
      The source:line:col key of a token that must exist; a null token is a programming error.
      Parameters:
      token - the location, not null.
      Returns:
      the location key.
    • locationOrUnknown

      public static String locationOrUnknown(IToken token)
      The same key, but a missing token is the literal unknown (object roots may have no source token).
      Parameters:
      token - the location or null.
      Returns:
      the location key or unknown.
    • placeholder

      public static String placeholder(String paramFqn)
      The stable id of the placeholder for a parameter.
      Parameters:
      paramFqn - fully qualified name of the parameter.
      Returns:
      placeholder:<paramFqn>.
    • isPlaceholder

      public static boolean isPlaceholder(String stableId)
      Is this stable id a placeholder for a callee parameter.
      Parameters:
      stableId - any lock-identity stable id.
      Returns:
      true when it was made by placeholder(String).
    • paramFqnOfPlaceholder

      public static String paramFqnOfPlaceholder(String stableId)
      The parameter a placeholder stable id stands for.
      Parameters:
      stableId - an id for which isPlaceholder(String) is true.
      Returns:
      the parameter's fully qualified name.