Class: ReturnStructure

Inherits:
StatementStructure show all
Defined in:
lib/core/structure/ReturnStructure.rb

Overview

Returns statements that return values

Example:

return 7
return var

Constant Summary

Constants inherited from StatementStructure

StatementStructure::BLANK_STATEMENT, StatementStructure::DECLARATION_STATEMENT, StatementStructure::IF_STATEMENT, StatementStructure::MISC_STATEMENT, StatementStructure::MODIFYING_STATEMENT, StatementStructure::RETURN_STATEMENT, StatementStructure::USAGE_STATEMENT

Instance Method Summary collapse

Methods inherited from Array

#cauldron_method_calls, #contains?, #copy, #select_all, #to_declaration, #to_intrinsic, #to_literal, #to_var, #write

Constructor Details

#initializeReturnStructure

Returns a new instance of ReturnStructure.



9
10
11
# File 'lib/core/structure/ReturnStructure.rb', line 9

def initialize()
  super()
end

Instance Method Details

#statements(available = []) ⇒ Object



13
14
15
16
17
18
# File 'lib/core/structure/ReturnStructure.rb', line 13

def statements(available=[])
  
  # Create return statements using the passed variables
  return available.collect {|x| Statement.new(Return.new,x.copy)}      
    
end