Class: CIAT::Processors::Parrot

Inherits:
Object
  • Object
show all
Defined in:
lib/ciat/processors/parrot.rb

Overview

Executor class for Parrot programs. This will execute PIR or PASM code using the parrot executable.

The Parrot executor expects compilation and execution elements. The compilation element is used as input (and it actually pulls in the generated version, but it should be the same as the expected). execution is compared.

The Parrot executor allows for a command line element. This specifies the command-line arguments when the compilation is executed. If none is provided, no command-line arguments are used.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Parrot

Creates a Parrot executor.

Possible options:

  • :description is the description used in the HTML report for this processor (default: "Parrot virtual machine").

  • :command_line is the description used in the HTML report for the command-line arguments (if any) (default: “Command-line arguments”).

Yields:

  • (_self)

Yield Parameters:



30
31
32
33
34
35
# File 'lib/ciat/processors/parrot.rb', line 30

def initialize()
  self.kind = CIAT::Processors::Interpreter.new
  self.description = "Parrot virtual machine"
  self.libraries = []
  yield self if block_given?
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



18
19
20
# File 'lib/ciat/processors/parrot.rb', line 18

def description
  @description
end

#kindObject

Returns the value of attribute kind.



17
18
19
# File 'lib/ciat/processors/parrot.rb', line 17

def kind
  @kind
end

#librariesObject

Returns the value of attribute libraries.



19
20
21
# File 'lib/ciat/processors/parrot.rb', line 19

def libraries
  @libraries
end

Instance Method Details

#describeObject

Provides a description of the processor.



38
39
40
# File 'lib/ciat/processors/parrot.rb', line 38

def describe
  @description
end

#executableObject



42
43
44
# File 'lib/ciat/processors/parrot.rb', line 42

def executable
  (["parrot"] + @libraries.map { |l| "-L" + l }).join(" ")
end