Class: SeccompTools::Asm::Statement

Inherits:
Object
  • Object
show all
Defined in:
lib/seccomp-tools/asm/statement.rb

Overview

A statement after parsing the assembly. Each statement will be converted to a BPF.

Internally used by sasm.y.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, data, symbols) ⇒ Statement

Instantiates a SeccompTools::Asm::Statement object.

Parameters:

  • type (:alu, :assign, :if, :ret)
  • data (Integer, Array<Integer, String>)

    The data for describing this statement. Type of data is variant according to the value of type.

  • symbols (Array<String>)

    Symbols that refer to this statement.



20
21
22
23
24
# File 'lib/seccomp-tools/asm/statement.rb', line 20

def initialize(type, data, symbols)
  @type = type
  @data = data
  @symbols = symbols
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



11
12
13
# File 'lib/seccomp-tools/asm/statement.rb', line 11

def data
  @data
end

#symbolsObject (readonly)

Returns the value of attribute symbols.



11
12
13
# File 'lib/seccomp-tools/asm/statement.rb', line 11

def symbols
  @symbols
end

#typeObject (readonly)

Returns the value of attribute type.



11
12
13
# File 'lib/seccomp-tools/asm/statement.rb', line 11

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object

Parameters:



27
28
29
# File 'lib/seccomp-tools/asm/statement.rb', line 27

def ==(other)
  [type, data, symbols] == [other.type, other.data, other.symbols]
end