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 740
def UserAction.empty new(nil, nil) end
.proc(pr = nil, &block)
[ GitHub ]# 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
.source_text(src)
[ GitHub ]# File 'lib/racc/grammar.rb', line 729
def UserAction.source_text(src) new(src, nil) end
Instance Attribute Details
#empty? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/racc/grammar.rb', line 762
def empty? not @proc and not @source end
#proc (readonly)
[ GitHub ]# File 'lib/racc/grammar.rb', line 752
attr_reader :proc
#proc? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/racc/grammar.rb', line 758
def proc? not @source end
#source (readonly)
[ GitHub ]# File 'lib/racc/grammar.rb', line 751
attr_reader :source
#source? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/racc/grammar.rb', line 754
def source? not @proc end
Instance Method Details
#inspect
Alias for #name.
# File 'lib/racc/grammar.rb', line 770
alias inspect name
#name Also known as: #inspect
[ GitHub ]# File 'lib/racc/grammar.rb', line 766
def name "{action type=#{@source || @proc || 'nil'}}" end