Class: RubyParserStuff::StackState

### Home Classes Methods

### In Files

- lib/ruby_parser_extras.rb

### Parent

Object

### Methods

- ::new
- #inspect
- #is_in_state
- #lexpop
- #pop
- #push

### Files

- Manifest.txt
- README.txt

### Class/Module Index

Quicksearch

- RubyParserStuff
- RubyParserStuff::Environment
- RubyParserStuff::Keyword
- RubyParserStuff::Keyword::KWtable
- RubyParserStuff::Ruby18Parser
- RubyParserStuff::Ruby19Parser
- RubyParserStuff::Ruby20Parser
- RubyParserStuff::RubyParser
- RubyParserStuff::RubyParser::SyntaxError
- RubyParserStuff::Sexp
- RubyParserStuff::StackState
- RubyParserStuff::String
- RPStringScanner
- Ruby18Parser
- Ruby19Parser
- Ruby20Parser
- RubyLexer
- RubyParserGauntlet

No matching classes.

# RubyParserStuff::StackState

### Attributes

debug[RW]
name[R]
stack[R]

### Public Class Methods

new(name) click to toggle source

    # File lib/ruby_parser_extras.rb, line 1294
    def initialize(name)
      @name = name
      @stack = [false]
      @debug = false
    end

### Public Instance Methods

inspect() click to toggle source

    # File lib/ruby_parser_extras.rb, line 1300
    def inspect
      "StackState(#{@name}, #{@stack.inspect})"
    end

is_in_state() click to toggle source

    # File lib/ruby_parser_extras.rb, line 1304
    def is_in_state
      p :stack_is_in_state => [name, @stack.last, caller.first] if debug
      @stack.last
    end

lexpop() click to toggle source

    # File lib/ruby_parser_extras.rb, line 1309
    def lexpop
      p :stack_lexpop => caller.first if debug
      raise if @stack.size == 0
      a = @stack.pop
      b = @stack.pop
      @stack.push(a || b)
    end

pop() click to toggle source

    # File lib/ruby_parser_extras.rb, line 1317
    def pop
      r = @stack.pop
      p :stack_pop => [name, r, @stack, caller.first] if debug
      @stack.push false if @stack.size == 0
      r
    end

push(val) click to toggle source

    # File lib/ruby_parser_extras.rb, line 1324
    def push val
      @stack.push val
      p :stack_push => [name, @stack, caller.first] if debug
      nil
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.