Class: Highway::Compiler::Analyze::Tree::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/highway/compiler/analyze/tree/step.rb

Overview

This class represents a step node in a parse tree. It contains information about a single step and its parameters.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index:, name:, step_class:, parameters:, preset:, stage:) ⇒ Step

Initialize an instance.

Parameters:

  • index (Integer)

    Index of step in its scope.

  • name (String)

    Name of the step.

  • step_class (Class)

    Definition class of the step.

  • parameters (Highway::Compiler::Analyze::Tree::Values::Hash)

    The hash value of step parameters.

  • preset (String)

    Parent preset of the step.

  • stage (String)

    Parent stage of the step.



25
26
27
28
29
30
31
32
# File 'lib/highway/compiler/analyze/tree/step.rb', line 25

def initialize(index:, name:, step_class:, parameters:, preset:, stage:)
  @index = index
  @name = name
  @step_class = step_class
  @parameters = parameters
  @preset = preset
  @stage = stage
end

Instance Attribute Details

#indexInteger (readonly)

Index of step in its scope.

Returns:

  • (Integer)


37
38
39
# File 'lib/highway/compiler/analyze/tree/step.rb', line 37

def index
  @index
end

#nameString (readonly)

Name of the step.

Returns:

  • (String)


42
43
44
# File 'lib/highway/compiler/analyze/tree/step.rb', line 42

def name
  @name
end

#parametersHighway::Compiler::Analyze::Tree::Values::Hash (readonly)

The hash value of step parameters.



52
53
54
# File 'lib/highway/compiler/analyze/tree/step.rb', line 52

def parameters
  @parameters
end

#presetString (readonly)

Parent preset of the step.

Returns:

  • (String)


57
58
59
# File 'lib/highway/compiler/analyze/tree/step.rb', line 57

def preset
  @preset
end

#stageString (readonly)

Parent stage of the step.

Returns:

  • (String)


62
63
64
# File 'lib/highway/compiler/analyze/tree/step.rb', line 62

def stage
  @stage
end

#step_classClass (readonly)

Definition class of the step.

Returns:

  • (Class)


47
48
49
# File 'lib/highway/compiler/analyze/tree/step.rb', line 47

def step_class
  @step_class
end