Class: Parser::CLexer::CondProxyStack
- Inherits:
-
Object
- Object
- Parser::CLexer::CondProxyStack
- Defined in:
- lib/c_lexer.rb
Instance Method Summary collapse
- #clear ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(lexer) ⇒ CondProxyStack
constructor
A new instance of CondProxyStack.
- #initialize_copy(original) ⇒ Object
- #lexpop ⇒ Object
- #pop ⇒ Object
- #push(value) ⇒ Object
- #to_s ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(lexer) ⇒ CondProxyStack
Returns a new instance of CondProxyStack.
36 37 38 39 |
# File 'lib/c_lexer.rb', line 36 def initialize(lexer) @lexer = lexer @value = nil end |
Instance Method Details
#clear ⇒ Object
44 |
# File 'lib/c_lexer.rb', line 44 def clear; @lexer.clear_cond_state; end |
#empty? ⇒ Boolean
45 |
# File 'lib/c_lexer.rb', line 45 def empty?; @lexer.cond_state_empty?; end |
#initialize_copy(original) ⇒ Object
47 48 49 |
# File 'lib/c_lexer.rb', line 47 def initialize_copy(original) @value = original.value end |
#lexpop ⇒ Object
43 |
# File 'lib/c_lexer.rb', line 43 def lexpop; @lexer.lexpop_cond_state; end |
#pop ⇒ Object
42 |
# File 'lib/c_lexer.rb', line 42 def pop; @lexer.pop_cond_state; end |
#push(value) ⇒ Object
41 |
# File 'lib/c_lexer.rb', line 41 def push(value); @lexer.push_cond_state(value); end |
#to_s ⇒ Object
51 52 53 |
# File 'lib/c_lexer.rb', line 51 def to_s "[#{value.to_s(2)} <= cond]" end |
#value ⇒ Object
46 |
# File 'lib/c_lexer.rb', line 46 def value; @value || @lexer.cond_state_value; end |