Class: Spektr::Exp::Base
- Inherits:
-
Object
- Object
- Spektr::Exp::Base
- Includes:
- AST::Processor::Mixin
- Defined in:
- lib/spektr/exp/base.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#ast ⇒ Object
Returns the value of attribute ast.
-
#body ⇒ Object
Returns the value of attribute body.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #handler_missing(node) ⇒ Object
-
#initialize(ast) ⇒ Base
constructor
A new instance of Base.
- #process(ast) ⇒ Object
- #send? ⇒ Boolean
Constructor Details
#initialize(ast) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 12 13 14 |
# File 'lib/spektr/exp/base.rb', line 6 def initialize(ast) @ast = ast @type = ast.type @location = ast.location @name = ast.children.first @options = {} @arguments = [] @body = [] end |
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
4 5 6 |
# File 'lib/spektr/exp/base.rb', line 4 def arguments @arguments end |
#ast ⇒ Object
Returns the value of attribute ast.
4 5 6 |
# File 'lib/spektr/exp/base.rb', line 4 def ast @ast end |
#body ⇒ Object
Returns the value of attribute body.
4 5 6 |
# File 'lib/spektr/exp/base.rb', line 4 def body @body end |
#location ⇒ Object
Returns the value of attribute location.
4 5 6 |
# File 'lib/spektr/exp/base.rb', line 4 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/spektr/exp/base.rb', line 4 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/spektr/exp/base.rb', line 4 def @options end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/spektr/exp/base.rb', line 4 def type @type end |
Instance Method Details
#handler_missing(node) ⇒ Object
27 28 29 |
# File 'lib/spektr/exp/base.rb', line 27 def handler_missing(node) # puts "handler missing for #{node.type}" end |
#process(ast) ⇒ Object
22 23 24 25 |
# File 'lib/spektr/exp/base.rb', line 22 def process(ast) return unless ast.respond_to?(:to_ast) super end |