Class OsdLexer

java.lang.Object
dev.omnist.schema.OsdLexer

public class OsdLexer extends Object
Tokenizer for OSD (Omnist Schema Definition) grammar (omnist-spec §5.3).

Recognizes four lexical rules in priority order:

  1. STRING — a double-quoted field name ("label")
  2. CARDINALITY — a bracket-enclosed cardinality expression ([m,n])
  3. Punctuation — { } : , ?
  4. IDENT / Keywords — record, root, or any other identifier
Whitespace, newlines, and #-comments are silently skipped between tokens.
  • Constructor Details

    • OsdLexer

      public OsdLexer(String source)
      Constructs a lexer for the given OSD source text.
      Parameters:
      source - the OSD text to tokenize; null is treated as an empty string
  • Method Details