class Temple::Mixins::GrammarDSL::Rule
Public Class Methods
new(grammar)
click to toggle source
# File lib/temple/mixins/grammar_dsl.rb, line 7 def initialize(grammar) @grammar = grammar end
Public Instance Methods
copy_to(grammar)
click to toggle source
# File lib/temple/mixins/grammar_dsl.rb, line 21 def copy_to(grammar) copy = dup.instance_eval { @grammar = grammar; self } copy.after_copy(self) if copy.respond_to?(:after_copy) copy end
match?(exp)
click to toggle source
# File lib/temple/mixins/grammar_dsl.rb, line 11 def match?(exp) match(exp, []) end
|(rule)
click to toggle source
# File lib/temple/mixins/grammar_dsl.rb, line 17 def |(rule) Or.new(@grammar, self, rule) end