Class: Parslet::Atoms::Context::LRStack

Inherits:
Struct
  • Object
show all
Defined in:
lib/parslet/atoms/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#lrsObject

Returns the value of attribute lrs

Returns:

  • (Object)

    the current value of lrs



11
12
13
# File 'lib/parslet/atoms/context.rb', line 11

def lrs
  @lrs
end

Instance Method Details

#popObject



16
17
18
# File 'lib/parslet/atoms/context.rb', line 16

def pop
  lrs.shift
end

#push(lr) ⇒ Object



12
13
14
# File 'lib/parslet/atoms/context.rb', line 12

def push(lr)
  lrs.unshift(lr)
end

#top_down(&block) ⇒ Object



20
21
22
# File 'lib/parslet/atoms/context.rb', line 20

def top_down(&block)
  lrs.each(&block)
end