class Regexp::Expression::Base

def case_insensitive?

def case_insensitive?
  (@options and @options[:i]) ? true : false
end

def clone

def clone
  copy = self.dup
  copy.text       = (self.text        ? self.text.dup         : nil)
  copy.options    = (self.options     ? self.options.dup      : nil)
  copy.quantifier = (self.quantifier  ? self.quantifier.clone : nil)
  copy
end

def coded_offset

def coded_offset
  '@%d+%d' % offset
end

def free_spacing?

def free_spacing?
  (@options and @options[:x]) ? true : false
end

def full_length

def full_length
  to_s.length
end

def greedy?

def greedy?
  quantified? and @quantifier.mode == :greedy
end

def initialize(token)

def initialize(token)
  @type         = token.type
  @token        = token.token
  @text         = token.text
  @ts           = token.ts
  @level        = token.level
  @options      = nil
end

def multiline?

def multiline?
  (@options and @options[:m]) ? true : false
end

def offset

def offset
  [starts_at, full_length]
end

def possessive?

def possessive?
  quantified? and @quantifier.mode == :possessive
end

def quantified?

def quantified?
  not @quantifier.nil?
end

def quantify(token, text, min = nil, max = nil, mode = :greedy)

def quantify(token, text, min = nil, max = nil, mode = :greedy)
  @quantifier = Quantifier.new(token, text, min, max, mode)
end

def quantity

def quantity
  return [nil,nil] unless quantified?
  [@quantifier.min, @quantifier.max]
end

def reluctant?

def reluctant?
  quantified? and @quantifier.mode == :reluctant
end

def starts_at

def starts_at
  @ts
end

def terminal?

def terminal?
  !respond_to?(:expressions)
end

def to_re(format = :full)

def to_re(format = :full)
  ::Regexp.new(to_s(format))
end

def to_s(format = :full)

def to_s(format = :full)
  s = ''
  case format
  when :base
    s << @text.dup
  else
    s << @text.dup
    s << @quantifier if quantified?
  end
  s
end