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 742
def UserAction.empty new(nil, nil) end
.proc(pr = nil, &block)
[ GitHub ]# File 'lib/racc/grammar.rb', line 735
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 731
def UserAction.source_text(src) new(src, nil) end
Instance Attribute Details
#empty? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/racc/grammar.rb', line 764
def empty? not @proc and not @source end
#proc (readonly)
[ GitHub ]# File 'lib/racc/grammar.rb', line 754
attr_reader :proc
#proc? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/racc/grammar.rb', line 760
def proc? not @source end
#source (readonly)
[ GitHub ]# File 'lib/racc/grammar.rb', line 753
attr_reader :source
#source? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/racc/grammar.rb', line 756
def source? not @proc end
Instance Method Details
#inspect
Alias for #name.
# File 'lib/racc/grammar.rb', line 772
alias inspect name
#name Also known as: #inspect
[ GitHub ]# File 'lib/racc/grammar.rb', line 768
def name "{action type=#{@source || @proc || 'nil'}}" end