Class: Parser::CLexer::CondProxyStack

Inherits:
Object
  • Object
show all
Defined in:
lib/c_lexer.rb

Instance Method Summary collapse

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

#clearObject



44
# File 'lib/c_lexer.rb', line 44

def clear;       @lexer.clear_cond_state;       end

#empty?Boolean

Returns:

  • (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

#lexpopObject



43
# File 'lib/c_lexer.rb', line 43

def lexpop;      @lexer.lexpop_cond_state;      end

#popObject



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_sObject



51
52
53
# File 'lib/c_lexer.rb', line 51

def to_s
  "[#{value.to_s(2)} <= cond]"
end

#valueObject



46
# File 'lib/c_lexer.rb', line 46

def value;       @value || @lexer.cond_state_value;       end