Class: RBNF::Rep

Inherits:
Unary show all
Defined in:
lib/rbnf/nodes.rb

Overview

Repetition (0 or more times) node

Constant Summary

Constants included from RBNF

DEFS, VERSION

Instance Attribute Summary

Attributes inherited from Unary

#a

Instance Method Summary collapse

Methods inherited from Unary

#initialize

Methods included from RBNF

#=~, [], #alt, #cat, #comps, def, define, dememoize, #except, #group, method_missing, #opt, #rep, #rep_n

Constructor Details

This class inherits a constructor from RBNF::Unary

Instance Method Details

#match(s) ⇒ Object



91
92
93
# File 'lib/rbnf/nodes.rb', line 91

def match(s)
  s.empty? or a.comps(s).any? {|c| self=~c}
end

#to_sObject



88
89
90
# File 'lib/rbnf/nodes.rb', line 88

def to_s
  "{ #{a} }"
end