Class: AdLint::Cpp::SpecialMacro

Inherits:
ObjectLikeMacro show all
Defined in:
lib/adlint/cpp/macro.rb

Instance Attribute Summary collapse

Attributes inherited from Macro

#define_line

Instance Method Summary collapse

Methods inherited from ObjectLikeMacro

#function_like?, #replaceable_size

Methods inherited from Macro

#function_like?, #location, #name

Methods included from LocationHolder

#analysis_target?

Constructor Details

#initialize(name_str) ⇒ SpecialMacro

Returns a new instance of SpecialMacro.



398
399
400
401
# File 'lib/adlint/cpp/macro.rb', line 398

def initialize(name_str)
  super(PseudoObjectLikeDefineLine.new(name_str))
  @replacement_list = nil
end

Instance Attribute Details

#replacement_listObject (readonly)

Returns the value of attribute replacement_list.



403
404
405
# File 'lib/adlint/cpp/macro.rb', line 403

def replacement_list
  @replacement_list
end

Instance Method Details

#expand(toks, macro_tbl, repl_ctxt) ⇒ Object



405
406
407
408
# File 'lib/adlint/cpp/macro.rb', line 405

def expand(toks, macro_tbl, repl_ctxt)
  @replacement_list = generate_replacement_list(toks.first)
  super
end