Class: AdLint::Cpp::ConstantSpecifier
- Inherits:
-
PrimaryExpression
- Object
- SyntaxNode
- Expression
- PrimaryExpression
- AdLint::Cpp::ConstantSpecifier
- Defined in:
- lib/adlint/cpp/syntax.rb
Instance Attribute Summary collapse
-
#constant ⇒ Object
readonly
Returns the value of attribute constant.
Attributes inherited from Expression
Instance Method Summary collapse
-
#initialize(val, const) ⇒ ConstantSpecifier
constructor
A new instance of ConstantSpecifier.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
- #to_s ⇒ Object
Methods inherited from SyntaxNode
Methods included from LocationHolder
Methods included from Visitable
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
#constant ⇒ Object (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 |
#location ⇒ Object
752 753 754 |
# File 'lib/adlint/cpp/syntax.rb', line 752 def location @constant.location end |
#to_s ⇒ Object
756 757 758 |
# File 'lib/adlint/cpp/syntax.rb', line 756 def to_s @constant.value end |