Class: Symbol
- Inherits:
-
Object
- Object
- Symbol
- Includes:
- Walrat::ParsletCombining
- Defined in:
- lib/walrat/additions/symbol.rb
Instance Method Summary collapse
-
#to_parseable ⇒ Object
Returns a SymbolParslet based on the receiver.
Methods included from Walrat::ParsletCombining
#&, #>>, #and?, #and_predicate, #choice, #memoizing_parse, #merge, #not!, #not_predicate, #omission, #one_or_more, #optional, #parse, #repeat, #repeat_with_default, #repetition, #repetition_with_default, #sequence, #skip, #zero_or_more, #zero_or_one, #|
Instance Method Details
#to_parseable ⇒ Object
Returns a SymbolParslet based on the receiver. Symbols can be used in Grammars when specifying rules and productions to refer to other rules and productions that have not been defined yet. They can also be used to allow self-references within rules and productions (recursion); for example:
rule :thing & :thing.optional & :other_thing
Basically these SymbolParslets allow deferred evaluation of a rule or production (deferred until parsing takes place) rather than being evaluated at the time a rule or production is defined.
39 40 41 |
# File 'lib/walrat/additions/symbol.rb', line 39 def to_parseable Walrat::SymbolParslet.new self end |