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

[](start, *subrules) click to toggle source

A convenience method to create a new group with a start and given subrules.

# File lib/oedipus_lex.rb, line 183
def self.[] start, *subrules
  r = new start.inspect
  r.rules.concat subrules

Public Instance Methods

<<(rule) click to toggle source

Add a rule to this group.

# File lib/oedipus_lex.rb, line 196
def << rule
  rules << rule