class Racc::UserAction

Attributes

Public Class Methods

# File lib/racc/grammar.rb, line 740
def UserAction.empty
  new(nil, nil)
end
# File lib/racc/grammar.rb, line 746
def initialize(src, proc)
  @source = src
  @proc = proc
end
# File lib/racc/grammar.rb, line 733
def UserAction.proc(pr = nil, &block)
  if pr and block
    raise ArgumentError, "both of argument and block given"
  end
  new(nil, pr || block)
end
# File lib/racc/grammar.rb, line 729
def UserAction.source_text(src)
  new(src, nil)
end

Public Instance Methods

# File lib/racc/grammar.rb, line 762
def empty?
  not @proc and not @source
end
Alias for: name
# File lib/racc/grammar.rb, line 766
def name
  "{action type=#{@source || @proc || 'nil'}}"
end
Also aliased as: inspect
# File lib/racc/grammar.rb, line 758
def proc?
  not @source
end
# File lib/racc/grammar.rb, line 754
def source?
  not @proc
end