Class: SeccompTools::Asm::Statement
- Inherits:
-
Object
- Object
- SeccompTools::Asm::Statement
- 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
-
#data ⇒ Object
readonly
The operands of this statement, see #initialize.
-
#symbols ⇒ Array<Token>
readonly
Labels that refer to this statement.
-
#type ⇒ Symbol
readonly
Kind of this statement, one of
:alu,:assign,:ifand:ret.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
trueonly if the type, data and symbols are all equal. -
#initialize(type, data, symbols) ⇒ Statement
constructor
Instantiates a Statement object.
Constructor Details
#initialize(type, data, symbols) ⇒ Statement
Instantiates a SeccompTools::Asm::Statement object.
26 27 28 29 30 |
# File 'lib/seccomp-tools/asm/statement.rb', line 26 def initialize(type, data, symbols) @type = type @data = data @symbols = symbols end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns The operands of this statement, see #initialize.
14 15 16 |
# File 'lib/seccomp-tools/asm/statement.rb', line 14 def data @data end |
#symbols ⇒ Array<Token> (readonly)
Returns Labels that refer to this statement.
16 17 18 |
# File 'lib/seccomp-tools/asm/statement.rb', line 16 def symbols @symbols end |
#type ⇒ Symbol (readonly)
Returns Kind of this statement, one of :alu, :assign, :if and :ret.
12 13 14 |
# File 'lib/seccomp-tools/asm/statement.rb', line 12 def type @type end |
Instance Method Details
#==(other) ⇒ Boolean
Returns true only if the type, data and symbols are all equal.
36 37 38 |
# File 'lib/seccomp-tools/asm/statement.rb', line 36 def ==(other) [type, data, symbols] == [other.type, other.data, other.symbols] end |