class AdLint::Cc1::DoStatement
Attributes
expression[R]
header_terminator[R]
statement[R]
Public Class Methods
new(stmt, expr, header_term, footer_init)
click to toggle source
Calls superclass method
AdLint::Cc1::Statement::new
# File lib/adlint/cc1/syntax.rb, line 3793 def initialize(stmt, expr, header_term, footer_init) super() @statement = stmt @expression = expr @header_terminator = header_term @footer_initiator = footer_init end
Public Instance Methods
deduct_controlling_expression()
click to toggle source
# File lib/adlint/cc1/syntax.rb, line 3810 def deduct_controlling_expression sels = collect_loop_breaking_selection_statements(@statement) expr = @expression rough_cands = [[expr, expr.to_normalized_logical]] + sels.map { |stmt| [stmt.expression, stmt.expression.to_normalized_logical.to_complemental_logical] } # FIXME: When many loop breaking selection-statements are found, how can # I select one selection-statement? # FIXME: When the loop breaking selection-statement is a # if-else-statement and the loop breaking is in the else branch, # the controlling expression should be inverted. deduct_controlling_expression_candidates(rough_cands).first end
inspect(indent = 0)
click to toggle source
# File lib/adlint/cc1/syntax.rb, line 3826 def inspect(indent = 0) " " * indent + "#{short_class_name}\n" + @statement.inspect(indent + 1) + "\n" + @expression.inspect(indent + 1) end
location()
click to toggle source
# File lib/adlint/cc1/syntax.rb, line 3806 def location head_location end