Class RuntimeScanf

java.lang.Object
io.github.protasm.jvmud.language.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. Only %s and %d introduce captures; other characters are literal, so %%d is a literal percent followed by an integer capture.

      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