class OedipusLex::Group
A group allows you to group up multiple rules under a single regular prefix expression, allowing optimized code to be generated that skips over all actions if the prefix isn’t matched.
Public Class Methods
Source
# File lib/oedipus_lex.rb, line 183 def self.[] start, *subrules r = new start.inspect r.rules.concat subrules r end
A convenience method to create a new group with a start and given subrules.
Public Instance Methods
Source
# File lib/oedipus_lex.rb, line 196 def << rule rules << rule nil end
Add a rule to this group.