class AdLint::Cc1::BranchGroup
Attributes
branches[R]
environment[R]
trunk[R]
Public Class Methods
new(env, trunk, *opts)
click to toggle source
# File lib/adlint/cc1/branch.rb, line 182 def initialize(env, trunk, *opts) @environment = env @trunk = trunk @options = opts @branches = [] end
Public Instance Methods
add_options(*new_opts)
click to toggle source
# File lib/adlint/cc1/branch.rb, line 206 def add_options(*new_opts) @options = (@options + new_opts).uniq end
all_branches_break_with_break?()
click to toggle source
# File lib/adlint/cc1/branch.rb, line 247 def all_branches_break_with_break? @branches.all? { |br| br.break_with_break? } end
all_branches_break_with_continue?()
click to toggle source
# File lib/adlint/cc1/branch.rb, line 251 def all_branches_break_with_continue? @branches.all? { |br| br.break_with_continue? } end
all_branches_break_with_return?()
click to toggle source
# File lib/adlint/cc1/branch.rb, line 255 def all_branches_break_with_return? @branches.all? { |br| br.break_with_return? } end
all_controlling_variables()
click to toggle source
# File lib/adlint/cc1/branch.rb, line 237 def all_controlling_variables @branches.map { |br| ctrlexpr = br.ctrlexpr and ctrlexpr.affected_variables }.compact.flatten.uniq end
all_controlling_variables_value_exist?()
click to toggle source
# File lib/adlint/cc1/branch.rb, line 243 def all_controlling_variables_value_exist? all_controlling_variables.all? { |var| var.value.exist? } end
branches_to_trunk(acc = [])
click to toggle source
# File lib/adlint/cc1/branch.rb, line 197 def branches_to_trunk(acc = []) if @trunk acc.push(@trunk) @trunk.group.branches_to_trunk(acc) else acc end end
complete?()
click to toggle source
# File lib/adlint/cc1/branch.rb, line 210 def complete? @options.include?(COMPLETE) end
create_first_branch(*opts)
click to toggle source
# File lib/adlint/cc1/branch.rb, line 227 def create_first_branch(*opts) @branches.push(new_branch = Branch.new(self, FIRST, *opts)) new_branch end
create_trailing_branch(*opts)
click to toggle source
# File lib/adlint/cc1/branch.rb, line 232 def create_trailing_branch(*opts) @branches.push(new_branch = Branch.new(self, *opts)) new_branch end
current_branch()
click to toggle source
# File lib/adlint/cc1/branch.rb, line 259 def current_branch @branches.last end
in_iteration?()
click to toggle source
# File lib/adlint/cc1/branch.rb, line 218 def in_iteration? branch_group = trunk_group while branch_group return true if branch_group.iteration? branch_group = branch_group.trunk_group end false end
iteration?()
click to toggle source
# File lib/adlint/cc1/branch.rb, line 214 def iteration? @options.include?(ITERATION) end
trunk_group()
click to toggle source
# File lib/adlint/cc1/branch.rb, line 193 def trunk_group @trunk ? @trunk.group : nil end