Sha256: 6be2bd531f8729a3b4d278782307fd82efdab569999fd4daee531efd4c47f806
Contents?: true
Size: 579 Bytes
Versions: 7
Compression:
Stored size: 579 Bytes
Contents
module Sexpr module Matcher class Reference include Matcher attr_reader :rule_name attr_reader :grammar def initialize(rule_name, grammar) @rule_name = rule_name @grammar = grammar end def rule @rule ||= @grammar[@rule_name] end def match?(sexp) rule && rule.match?(sexp) end def eat(sexp) rule && rule.eat(sexp) end def inspect "(ref #{rule_name}, #{rule.inspect})" end end # class Reference end # module Matcher end # module Sexpr
Version data entries
7 entries across 7 versions & 1 rubygems