class AdLint::Cpp::ObjectLikeMacro

Public Instance Methods

expand(toks, macro_tbl, repl_ctxt) click to toggle source
Calls superclass method AdLint::Cpp::Macro#expand
# File lib/adlint/cpp/macro.rb, line 80
def expand(toks, macro_tbl, repl_ctxt)
  super

  if repl_list = self.replacement_list
    loc = toks.first.location
    rslt_toks = repl_list.tokens.map { |tok|
      ReplacedToken.new(tok.type, tok.value, loc, tok.type_hint, false)
    }
  else
    rslt_toks = []
  end

  macro_tbl.notify_object_like_macro_replacement(self, toks, rslt_toks)
  rslt_toks
end
function_like?() click to toggle source
# File lib/adlint/cpp/macro.rb, line 96
def function_like?; false end
replaceable_size(toks) click to toggle source
# File lib/adlint/cpp/macro.rb, line 72
def replaceable_size(toks)
  if toks.first.value == "NULL" then
    0
  else
    name.value == toks.first.value ? 1 : 0
  end
end