abstract classafPegger::Rule

sys::Obj
  afPegger::Rule

A PEG Rule.

Use the common rules declared in Rules or implement to define your own.

action

Source

virtual |Str? action

The action to be performed upon successful completion of this rule.

definition

Source

Str definition()

Returns the PEG definition for this rule. Example:

alphaNum <- [a-zA-Z0-9]
doProcess

Source

protected abstract Bool doProcess(PegCtx ctx)

Override to implement Rule logic.

expression

Source

abstract Str expression()

Returns the PEG expression for this rule. Example:

[a-zA-Z0-9]
name

Source

Str? name

The name of this rule. Only rules with names appear in debug output. Should be legal Fantom identifier (think variable names!).

withAction

Source

This withAction(|Str? action)

A helpful builder method for setting the action.

withName

Source

This withName(Str name)

A helpful builder method for setting the name.