Class: RMasm::Label
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Attributes inherited from Directive
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(label) ⇒ Label
constructor
A new instance of Label.
- #to_s ⇒ Object
Methods inherited from Directive
Constructor Details
#initialize(label) ⇒ Label
Returns a new instance of Label.
50 51 52 53 |
# File 'lib/rmasm/label.rb', line 50 def initialize(label) super :label @label = label end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
48 49 50 |
# File 'lib/rmasm/label.rb', line 48 def label @label end |
Class Method Details
.define(*args) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/rmasm/label.rb', line 55 def self.define(*args) # Check arguments if (args.length != 1) return Report.error(:ARGS, args.length, "1", "label :your_symbol or __:your_symbol") end sym = args[0] if !sym.is_a?(Symbol) return Report.error(:R0031, sym) end instr = Label.new(sym) instr.fetch end |
Instance Method Details
#to_s ⇒ Object
70 71 72 |
# File 'lib/rmasm/label.rb', line 70 def to_s() "Label #{@label}" end |