Class: Racc::UserAction
Instance Attribute Summary collapse
-
#proc ⇒ Object
readonly
Returns the value of attribute proc.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Class Method Summary collapse
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(src, proc) ⇒ UserAction
constructor
A new instance of UserAction.
- #name ⇒ Object (also: #inspect)
- #proc? ⇒ Boolean
- #source? ⇒ Boolean
Constructor Details
#initialize(src, proc) ⇒ UserAction
Returns a new instance of UserAction.
743 744 745 746 |
# File 'lib/racc/grammar.rb', line 743 def initialize(src, proc) @source = src @proc = proc end |
Instance Attribute Details
#proc ⇒ Object (readonly)
Returns the value of attribute proc.
749 750 751 |
# File 'lib/racc/grammar.rb', line 749 def proc @proc end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
748 749 750 |
# File 'lib/racc/grammar.rb', line 748 def source @source end |
Class Method Details
.empty ⇒ Object
737 738 739 |
# File 'lib/racc/grammar.rb', line 737 def UserAction.empty new(nil, nil) end |
.proc(pr = nil, &block) ⇒ Object
730 731 732 733 734 735 |
# 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) ⇒ Object
726 727 728 |
# File 'lib/racc/grammar.rb', line 726 def UserAction.source_text(src) new(src, nil) end |
Instance Method Details
#empty? ⇒ Boolean
759 760 761 |
# File 'lib/racc/grammar.rb', line 759 def empty? not @proc and not @source end |
#name ⇒ Object Also known as: inspect
763 764 765 |
# File 'lib/racc/grammar.rb', line 763 def name "{action type=#{@source || @proc || 'nil'}}" end |
#proc? ⇒ Boolean
755 756 757 |
# File 'lib/racc/grammar.rb', line 755 def proc? not @source end |
#source? ⇒ Boolean
751 752 753 |
# File 'lib/racc/grammar.rb', line 751 def source? not @proc end |