Package dev.omnist.schema
Class OsdReader
java.lang.Object
dev.omnist.schema.OsdReader
OSD (Omnist Schema Definition) Reader (omnist-spec §5).
Parses OSD text into a
Schema.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
OsdReader
Constructs a reader for the given OSD source text. The source is immediately tokenized byOsdLexerduring construction.- Parameters:
source- the OSD text to parse;nullis treated as empty
-
-
Method Details
-
read
Parses OSD text and returns the resultingSchema. Convenience wrapper fornew OsdReader(source).parseSchema().- Parameters:
source- the OSD text;nullis treated as empty- Returns:
- the fully-validated
Schema - Throws:
OsdParseException- if the text is syntactically or structurally invalid
-
parseSchema
Parses the token stream into aSchema(omnist-spec §5.5–§5.8). Processesrecordandrootdeclarations in any order, then validates that a root is declared, that the root record exists, and that allType.Reftargets resolve to defined records.- Returns:
- the fully-validated
Schema - Throws:
OsdParseException- on duplicate record names, duplicate root declarations, missing root, undeclared root record, or unresolved type references
-