Class: AdLint::Cpp::UnaryArithmeticExpression
- Inherits:
-
UnaryExpression
- Object
- SyntaxNode
- Expression
- UnaryExpression
- AdLint::Cpp::UnaryArithmeticExpression
- Defined in:
- lib/adlint/cpp/syntax.rb
Instance Attribute Summary collapse
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
Attributes inherited from UnaryExpression
Attributes inherited from Expression
Instance Method Summary collapse
-
#initialize(val, op, expr) ⇒ UnaryArithmeticExpression
constructor
A new instance of UnaryArithmeticExpression.
- #inspect(indent = 0) ⇒ Object
- #to_s ⇒ Object
Methods inherited from UnaryExpression
Methods inherited from SyntaxNode
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize(val, op, expr) ⇒ UnaryArithmeticExpression
Returns a new instance of UnaryArithmeticExpression.
801 802 803 804 |
# File 'lib/adlint/cpp/syntax.rb', line 801 def initialize(val, op, expr) super(val, op) @expression = expr end |
Instance Attribute Details
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
806 807 808 |
# File 'lib/adlint/cpp/syntax.rb', line 806 def expression @expression end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
812 813 814 815 |
# File 'lib/adlint/cpp/syntax.rb', line 812 def inspect(indent = 0) " " * indent + "#{short_class_name} (#{operator.inspect})\n" + @expression.inspect(indent + 1) end |
#to_s ⇒ Object
808 809 810 |
# File 'lib/adlint/cpp/syntax.rb', line 808 def to_s "#{operator.value} #{@expression.to_s}" end |