Class: Stupidedi::Builder::IdentifierStack
- Inherits:
-
Object
- Object
- Stupidedi::Builder::IdentifierStack
show all
- Defined in:
- lib/stupidedi/builder/identifier_stack.rb
Defined Under Namespace
Classes: Empty, GS, HL, ISA, ST
Instance Method Summary
collapse
Constructor Details
Returns a new instance of IdentifierStack.
7
8
9
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 7
def initialize(id)
@state = Empty.new(id)
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
39
40
41
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 39
def method_missing(name, *args)
@state.__send__(name, *args)
end
|
Instance Method Details
#gs ⇒ Object
20
21
22
23
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 20
def gs
@state = @state.gs
@state.id
end
|
#hl ⇒ Object
30
31
32
33
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 30
def hl
@state = @state.hl
@state.id
end
|
#id ⇒ Object
11
12
13
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 11
def id
@state.id
end
|
#isa ⇒ Object
15
16
17
18
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 15
def isa
@state = @state.isa
@state.id
end
|
#pop ⇒ Object
35
36
37
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 35
def pop
@state.id.tap { @state = @state.pop }
end
|
#st ⇒ Object
25
26
27
28
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 25
def st
@state = @state.st
@state.id
end
|