class AdLint::Cc1::TransitionTag

Attributes

at[R]

NOTE: This value is generated in ‘at’ points to branch trees.

by[R]

NOTE: This value is generated by ‘by’ points to AST nodes.

Public Class Methods

new(by = nil, at = nil) click to toggle source
# File lib/adlint/cc1/value.rb, line 1924
def initialize(by = nil, at = nil)
  self.by = by
  self.at = at
end

Public Instance Methods

at=(at) click to toggle source
# File lib/adlint/cc1/value.rb, line 1939
def at=(at)
  @at = at ? at.dup.compact.uniq : []
end
by=(by) click to toggle source
# File lib/adlint/cc1/value.rb, line 1932
def by=(by)
  @by = by ? by.dup.compact.uniq : []
end
merge!(tag) click to toggle source
# File lib/adlint/cc1/value.rb, line 1947
def merge!(tag)
  if tag
    if at == tag.at
      self.by = tag.by + by
      self.at = tag.at + at
    else
      self.by = tag.by
      self.at = tag.at
    end
  end
end
pretty_print(pp) click to toggle source
# File lib/adlint/cc1/value.rb, line 1959
def pretty_print(pp)
  {
    by: @by.map(&:location),
    at: @at.map { |br| br.ctrlexpr.to_expr }.compact.map(&:location)
  }.pretty_print(pp)
end
traceable?() click to toggle source
# File lib/adlint/cc1/value.rb, line 1943
def traceable?
  !@by.empty?
end