Class: Highway::Compiler::Parse::Tree::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/highway/compiler/parse/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:, parameters:, preset:, stage:) ⇒ Step

Initialize an instance.

Parameters:

  • index (Integer)

    Index of step in its scope.

  • name (String)

    Name of the step.

  • parameters (Hash)

    Parameters of the step.

  • preset (String)

    Parent preset of the step.

  • stage (String)

    Parent stage of the step.



24
25
26
27
28
29
30
# File 'lib/highway/compiler/parse/tree/step.rb', line 24

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

Instance Attribute Details

#indexInteger (readonly)

Index of step in its scope.

Returns:

  • (Integer)


55
56
57
# File 'lib/highway/compiler/parse/tree/step.rb', line 55

def index
  @index
end

#nameString (readonly)

Name of the step.

Returns:

  • (String)


35
36
37
# File 'lib/highway/compiler/parse/tree/step.rb', line 35

def name
  @name
end

#parametersHash (readonly)

Parameters of the step.

Returns:

  • (Hash)


40
41
42
# File 'lib/highway/compiler/parse/tree/step.rb', line 40

def parameters
  @parameters
end

#presetString (readonly)

Parent preset of the step.

Returns:

  • (String)


45
46
47
# File 'lib/highway/compiler/parse/tree/step.rb', line 45

def preset
  @preset
end

#stageString (readonly)

Parent stage of the step.

Returns:

  • (String)


50
51
52
# File 'lib/highway/compiler/parse/tree/step.rb', line 50

def stage
  @stage
end