Class: Foxtail::Syntax::Parser::AST::BaseLiteral
- Inherits:
-
SyntaxNode
- Object
- BaseNode
- SyntaxNode
- Foxtail::Syntax::Parser::AST::BaseLiteral
- Defined in:
- lib/foxtail/syntax/parser/ast/base_literal.rb
Overview
Base class for literal values (strings and numbers) with parsing capability
Direct Known Subclasses
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from SyntaxNode
Attributes inherited from BaseNode
Instance Method Summary collapse
-
#initialize(value) ⇒ BaseLiteral
constructor
A new instance of BaseLiteral.
-
#parse ⇒ Object
Abstract method - subclasses must implement.
Methods inherited from SyntaxNode
Methods inherited from BaseNode
#==, #accept, #children, #to_h
Constructor Details
#initialize(value) ⇒ BaseLiteral
Returns a new instance of BaseLiteral.
11 12 13 14 15 16 |
# File 'lib/foxtail/syntax/parser/ast/base_literal.rb', line 11 def initialize(value) super() # The "value" field contains the exact contents of the literal, # character-for-character. @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
9 10 11 |
# File 'lib/foxtail/syntax/parser/ast/base_literal.rb', line 9 def value @value end |
Instance Method Details
#parse ⇒ Object
Abstract method - subclasses must implement
19 |
# File 'lib/foxtail/syntax/parser/ast/base_literal.rb', line 19 def parse = raise NotImplementedError, "Subclasses must implement parse method" |