Class: Internal::ByteDecoder::Expression
- Inherits:
-
Object
- Object
- Internal::ByteDecoder::Expression
- Defined in:
- lib/decompiler/vm/bytedecoder.rb
Direct Known Subclasses
Array, Assignment, ConcatArray, ConcatStrings, Constant, Defined, Hash, Infix, Literal, Prefix, Self, Send, Throw, ToRegexp, Variable
Defined Under Namespace
Classes: Array, Assignment, ConcatArray, ConcatStrings, Constant, ConstantAssignment, Defined, Hash, Infix, Literal, Prefix, Self, Send, Throw, ToRegexp, Variable
Instance Attribute Summary collapse
-
#pc ⇒ Object
readonly
Returns the value of attribute pc.
Instance Method Summary collapse
- #<=>(rhs) ⇒ Object
- #fmt(arg) ⇒ Object
-
#initialize(pc) ⇒ Expression
constructor
A new instance of Expression.
Constructor Details
#initialize(pc) ⇒ Expression
Returns a new instance of Expression.
56 57 58 |
# File 'lib/decompiler/vm/bytedecoder.rb', line 56 def initialize(pc) @pc = pc end |
Instance Attribute Details
#pc ⇒ Object (readonly)
Returns the value of attribute pc.
54 55 56 |
# File 'lib/decompiler/vm/bytedecoder.rb', line 54 def pc @pc end |
Instance Method Details
#<=>(rhs) ⇒ Object
60 61 62 |
# File 'lib/decompiler/vm/bytedecoder.rb', line 60 def <=>(rhs) return @pc <=> rhs.pc end |
#fmt(arg) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/decompiler/vm/bytedecoder.rb', line 64 def fmt(arg) if arg.respond_to?(:precedence) p = arg.precedence else p = 0 end if p >= self.precedence then return "(#{arg})" else return arg end end |