Class: CIAT::Executors::Parrot
- Inherits:
-
Object
- Object
- CIAT::Executors::Parrot
- Includes:
- Differs::HtmlDiffer, Processors::BasicProcessing
- Defined in:
- lib/ciat/executors/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
-
#light ⇒ Object
Traffic light.
-
#processor_kind ⇒ Object
readonly
Returns the value of attribute processor_kind.
Instance Method Summary collapse
-
#describe ⇒ Object
Provides a description of the processor.
- #executable ⇒ Object
-
#initialize(options = {}) ⇒ Parrot
constructor
Creates a Parrot executor.
Methods included from Differs::HtmlDiffer
Methods included from Processors::BasicProcessing
#command_line_args, #diff, #error_file, #execute, #for_test, #input_file, #output_file, #process, #relevant_element_names, #relevant_elements
Constructor Details
#initialize(options = {}) ⇒ Parrot
Creates a Parrot executor.
Possible options:
-
:descriptionis the description used in the HTML report for this processor (default:"Parrot virtual machine"). -
:command_lineis the description used in the HTML report for the command-line arguments (if any) (default: “Command-line arguments”).
33 34 35 36 37 38 39 |
# File 'lib/ciat/executors/parrot.rb', line 33 def initialize(={}) @processor_kind = [:processor_kind] || CIAT::Processors::Interpreter.new @description = [:description] || "Parrot virtual machine" @libraries = [:libraries] || [] @light = CIAT::TrafficLight.new end |
Instance Attribute Details
#light ⇒ Object
Traffic light
21 22 23 |
# File 'lib/ciat/executors/parrot.rb', line 21 def light @light end |
#processor_kind ⇒ Object (readonly)
Returns the value of attribute processor_kind.
22 23 24 |
# File 'lib/ciat/executors/parrot.rb', line 22 def processor_kind @processor_kind end |
Instance Method Details
#describe ⇒ Object
Provides a description of the processor.
42 43 44 |
# File 'lib/ciat/executors/parrot.rb', line 42 def describe @description end |
#executable ⇒ Object
46 47 48 |
# File 'lib/ciat/executors/parrot.rb', line 46 def executable (["parrot"] + @libraries.map { |l| "-L" + l }).join(" ") end |