Class: RLSM::RE::SyntaxNode

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/rlsm/regexp_parser.rb

Overview

:nodoc:

Direct Known Subclasses

Concat, EmptySet, EmptyWord, Prim, Star, Union

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input = nil) ⇒ SyntaxNode

Returns a new instance of SyntaxNode.



279
280
281
# File 'lib/rlsm/regexp_parser.rb', line 279

def initialize(input = nil)
  @content = input
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



283
284
285
# File 'lib/rlsm/regexp_parser.rb', line 283

def content
  @content
end

Class Method Details

.[](input = nil) ⇒ Object



275
276
277
# File 'lib/rlsm/regexp_parser.rb', line 275

def self.[](input = nil)
  self.new(input)
end

Instance Method Details

#<=>(other) ⇒ Object



301
302
303
# File 'lib/rlsm/regexp_parser.rb', line 301

def <=>(other)
  to_s <=> other.to_s
end

#firstObject



289
290
291
# File 'lib/rlsm/regexp_parser.rb', line 289

def first
  []
end

#followObject



297
298
299
# File 'lib/rlsm/regexp_parser.rb', line 297

def follow
  nil
end

#inspectObject



309
310
311
# File 'lib/rlsm/regexp_parser.rb', line 309

def inspect
  "#{self.class}[ #{@content.inspect} ]"
end

#lastObject



293
294
295
# File 'lib/rlsm/regexp_parser.rb', line 293

def last
  []
end

#null?Boolean

Returns:

  • (Boolean)


285
286
287
# File 'lib/rlsm/regexp_parser.rb', line 285

def null?
  true
end

#to_sObject



305
306
307
# File 'lib/rlsm/regexp_parser.rb', line 305

def to_s
  @content.to_s
end