# File lib/temple/mixins/grammar_dsl.rb, line 76 def after_copy(source) @grammar.const_set(@name, self) super end
# File lib/temple/mixins/grammar_dsl.rb, line 72 def copy_to(grammar) grammar.const_defined?(@name) ? grammar.const_get(@name) : super end
# File lib/temple/mixins/grammar_dsl.rb, line 50 def match(exp, unmatched) success = super unmatched << [@name, exp] unless success success end
# File lib/temple/mixins/grammar_dsl.rb, line 56 def match?(exp) match(exp, []) end
# File lib/temple/mixins/grammar_dsl.rb, line 60 def validate!(exp) unmatched = [] unless match(exp, unmatched) require 'pp' entry = unmatched.first unmatched.reverse_each do |u| entry = u if u.flatten.size < entry.flatten.size end raise(InvalidExpression, PP.pp(entry.last, "#{@grammar}::#{entry.first} did not match\n")) end end
Generated with the Darkfish Rdoc Generator 2.