Logo Hywe

Lexel Module

Lexel (Lexical Engine) Parses the lexical analysis and tokenization of Hywe syntax.

Types

Type Description

LevelBlock

LexelAttributes

LexelBlock

LexelNode

NestBlock

Functions and values

Function or value Description

extractSequences input

Full Usage: extractSequences input

Parameters:
    input : string - Full multi-level Hywe string.

Returns: Map<int, string> Map from level index (0-based) to sequence name (e.g. 0 -> "VRCWEE").

Extracts a level index to traversal sequence string mapping from a full Hywe string.

input : string

Full multi-level Hywe string.

Returns: Map<int, string>

Map from level index (0-based) to sequence name (e.g. 0 -> "VRCWEE").

Example

 let sqnMap = Lexel.extractSequences "L0(Q=VRCWEE)(1/10/Room)L1(Q=HRCWNN)(1/10/Office)"
val sqnMap: obj

injectSqn input lvl sqn

Full Usage: injectSqn input lvl sqn

Parameters:
    input : string - Full Hywe specification string.
    lvl : int - Zero-based level index to modify.
    sqn : string - New traversal sequence string (e.g. "HRCWNN").

Returns: string Modified specification string with updated Q= sequence parameter.

Injects or updates a specific level's sequence (Q=) within a full Hywe string. Supports both level (L#) and nest (N#) markers.

input : string

Full Hywe specification string.

lvl : int

Zero-based level index to modify.

sqn : string

New traversal sequence string (e.g. "HRCWNN").

Returns: string

Modified specification string with updated Q= sequence parameter.

Example

 let updatedSpec = Lexel.injectSqn "L0(Q=VRCWEE)(1/10/Room)" 0 "HRCWNN"
val updatedSpec: obj

parseAttributes block

Full Usage: parseAttributes block

Parameters:
    block : string - Raw string of the attribute block, e.g. "(Q=VRCWEE/L=0/W=20/H=30)".

Returns: LexelAttributes A populated LexelAttributes record.

Processes a Hywe attribute block into a structured record. Handles Sequence (Q), Level (L), Base (B), Scale (X), Entry (E), OuterBoundary (O), Islands (I), Thickness (T), Width (W), and Height (H).

block : string

Raw string of the attribute block, e.g. "(Q=VRCWEE/L=0/W=20/H=30)".

Returns: LexelAttributes

A populated LexelAttributes record.

Example

 let attrs = Lexel.parseAttributes "(Q=VRCWEE/L=0/X=1.0/W=20/H=30)"
val attrs: obj

parseNodes markerPrefix blocks

Full Usage: parseNodes markerPrefix blocks

Parameters:
    markerPrefix : string - Prefix marker (e.g. "L0" or "N1") prepended to generated node IDs.
    blocks : string list - List of node block strings, e.g. ["(1/25/Living)"; "(1.1/12/Dining)"].

Returns: LexelNode list list A list of node groups forming the hierarchical spatial tree.

Processes Hywe node blocks and organizes them into a hierarchical tree. Handles (ID/Area/Label/Extrusion/B=Base) format and dot-notation grouping.

markerPrefix : string

Prefix marker (e.g. "L0" or "N1") prepended to generated node IDs.

blocks : string list

List of node block strings, e.g. ["(1/25/Living)"; "(1.1/12/Dining)"].

Returns: LexelNode list list

A list of node groups forming the hierarchical spatial tree.

Example

 let blocks = [ "(1/25/Living)"; "(1.1/12/Dining)"; "(1.2/8/Kitchen)" ]
 let tree = Lexel.parseNodes "L0" blocks
val blocks: string list
val tree: obj

processFullString input

Full Usage: processFullString input

Parameters:
    input : string - Full multi-level Hywe string.

Returns: LexelBlock list List of parsed LexelBlock items (Level or Nest).

Processes a full multi-marker Hywe specification string, splitting into individual level (L#) and nest (N#) segments.

input : string

Full multi-level Hywe string.

Returns: LexelBlock list

List of parsed LexelBlock items (Level or Nest).

Example

 let spec = "L0(Q=VRCWEE)(1/20/Hall)L1(Q=HRCWNN)(1/15/Master)"
 let blocks = Lexel.processFullString spec
val spec: string
val blocks: obj

processXyxel markerPrefix input

Full Usage: processXyxel markerPrefix input

Parameters:
    markerPrefix : string - Level or nest marker prefix (e.g. "L0").
    input : string - Raw segment input containing parenthesis-delimited blocks.

Returns: (type) option Option containing the parsed Attributes and Tree.

Unified entry point for parsing and processing a single Xyxel segment containing attributes and node blocks.

markerPrefix : string

Level or nest marker prefix (e.g. "L0").

input : string

Raw segment input containing parenthesis-delimited blocks.

Returns: (type) option

Option containing the parsed Attributes and Tree.

Example

 let segment = Lexel.processXyxel "L0" "(Q=VRCWEE/W=30)(1/20/Hall)(1.1/10/Room)"
val segment: obj

Active patterns

Active pattern Description

(|Float|_|) s

Full Usage: (|Float|_|) s

Parameters:
    s : string

Returns: float option
s : string
Returns: float option

(|Int|_|) s

Full Usage: (|Int|_|) s

Parameters:
    s : string

Returns: int option
s : string
Returns: int option

Type something to start searching.