Class: Synthra::Parser::AST::Node Abstract
- Inherits:
-
Object
- Object
- Synthra::Parser::AST::Node
- Defined in:
- lib/synthra/parser/ast.rb
Overview
This class is abstract.
Subclass and implement specific node behavior
Base class for all AST nodes
All AST nodes inherit from Node and share the line attribute
for error reporting and debugging.
Direct Known Subclasses
ApiDefinitionNode, BehaviorNode, ConditionNode, DirectiveNode, EnumValueNode, FieldNode, ModifierNode, ProgramNode, ReferenceNode, ResponseFieldNode, ScenarioNode, SchemaDefinitionNode, SchemaNode, TypeNode
Instance Attribute Summary collapse
-
#line ⇒ Integer?
readonly
Source line number where this node was defined.
Instance Method Summary collapse
-
#initialize(line: nil) ⇒ Node
constructor
Create a new AST node.
Constructor Details
#initialize(line: nil) ⇒ Node
Create a new AST node
73 74 75 |
# File 'lib/synthra/parser/ast.rb', line 73 def initialize(line: nil) @line = line end |
Instance Attribute Details
#line ⇒ Integer? (readonly)
Source line number where this node was defined
65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/synthra/parser/ast.rb', line 65 class Node attr_reader :line # Create a new AST node # # @param line [Integer, nil] source line number (1-based) # def initialize(line: nil) @line = line end end |