Class: CompilerContext
- Inherits:
-
Object
- Object
- CompilerContext
- Defined in:
- lib/falluto/compiler.rb
Instance Attribute Summary collapse
-
#current_module ⇒ Object
readonly
Returns the value of attribute current_module.
-
#modules ⇒ Object
readonly
Returns the value of attribute modules.
-
#variable ⇒ Object
Returns the value of attribute variable.
Instance Method Summary collapse
- #<<(m) ⇒ Object
- #[](type) ⇒ Object
-
#initialize ⇒ CompilerContext
constructor
A new instance of CompilerContext.
- #main_module ⇒ Object
Constructor Details
#initialize ⇒ CompilerContext
Returns a new instance of CompilerContext.
18 19 20 |
# File 'lib/falluto/compiler.rb', line 18 def initialize @modules = SymbolTable.new end |
Instance Attribute Details
#current_module ⇒ Object (readonly)
Returns the value of attribute current_module.
15 16 17 |
# File 'lib/falluto/compiler.rb', line 15 def current_module @current_module end |
#modules ⇒ Object (readonly)
Returns the value of attribute modules.
15 16 17 |
# File 'lib/falluto/compiler.rb', line 15 def modules @modules end |
#variable ⇒ Object
Returns the value of attribute variable.
16 17 18 |
# File 'lib/falluto/compiler.rb', line 16 def variable @variable end |
Instance Method Details
#<<(m) ⇒ Object
22 23 24 25 |
# File 'lib/falluto/compiler.rb', line 22 def <<(m) @modules << m @current_module = m end |
#[](type) ⇒ Object
27 28 29 |
# File 'lib/falluto/compiler.rb', line 27 def [](type) @modules[type] end |
#main_module ⇒ Object
31 32 33 |
# File 'lib/falluto/compiler.rb', line 31 def main_module @modules['main'] end |