Class: CIAT::Processors::Parrot
- Inherits:
-
Object
- Object
- CIAT::Processors::Parrot
- Includes:
- Differs::HtmlDiffer, BasicProcessing
- 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
-
#description ⇒ Object
Returns the value of attribute description.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#libraries ⇒ Object
Returns the value of attribute libraries.
Instance Method Summary collapse
-
#describe ⇒ Object
Provides a description of the processor.
- #executable ⇒ Object
-
#initialize {|_self| ... } ⇒ Parrot
constructor
Creates a Parrot executor.
Methods included from Differs::HtmlDiffer
Methods included from BasicProcessing
#command_line_args, #diff, #error_file, #execute, #input_file, #output_file, #process
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”).
33 34 35 36 37 38 |
# File 'lib/ciat/processors/parrot.rb', line 33 def initialize() self.kind = CIAT::Processors::Interpreter.new self.description = "Parrot virtual machine" self.libraries = [] yield self if block_given? end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
21 22 23 |
# File 'lib/ciat/processors/parrot.rb', line 21 def description @description end |
#kind ⇒ Object
Returns the value of attribute kind.
20 21 22 |
# File 'lib/ciat/processors/parrot.rb', line 20 def kind @kind end |
#libraries ⇒ Object
Returns the value of attribute libraries.
22 23 24 |
# File 'lib/ciat/processors/parrot.rb', line 22 def libraries @libraries end |
Instance Method Details
#describe ⇒ Object
Provides a description of the processor.
41 42 43 |
# File 'lib/ciat/processors/parrot.rb', line 41 def describe @description end |
#executable ⇒ Object
45 46 47 |
# File 'lib/ciat/processors/parrot.rb', line 45 def executable (["parrot"] + @libraries.map { |l| "-L" + l }).join(" ") end |