classafPegger::PegCtx

sys::Obj
  afPegger::PegCtx

@Js

Handed to Rule classes during the matching process.

Only needed when you're implementing your own rules.

log

Source

Void log(Str msg)

Logs the given message to debug. It is formatted to be the same as the other Pegger debug messages.

matched

Source

Str? matched

A rule should set this when it has matched some input. It should not re-set what has been matched in inner rules, only what it, itself, has matched.

Getting also returns the concatenation of what any inner rules have matched.

process

Source

Bool process(Rule rule)

Call to process a sub-rule.

readChar

Source

Int? readChar()

Reads 1 character from the underlying input stream.

readStr

Source

Str? readStr(Int n)

Reads n characters from the underlying input stream.

rollback

Source

Void rollback(Str msg := "Rolling back")

Call to rollback the matching of any subrules.

unreadStr

Source

Void unreadStr(Str? str)

Pushes back, or un-reads, the given string onto the underlying input stream. Use when rolling back a rule.