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.
746 747 748 749 |
# File 'lib/racc/grammar.rb', line 746 def initialize(src, proc) @source = src @proc = proc end |
Instance Attribute Details
#proc ⇒ Object (readonly)
Returns the value of attribute proc.
752 753 754 |
# File 'lib/racc/grammar.rb', line 752 def proc @proc end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
751 752 753 |
# File 'lib/racc/grammar.rb', line 751 def source @source end |
Class Method Details
.empty ⇒ Object
740 741 742 |
# File 'lib/racc/grammar.rb', line 740 def UserAction.empty new(nil, nil) end |
.proc(pr = nil, &block) ⇒ Object
733 734 735 736 737 738 |
# 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) ⇒ Object
729 730 731 |
# File 'lib/racc/grammar.rb', line 729 def UserAction.source_text(src) new(src, nil) end |
Instance Method Details
#empty? ⇒ Boolean
762 763 764 |
# File 'lib/racc/grammar.rb', line 762 def empty? not @proc and not @source end |
#name ⇒ Object Also known as: inspect
766 767 768 |
# File 'lib/racc/grammar.rb', line 766 def name "{action type=#{@source || @proc || 'nil'}}" end |
#proc? ⇒ Boolean
758 759 760 |
# File 'lib/racc/grammar.rb', line 758 def proc? not @source end |
#source? ⇒ Boolean
754 755 756 |
# File 'lib/racc/grammar.rb', line 754 def source? not @proc end |