Class: Stupidedi::Parser::IdentifierStack::HL
- Inherits:
-
Object
- Object
- Stupidedi::Parser::IdentifierStack::HL
- Defined in:
- lib/stupidedi/parser/identifier_stack.rb
Instance Attribute Summary collapse
-
#id
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #hl
-
#initialize(parent, hl_sequence, lx_sequence) ⇒ HL
constructor
A new instance of HL.
- #lx
-
#parent_hl ⇒ Integer
Parent HL number (HL02).
- #pop
- #pop_hl
Constructor Details
#initialize(parent, hl_sequence, lx_sequence) ⇒ HL
Returns a new instance of HL.
213 214 215 216 |
# File 'lib/stupidedi/parser/identifier_stack.rb', line 213 def initialize(parent, hl_sequence, lx_sequence) @parent, @id, @hl_sequence, @lx_sequence = parent, hl_sequence.value, hl_sequence, lx_sequence end |
Instance Attribute Details
#id (readonly)
Returns the value of attribute id.
211 212 213 |
# File 'lib/stupidedi/parser/identifier_stack.rb', line 211 def id @id end |
Instance Method Details
#hl
218 219 220 |
# File 'lib/stupidedi/parser/identifier_stack.rb', line 218 def hl HL.new(self, @hl_sequence.succ!, @lx_sequence) end |
#lx
222 223 224 |
# File 'lib/stupidedi/parser/identifier_stack.rb', line 222 def lx @lx_sequence.succ!.value end |
#parent_hl ⇒ Integer
Parent HL number (HL02)
229 230 231 232 233 234 235 |
# File 'lib/stupidedi/parser/identifier_stack.rb', line 229 def parent_hl if @parent.is_a?(HL) @parent.id else raise RuntimeError, "this HL*#{@id} does not have a parent HL" end end |
#pop
241 242 243 244 |
# File 'lib/stupidedi/parser/identifier_stack.rb', line 241 def pop warn "DEPRECATION WARNING: IdentifierStack#pop is deprecated, use pop_ht (when removing an HL identifier from the stack)" pop_hl end |
#pop_hl
237 238 239 |
# File 'lib/stupidedi/parser/identifier_stack.rb', line 237 def pop_hl @parent end |