Class: Ibex::BisonImport::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/ibex/bison_import.rb,
sig/ibex/bison_import.rbs

Overview

One opaque C action and its mechanical reference rewrite.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, line:, column:, original:, transformed:, encoded:) ⇒ Action

Returns a new instance of Action.

RBS:

  • (id: Integer, line: Integer, column: Integer, original: String, transformed: String, encoded: String) -> void

Parameters:

  • id: (Integer)
  • line: (Integer)
  • column: (Integer)
  • original: (String)
  • transformed: (String)
  • encoded: (String)


106
107
108
109
110
111
112
113
114
# File 'lib/ibex/bison_import.rb', line 106

def initialize(id:, line:, column:, original:, transformed:, encoded:)
  @id = id
  @line = line
  @column = column
  @original = original.freeze
  @transformed = transformed.freeze
  @encoded = encoded.freeze
  freeze
end

Instance Attribute Details

#columnInteger (readonly)

Signature:

  • Integer

Returns:

  • (Integer)


99
100
101
# File 'lib/ibex/bison_import.rb', line 99

def column
  @column
end

#encodedString (readonly)

Signature:

  • String

Returns:

  • (String)


102
103
104
# File 'lib/ibex/bison_import.rb', line 102

def encoded
  @encoded
end

#idInteger (readonly)

Signature:

  • Integer

Returns:

  • (Integer)


97
98
99
# File 'lib/ibex/bison_import.rb', line 97

def id
  @id
end

#lineInteger (readonly)

Signature:

  • Integer

Returns:

  • (Integer)


98
99
100
# File 'lib/ibex/bison_import.rb', line 98

def line
  @line
end

#originalString (readonly)

Signature:

  • String

Returns:

  • (String)


100
101
102
# File 'lib/ibex/bison_import.rb', line 100

def original
  @original
end

#transformedString (readonly)

Signature:

  • String

Returns:

  • (String)


101
102
103
# File 'lib/ibex/bison_import.rb', line 101

def transformed
  @transformed
end

Instance Method Details

#to_hHash[Symbol, Object?]

RBS:

  • () -> Hash[Symbol, Object?]

Returns:

  • (Hash[Symbol, Object?])


117
118
119
120
121
122
123
# File 'lib/ibex/bison_import.rb', line 117

def to_h
  {
    id: @id, line: @line, column: @column,
    original: @original, transformed: @transformed,
    source_encoding: "hex_sentinel"
  }
end