Class: Rule::Match
- Inherits:
-
Struct
- Object
- Struct
- Rule::Match
- Defined in:
- lib/rdparse.rb
Overview
A rule is created through the rule method of the Parser class, like this:
rule :term do
match(:term, '*', :dice) {|a, _, b| a * b }
match(:term, '/', :dice) {|a, _, b| a / b }
match(:dice)
end
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#pattern ⇒ Object
Returns the value of attribute pattern.
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
21 22 23 |
# File 'lib/rdparse.rb', line 21 def block @block end |
#pattern ⇒ Object
Returns the value of attribute pattern
21 22 23 |
# File 'lib/rdparse.rb', line 21 def pattern @pattern end |