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.
9
10
11
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 9
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
41
42
43
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 41
def method_missing(name, *args)
@state.__send__(name, *args)
end
|
Instance Method Details
#gs ⇒ Object
22
23
24
25
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 22
def gs
@state = @state.gs
@state.id
end
|
#hl ⇒ Object
32
33
34
35
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 32
def hl
@state = @state.hl
@state.id
end
|
#id ⇒ Object
13
14
15
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 13
def id
@state.id
end
|
#isa ⇒ Object
17
18
19
20
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 17
def isa
@state = @state.isa
@state.id
end
|
#pop ⇒ Object
37
38
39
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 37
def pop
@state.id.tap { @state = @state.pop }
end
|
#st ⇒ Object
27
28
29
30
|
# File 'lib/stupidedi/builder/identifier_stack.rb', line 27
def st
@state = @state.st
@state.id
end
|