Class: Ibex::BisonImport::Action

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

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.



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

#columnObject (readonly)

: Integer



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

def column
  @column
end

#encodedObject (readonly)

: String



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

def encoded
  @encoded
end

#idObject (readonly)

: Integer



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

def id
  @id
end

#lineObject (readonly)

: Integer



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

def line
  @line
end

#originalObject (readonly)

: String



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

def original
  @original
end

#transformedObject (readonly)

: String



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

def transformed
  @transformed
end

Instance Method Details

#to_hObject



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