classafPegger::Parser
sys::Obj afPegger::Parser
@Js
The main parser class; use to run your rules against an InStream.
- make
new make(Rule rootRule)Create a
Parserwith the given rootRule.- match
Str? match(InStream in, Obj? ctx := null)Runs the parsing rules against characters in the given
InStream. Returns the characters (if any) that were matched.- matches
Bool matches(InStream in, Obj? ctx := null)Runs the parsing rules against characters in the given
InStream. Returnstrueif anything was matched.Convenience for
match(in, ctx) != null- parse
Obj? parse(InStream in, Obj? ctx := null)Runs the parsing rules against characters in the given
InStream. The givenctxobject is passed to all successful actions, and returned.- parseAll
Obj? parseAll(InStream in, Obj? ctx := null)Continually parses the given
InStreamuntil the end of the stream is reached, or nothing was matched. Returns the given actionctxobject.