classafPegger::Parser

sys::Obj
  afPegger::Parser

@Js

The main parser class; use to run your rules against an InStream.

make

Source

new make(Rule rootRule)

Create a Parser with the given root Rule.

match

Source

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

Source

Bool matches(InStream in, Obj? ctx := null)

Runs the parsing rules against characters in the given InStream. Returns true if anything was matched.

Convenience for match(in, ctx) != null

parse

Source

Obj? parse(InStream in, Obj? ctx := null)

Runs the parsing rules against characters in the given InStream. The given ctx object is passed to all successful actions, and returned.

parseAll

Source

Obj? parseAll(InStream in, Obj? ctx := null)

Continually parses the given InStream until the end of the stream is reached, or nothing was matched. Returns the given action ctx object.