Module: Sexpr::Grammar::Matching

Included in:
Sexpr::Grammar
Defined in:
lib/sexpr/grammar/matching.rb

Instance Method Summary collapse

Instance Method Details

#[](rule_name) ⇒ Object



9
10
11
# File 'lib/sexpr/grammar/matching.rb', line 9

def [](rule_name)
  rules[rule_name]
end

#match?(sexp) ⇒ Boolean Also known as: ===

Returns:

  • (Boolean)


13
14
15
# File 'lib/sexpr/grammar/matching.rb', line 13

def match?(sexp)
  root_rule.match?(sexp)
end

#root_ruleObject



5
6
7
# File 'lib/sexpr/grammar/matching.rb', line 5

def root_rule
  rules[root]
end