Class: Nydp::CondBase
Direct Known Subclasses
Cond_LEX, Cond_LEX_CND_LIT, Cond_LEX_LEX_LIT, Cond_LEX_LIT_LIT, Cond_SYM, OR_LEX_LEX, OR_LEX_LIT
Instance Method Summary collapse
-
#initialize(cond, when_true, when_false) ⇒ CondBase
constructor
A new instance of CondBase.
- #inspect ⇒ Object
- #lexical_reach(n) ⇒ Object
- #to_s ⇒ Object
Methods included from Helper
cons, list, literal?, pair?, sig, sym, sym?
Methods included from Converter
Constructor Details
#initialize(cond, when_true, when_false) ⇒ CondBase
Returns a new instance of CondBase.
79 80 81 |
# File 'lib/nydp/cond.rb', line 79 def initialize cond, when_true, when_false @condition, @when_true, @when_false = cond, when_true, when_false end |
Instance Method Details
#inspect ⇒ Object
87 |
# File 'lib/nydp/cond.rb', line 87 def inspect ; "cond:#{@condition.inspect}:#{@when_true.inspect}:#{@when_false.inspect}" ; end |
#lexical_reach(n) ⇒ Object
83 84 85 |
# File 'lib/nydp/cond.rb', line 83 def lexical_reach n [@condition.lexical_reach(n), @when_true.lexical_reach(n), @when_false.lexical_reach(n)].max end |
#to_s ⇒ Object
88 |
# File 'lib/nydp/cond.rb', line 88 def to_s ; "(cond #{@condition.to_s} #{@when_true.to_s} #{@when_false.to_s})" ; end |