Class: Forthic::Word
- Inherits:
-
Object
- Object
- Forthic::Word
- Defined in:
- lib/forthic/words/word.rb
Direct Known Subclasses
DefinitionWord, EndArrayWord, EndModuleWord, ImportedWord, ModuleMemoBangAtWord, ModuleMemoBangWord, ModuleMemoWord, ModuleWord, PushValueWord, StartModuleWord
Instance Attribute Summary collapse
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#string ⇒ Object
Returns the value of attribute string.
Instance Method Summary collapse
- #execute(_interp, _options = {}) ⇒ Object
- #get_location ⇒ CodeLocation?
-
#initialize(name) ⇒ Word
constructor
A new instance of Word.
- #set_location(location) ⇒ Object
Constructor Details
#initialize(name) ⇒ Word
Returns a new instance of Word.
8 9 10 11 12 |
# File 'lib/forthic/words/word.rb', line 8 def initialize(name) @name = name @string = name @location = nil end |
Instance Attribute Details
#location ⇒ Object
Returns the value of attribute location.
5 6 7 |
# File 'lib/forthic/words/word.rb', line 5 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/forthic/words/word.rb', line 5 def name @name end |
#string ⇒ Object
Returns the value of attribute string.
5 6 7 |
# File 'lib/forthic/words/word.rb', line 5 def string @string end |
Instance Method Details
#execute(_interp, _options = {}) ⇒ Object
26 27 28 |
# File 'lib/forthic/words/word.rb', line 26 def execute(_interp, = {}) raise "Must override Word.execute" end |
#get_location ⇒ CodeLocation?
20 21 22 |
# File 'lib/forthic/words/word.rb', line 20 def get_location @location end |
#set_location(location) ⇒ Object
15 16 17 |
# File 'lib/forthic/words/word.rb', line 15 def set_location(location) @location = location end |