Back to API Reference
Class

CompositeParseRule

sealed
Inherits:ParseRule

Combines multiple parse rules into a single rule.

Remarks

Tries each child rule in order until one matches. Useful for grouping related rules or creating reusable rule sets.
public string Identity{ get }

The children carry the syntax identities; the composite itself has none.

public string MarkupTriggers{ get }
public string TypingTriggers{ get }
public string ScanTriggers{ get }
public string SourceToken{ get }
public char EscapePrefix{ get }

First child's escape prefix — the composite carries its children's escaping capability.

public bool CanWrap{ get }

Wrappable when any child is — mirrors Apply's first-wrapping-child delegation.

public int Priority{ get }

Highest child priority (including negative — a composite of auto-detection rules must not be promoted to explicit-markup priority 0), so longest-match ordering tries the composite as early as its strongest child. Without it the default 0 lets a shorter standalone marker (a * rule) preempt a composite that wraps a longer one (**), splitting the longer marker into the shorter.

public static T FindLeaf()

The syntax-family lookup mirroring FindLeaf: returns root itself, or the first composite child (depth-first), of type T; null when none. Syntax-specific consumers address the family through here so composites are never invisible.

public override string Apply()

Delegates to the first child with a wrapping form, so a composite that merges differently-typed rules (a tag with a marker) stays inline-applicable in the first listed child's syntax.

public override int TryMatch()
public override void Finalize()
public override void PostParse()
public override void Reset()