Class RuntimeScanf

java.lang.Object
io.github.protasm.jvmud.compiler.runtime.RuntimeScanf

public final class RuntimeScanf extends Object
Runtime support for LPC sscanf-style output captures.
  • Method Details

    • scan

      public static Object[] scan(Object inputValue, Object formatValue, int captureCount)
      Matches an LPC sscanf format at the start of an input value.

      A successful match need not consume the entire input. A final %s capture does, however, receive the remaining input while earlier string captures remain minimal.

      Parameters:
      inputValue - value to scan
      formatValue - LPC sscanf format
      captureCount - number of output captures supplied by the caller
      Returns:
      the match count followed by the captured values