class Racc::UserAction - racc-1.4.12 Documentation

# class Racc::UserAction

### Attributes

proc[R]
source[R]

### Public Class Methods

empty() click to toggle source

    # File lib/racc/grammar.rb, line 737
    def UserAction.empty
      new(nil, nil)
    end

new(src, proc) click to toggle source

    # File lib/racc/grammar.rb, line 743
    def initialize(src, proc)
      @source = src
      @proc = proc
    end

proc(pr = nil, &block) click to toggle source

    # File lib/racc/grammar.rb, line 730
    def UserAction.proc(pr = nil, &block)
      if pr and block
        raise ArgumentError, "both of argument and block given"
      end
      new(nil, pr || block)
    end

source_text(src) click to toggle source

    # File lib/racc/grammar.rb, line 726
    def UserAction.source_text(src)
      new(src, nil)
    end

### Public Instance Methods

empty?() click to toggle source

    # File lib/racc/grammar.rb, line 759
    def empty?
      not @proc and not @source
    end

inspect()
Alias for: name
name() click to toggle source

    # File lib/racc/grammar.rb, line 763
    def name
      "{action type=#{@source || @proc || 'nil'}}"
    end

Also aliased as: inspect
proc?() click to toggle source

    # File lib/racc/grammar.rb, line 755
    def proc?
      not @source
    end

source?() click to toggle source

    # File lib/racc/grammar.rb, line 751
    def source?
      not @proc
    end