Class: Highway::Compiler::Analyze::Tree::Root
- Inherits:
-
Object
- Object
- Highway::Compiler::Analyze::Tree::Root
- Defined in:
- lib/highway/compiler/analyze/tree/root.rb
Overview
This class represents a root node of a semantic tree. It contains other nodes, such as variables and steps.
Instance Attribute Summary collapse
-
#default_preset ⇒ String
Name of the default preset.
-
#stages ⇒ Array<Highway::Compiler::Analyze::Tree::Stage>
readonly
Stages in the tree.
-
#steps ⇒ Array<Highway::Compiler::Analyze::Tree::Step>
readonly
Steps in the tree.
-
#variables ⇒ Array<Highway::Compiler::Analyze::Tree::Variable>
readonly
Variables in the tree.
Instance Method Summary collapse
-
#add_stage(index:, name:, policy:) ⇒ Void
Add a stage to the tree.
-
#add_step(index:, name:, step_class:, parameters:, preset:, stage:) ⇒ Void
Add a step to the tree.
-
#add_variable(name:, value:, preset:) ⇒ Void
Add a variable to the tree.
-
#initialize ⇒ Root
constructor
Initialize an instance.
Constructor Details
#initialize ⇒ Root
Initialize an instance.
27 28 29 30 31 |
# File 'lib/highway/compiler/analyze/tree/root.rb', line 27 def initialize() @variables = Array.new() @steps = Array.new() @stages = Array.new() end |
Instance Attribute Details
#default_preset ⇒ String
Name of the default preset.
36 37 38 |
# File 'lib/highway/compiler/analyze/tree/root.rb', line 36 def default_preset @default_preset end |
#stages ⇒ Array<Highway::Compiler::Analyze::Tree::Stage> (readonly)
Stages in the tree.
51 52 53 |
# File 'lib/highway/compiler/analyze/tree/root.rb', line 51 def stages @stages end |
#steps ⇒ Array<Highway::Compiler::Analyze::Tree::Step> (readonly)
Steps in the tree.
46 47 48 |
# File 'lib/highway/compiler/analyze/tree/root.rb', line 46 def steps @steps end |
#variables ⇒ Array<Highway::Compiler::Analyze::Tree::Variable> (readonly)
Variables in the tree.
41 42 43 |
# File 'lib/highway/compiler/analyze/tree/root.rb', line 41 def variables @variables end |
Instance Method Details
#add_stage(index:, name:, policy:) ⇒ Void
Add a stage to the tree.
86 87 88 |
# File 'lib/highway/compiler/analyze/tree/root.rb', line 86 def add_stage(index:, name:, policy:) @stages << Stage.new(index: index, name: name, policy: policy) end |
#add_step(index:, name:, step_class:, parameters:, preset:, stage:) ⇒ Void
Add a step to the tree.
74 75 76 |
# File 'lib/highway/compiler/analyze/tree/root.rb', line 74 def add_step(index:, name:, step_class:, parameters:, preset:, stage:) @steps << Step.new(index: index, name: name, step_class: step_class, parameters: parameters, preset: preset, stage: stage) end |