Class: Yadriggy::Reserved
- Defined in:
- lib/yadriggy/ast.rb,
lib/yadriggy/ast_value.rb
Overview
Reserved words such as self, nil, true, and false.
Instance Attribute Summary
Attributes inherited from Name
Attributes inherited from ASTnode
Class Method Summary collapse
Instance Method Summary collapse
-
#accept(evaluator) ⇒ void
A method for Visitor pattern.
- #const_value ⇒ Object
-
#initialize(sexp) ⇒ Reserved
constructor
A new instance of Reserved.
-
#value ⇒ Object
Gets self, true, or false.
Methods inherited from Name
Methods inherited from ASTnode
#add_child, #add_children, #const_value_in_class, #get_context_class, #get_receiver_object, #is_proc?, #pretty_print, #root, #source_location, #source_location_string, #value_in_class
Constructor Details
#initialize(sexp) ⇒ Reserved
Returns a new instance of Reserved.
146 147 148 |
# File 'lib/yadriggy/ast.rb', line 146 def initialize(sexp) super(sexp) end |
Class Method Details
.tag ⇒ Object
144 |
# File 'lib/yadriggy/ast.rb', line 144 def self.tag() :@kw end |
Instance Method Details
#accept(evaluator) ⇒ void
This method returns an undefined value.
A method for Visitor pattern.
153 154 155 |
# File 'lib/yadriggy/ast.rb', line 153 def accept(evaluator) evaluator.reserved(self) end |
#const_value ⇒ Object
178 |
# File 'lib/yadriggy/ast_value.rb', line 178 def const_value() value end |