classafPegger::Match
sys::Obj afPegger::Match
@
Js
Represents a PEG match result.
- contains
Returns
true
if a there's a sub-match with the given rule name or label.- data
Storage for user data - use when investigating match results.
- debugStr
Str debugStr()
Returns the matched tree as a string.
- dump
This dump(OutStream out := Env.cur().out())
Dumps the matched tree to std-out. Useful for debugging.
- firstMatch
Match? firstMatch()
Returns the first sub-match.
- getMatch
@
Operator
Match? getMatch(Str name)Returns the first sub-match with the given rule name (or label).
- getMatchAt
@
Operator
Match? getMatchAt(Int index)Returns the sub-match at the given index.
- matched
Str matched()
Returns the matched string.
- matchedRange
Range matchedRange()
Returns the matched range.
- matches
Match[] matches()
Returns all sub-mataches.
- name
Str? name()
Returns the associated rule
label
(orname
iflabel
isnull
).- parent
Match? parent()
Returns the parent Match in the tree, or
null
if this is the root.- rule
Rule rule()
Returns the rule associated with this match.