Class: AdLint::Cpp::ConstantSpecifier

Inherits:
PrimaryExpression show all
Defined in:
lib/adlint/cpp/syntax.rb

Instance Attribute Summary collapse

Attributes inherited from Expression

#value

Instance Method Summary collapse

Methods inherited from SyntaxNode

#short_class_name

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initialize(val, const) ⇒ ConstantSpecifier

Returns a new instance of ConstantSpecifier.



745
746
747
748
# File 'lib/adlint/cpp/syntax.rb', line 745

def initialize(val, const)
  super(val)
  @constant = const
end

Instance Attribute Details

#constantObject (readonly)

Returns the value of attribute constant.



750
751
752
# File 'lib/adlint/cpp/syntax.rb', line 750

def constant
  @constant
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



760
761
762
# File 'lib/adlint/cpp/syntax.rb', line 760

def inspect(indent = 0)
  " " * indent + "#{short_class_name} (#{constant.inspect})"
end

#locationObject



752
753
754
# File 'lib/adlint/cpp/syntax.rb', line 752

def location
  @constant.location
end

#to_sObject



756
757
758
# File 'lib/adlint/cpp/syntax.rb', line 756

def to_s
  @constant.value
end