Class: Racc::UserAction
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/racc/grammar.rb |
Class Method Summary
Instance Attribute Summary
- #empty? ⇒ Boolean readonly
- #proc readonly
- #proc? ⇒ Boolean readonly
- #source readonly
- #source? ⇒ Boolean readonly
Instance Method Summary
Constructor Details
.new(src, proc) ⇒ UserAction
Class Method Details
.empty
[ GitHub ]# File 'lib/racc/grammar.rb', line 735
def UserAction.empty new(nil, nil) end
.proc(pr = nil, &block)
[ GitHub ]# File 'lib/racc/grammar.rb', line 728
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)
[ GitHub ]# File 'lib/racc/grammar.rb', line 724
def UserAction.source_text(src) new(src, nil) end
Instance Attribute Details
#empty? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/racc/grammar.rb', line 757
def empty? not @proc and not @source end
#proc (readonly)
[ GitHub ]# File 'lib/racc/grammar.rb', line 747
attr_reader :proc
#proc? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/racc/grammar.rb', line 753
def proc? not @source end
#source (readonly)
[ GitHub ]# File 'lib/racc/grammar.rb', line 746
attr_reader :source
#source? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/racc/grammar.rb', line 749
def source? not @proc end
Instance Method Details
#inspect
Alias for #name.
# File 'lib/racc/grammar.rb', line 765
alias inspect name
#name Also known as: #inspect
[ GitHub ]# File 'lib/racc/grammar.rb', line 761
def name "{action type=#{@source || @proc || 'nil'}}" end