abstract classafPegger::Rule
sys::Obj afPegger::Rule
A PEG Rule.
Use the common rules declared in Rules or implement to define your own.
- action
virtual |Str? action
The action to be performed upon successful completion of this rule.
- definition
Str definition()
Returns the PEG definition for this rule. Example:
alphaNum <- [a-zA-Z0-9]
- doProcess
protected abstract Bool doProcess(PegCtx ctx)
Override to implement Rule logic.
- expression
abstract Str expression()
Returns the PEG expression for this rule. Example:
[a-zA-Z0-9]
- name
Str? name
The name of this rule. Only rules with names appear in debug output. Should be legal Fantom identifier (think variable names!).
- withAction
A helpful builder method for setting the action.
- withName
A helpful builder method for setting the name.